diff options
| author | Rapptz <[email protected]> | 2016-11-13 22:12:16 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-11-13 22:12:16 -0500 |
| commit | a312f21bc32aaff154944f99075c83a1473c0bd4 (patch) | |
| tree | 27e2c046b8fedc36aaea71a58668013231f873c1 /discord/http.py | |
| parent | Add support for rich embeds. (diff) | |
| download | discord.py-a312f21bc32aaff154944f99075c83a1473c0bd4.tar.xz discord.py-a312f21bc32aaff154944f99075c83a1473c0bd4.zip | |
Support message editing with rich embeds.
Diffstat (limited to 'discord/http.py')
| -rw-r--r-- | discord/http.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/discord/http.py b/discord/http.py index 6379ade1..54c42ea1 100644 --- a/discord/http.py +++ b/discord/http.py @@ -259,11 +259,16 @@ class HTTPClient: bucket = '{}:{}'.format(_func_(), guild_id) return self.post(url, json=payload, bucket=bucket) - def edit_message(self, message_id, channel_id, content, *, guild_id=None): + def edit_message(self, message_id, channel_id, content, *, guild_id=None, embed=None): url = '{0.CHANNELS}/{1}/messages/{2}'.format(self, channel_id, message_id) - payload = { - 'content': str(content) - } + payload = {} + + if content: + payload['content'] = content + + if embed: + payload['embed'] = embed + return self.patch(url, json=payload, bucket='messages:' + str(guild_id)) def add_reaction(self, message_id, channel_id, emoji): |