aboutsummaryrefslogtreecommitdiff
path: root/discord/embeds.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-03-13 05:59:42 -0400
committerRapptz <[email protected]>2019-03-13 06:02:56 -0400
commit73aca4d4d36e728e906fb6c6bccaaf7060c1b83d (patch)
tree6dc5feee749a1b92d97b06ef6c9bb6ced26618a1 /discord/embeds.py
parentHandle type updates in TextChannel._update for news channels. (diff)
downloaddiscord.py-73aca4d4d36e728e906fb6c6bccaaf7060c1b83d.tar.xz
discord.py-73aca4d4d36e728e906fb6c6bccaaf7060c1b83d.zip
Expose Embed.from_data as Embed.from_dict
This is a breaking change.
Diffstat (limited to 'discord/embeds.py')
-rw-r--r--discord/embeds.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/discord/embeds.py b/discord/embeds.py
index ddc11b28..1b0c70d0 100644
--- a/discord/embeds.py
+++ b/discord/embeds.py
@@ -112,7 +112,21 @@ class Embed:
self.timestamp = timestamp
@classmethod
- def from_data(cls, data):
+ def from_dict(cls, data):
+ """Converts a :class:`dict` to a :class:`Embed` provided it is in the
+ format that Discord expects it to be in.
+
+ You can find out about this format in the `official Discord documentation`__.
+
+ .. _DiscordDocs: https://discordapp.com/developers/docs/resources/channel#embed-object
+
+ __ DiscordDocs_
+
+ Parameters
+ -----------
+ data: :class:`dict`
+ The dictionary to convert into an embed.
+ """
# we are bypassing __init__ here since it doesn't apply here
self = cls.__new__(cls)