aboutsummaryrefslogtreecommitdiff
path: root/discord/http.py
diff options
context:
space:
mode:
authorPikalaxALT <[email protected]>2020-11-26 23:19:00 -0500
committerGitHub <[email protected]>2020-11-26 23:19:00 -0500
commitd1cb30cccf39648e21c0f7c73cb087fc730b8e25 (patch)
tree4c8d111160fca9663739aab47bc93493c673902d /discord/http.py
parentFix `discord.RoleTags` resolution (diff)
downloaddiscord.py-d1cb30cccf39648e21c0f7c73cb087fc730b8e25.tar.xz
discord.py-d1cb30cccf39648e21c0f7c73cb087fc730b8e25.zip
Implement discord.Message.reply
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 9459a9c5..887632f9 100644
--- a/discord/http.py
+++ b/discord/http.py
@@ -342,7 +342,7 @@ class HTTPClient:
return self.request(Route('POST', '/users/@me/channels'), json=payload)
- def send_message(self, channel_id, content, *, tts=False, embed=None, nonce=None, allowed_mentions=None):
+ def send_message(self, channel_id, content, *, tts=False, embed=None, nonce=None, allowed_mentions=None, message_reference=None):
r = Route('POST', '/channels/{channel_id}/messages', channel_id=channel_id)
payload = {}
@@ -361,12 +361,15 @@ class HTTPClient:
if allowed_mentions:
payload['allowed_mentions'] = allowed_mentions
+ if message_reference:
+ payload['message_reference'] = message_reference
+
return self.request(r, json=payload)
def send_typing(self, channel_id):
return self.request(Route('POST', '/channels/{channel_id}/typing', channel_id=channel_id))
- def send_files(self, channel_id, *, files, content=None, tts=False, embed=None, nonce=None, allowed_mentions=None):
+ def send_files(self, channel_id, *, files, content=None, tts=False, embed=None, nonce=None, allowed_mentions=None, message_reference=None):
r = Route('POST', '/channels/{channel_id}/messages', channel_id=channel_id)
form = aiohttp.FormData()
@@ -379,6 +382,8 @@ class HTTPClient:
payload['nonce'] = nonce
if allowed_mentions:
payload['allowed_mentions'] = allowed_mentions
+ if message_reference:
+ payload['message_reference'] = message_reference
form.add_field('payload_json', utils.to_json(payload))
if len(files) == 1: