aboutsummaryrefslogtreecommitdiff
path: root/discord/http.py
diff options
context:
space:
mode:
Diffstat (limited to 'discord/http.py')
-rw-r--r--discord/http.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/discord/http.py b/discord/http.py
index d2cf2e4e..6379ade1 100644
--- a/discord/http.py
+++ b/discord/http.py
@@ -213,16 +213,21 @@ class HTTPClient:
return self.post(self.ME + '/channels', json=payload, bucket=_func_())
- def send_message(self, channel_id, content, *, guild_id=None, tts=False):
+ def send_message(self, channel_id, content, *, guild_id=None, tts=False, embed=None):
url = '{0.CHANNELS}/{1}/messages'.format(self, channel_id)
payload = {
- 'content': str(content),
'nonce': random_integer(-2**63, 2**63 - 1)
}
+ if content:
+ payload['content'] = content
+
if tts:
payload['tts'] = True
+ if embed:
+ payload['embed'] = embed
+
return self.post(url, json=payload, bucket='messages:' + str(guild_id))
def send_typing(self, channel_id):