From d78fed6641fc1f2c084d93c01f3f742bbce017a3 Mon Sep 17 00:00:00 2001 From: Andrei Date: Wed, 11 Jan 2017 20:44:56 -0600 Subject: [PATCH] bugfix - fix editing a message with embeds --- disco/api/client.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/disco/api/client.py b/disco/api/client.py index 9f5b043..d6c905b 100644 --- a/disco/api/client.py +++ b/disco/api/client.py @@ -108,9 +108,16 @@ class APIClient(LoggingClass): return Message.create(self.client, r.json()) def channels_messages_modify(self, channel, message, content, embed=None): + payload = { + 'content': content, + } + + if embed: + payload['embed'] = embed.to_dict() + r = self.http(Routes.CHANNELS_MESSAGES_MODIFY, dict(channel=channel, message=message), - json={'content': content, 'embed': embed.to_dict()}) + json=payload) return Message.create(self.client, r.json()) def channels_messages_delete(self, channel, message):