Skip to content

Commit 5285f63

Browse files
authored
Merge pull request python-telegram-bot#388 from python-telegram-bot/emoji
deprecate telegram.Emoji
2 parents 6647ae3 + fe14000 commit 5285f63

File tree

3 files changed

+20
-51
lines changed

3 files changed

+20
-51
lines changed

docs/source/telegram.emoji.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

telegram/emoji.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22
# flake8: noqa
3-
# pylint: disable=C0103,R0903
3+
# pylint: disable=C0103,R0903,E0213
44
#
55
# A library that provides a Python interface to the Telegram Bot API
66
# Copyright (C) 2015-2016
@@ -18,14 +18,27 @@
1818
#
1919
# You should have received a copy of the GNU Lesser Public License
2020
# along with this program. If not, see [http://www.gnu.org/licenses/].
21-
"""This module contains a object that represents an Emoji."""
21+
"""This module contains a object that represents an Emoji.
2222
23-
from future.utils import bytes_to_native_str as n
23+
This module will be removed in the future.
24+
"""
2425

26+
import warnings
2527

26-
class Emoji(object):
28+
from future.utils import bytes_to_native_str
29+
30+
31+
class Emoji2(object):
2732
"""This object represents an Emoji."""
2833

34+
def n(b):
35+
36+
def e(cls):
37+
warnings.warn("telegram.Emoji is being deprecated, please see https://git.io/v6DeB")
38+
return bytes_to_native_str(b)
39+
40+
return property(e)
41+
2942
GRINNING_FACE_WITH_SMILING_EYES = n(b'\xF0\x9F\x98\x81')
3043
FACE_WITH_TEARS_OF_JOY = n(b'\xF0\x9F\x98\x82')
3144
SMILING_FACE_WITH_OPEN_MOUTH = n(b'\xF0\x9F\x98\x83')
@@ -879,3 +892,6 @@ class Emoji(object):
879892
CLOCK_FACE_TEN_THIRTY = n(b'\xF0\x9F\x95\xA5')
880893
CLOCK_FACE_ELEVEN_THIRTY = n(b'\xF0\x9F\x95\xA6')
881894
CLOCK_FACE_TWELVE_THIRTY = n(b'\xF0\x9F\x95\xA7')
895+
896+
897+
Emoji = Emoji2()

tests/test_emoji.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)