aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-11-13 21:40:29 -0500
committerRapptz <[email protected]>2017-01-03 09:51:58 -0500
commit42891c3084f35331be7d10376d2367c4c152cb27 (patch)
treeca9c0697efab8deba13f4c7be440e13a2a57306a
parentRe-add support for reactions. (diff)
downloaddiscord.py-42891c3084f35331be7d10376d2367c4c152cb27.tar.xz
discord.py-42891c3084f35331be7d10376d2367c4c152cb27.zip
Make Message.embeds to be based on discord.Embed
-rw-r--r--discord/message.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/discord/message.py b/discord/message.py
index 9a149e1d..fc462e5c 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -35,6 +35,7 @@ from .object import Object
from .calls import CallMessage
from .enums import MessageType, try_enum
from .errors import InvalidArgument
+from .embeds import Embed
class Message:
"""Represents a message from Discord.
@@ -58,10 +59,8 @@ class Message:
nonce
The value used by the discord guild and the client to verify that the message is successfully sent.
This is typically non-important.
- embeds: list
- A list of embedded objects. The elements are objects that meet oEmbed's specification_.
-
- .. _specification: http://oembed.com/
+ embeds: List[:class:`Embed`]
+ A list embeds the message has.
channel
The :class:`Channel` that the message was sent from.
Could be a :class:`PrivateChannel` if it's a private message.
@@ -181,7 +180,7 @@ class Message:
self._try_patch(data, 'tts', bool)
self._try_patch(data, 'content', str)
self._try_patch(data, 'attachments', lambda x: x)
- self._try_patch(data, 'embeds', lambda x: x)
+ self._try_patch(data, 'embeds', lambda x: list(map(Embed.from_data, x)))
self._try_patch(data, 'nonce', lambda x: x)
# clear the cached properties