aboutsummaryrefslogtreecommitdiff
path: root/discord/message.py
diff options
context:
space:
mode:
authorZomatree <[email protected]>2020-11-23 10:09:20 +0000
committerGitHub <[email protected]>2020-11-23 05:09:20 -0500
commit344cb96c5dbdae438be8d99cf8dbd65b166db93f (patch)
tree5a4a5a854a0daffbbf81267454f0d2a24cf25125 /discord/message.py
parentSuppress the creation of a command window from ffmpeg on Windows (diff)
downloaddiscord.py-344cb96c5dbdae438be8d99cf8dbd65b166db93f.tar.xz
discord.py-344cb96c5dbdae438be8d99cf8dbd65b166db93f.zip
Add sticker support
Diffstat (limited to 'discord/message.py')
-rw-r--r--discord/message.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/discord/message.py b/discord/message.py
index 8c3d9c78..e28bb8ae 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -43,6 +43,7 @@ from .file import File
from .utils import escape_mentions
from .guild import Guild
from .mixins import Hashable
+from .sticker import Sticker
class Attachment:
@@ -348,6 +349,10 @@ class Message(Hashable):
- ``description``: A string representing the application's description.
- ``icon``: A string representing the icon ID of the application.
- ``cover_image``: A string representing the embed's image asset ID.
+ stickers: List[:class:`Sticker`]
+ A list of stickers given to the message.
+
+ .. versionadded:: 1.6
"""
__slots__ = ('_edited_timestamp', 'tts', 'content', 'channel', 'webhook_id',
@@ -355,8 +360,8 @@ class Message(Hashable):
'_cs_channel_mentions', '_cs_raw_mentions', 'attachments',
'_cs_clean_content', '_cs_raw_channel_mentions', 'nonce', 'pinned',
'role_mentions', '_cs_raw_role_mentions', 'type', 'call', 'flags',
- '_cs_system_content', '_cs_guild', '_state', 'reactions', 'reference',
- 'application', 'activity')
+ '_cs_system_content', '_cs_guild', '_state', 'reactions', 'reference',
+ 'application', 'activity', 'stickers')
def __init__(self, *, state, channel, data):
self._state = state
@@ -376,6 +381,7 @@ class Message(Hashable):
self.tts = data['tts']
self.content = data['content']
self.nonce = data.get('nonce')
+ self.stickers = [Sticker(data=data, state=state) for data in data.get('stickers', [])]
ref = data.get('message_reference')
self.reference = MessageReference(state, **ref) if ref is not None else None