From eb4de55f6d99f4f9d03f998dbabf6a04b91f2fc2 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 18 Apr 2019 22:20:02 -0400 Subject: Add reason to TextChannel.create_webhook The reason parameter does not work with webhook deletes or edits so they're not added. Probably a Discord bug. --- discord/http.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'discord/http.py') diff --git a/discord/http.py b/discord/http.py index 36de7dba..85062e2d 100644 --- a/discord/http.py +++ b/discord/http.py @@ -537,14 +537,15 @@ class HTTPClient: # Webhook management - def create_webhook(self, channel_id, *, name, avatar=None): + def create_webhook(self, channel_id, *, name, avatar=None, reason=None): payload = { 'name': name } if avatar is not None: payload['avatar'] = avatar - return self.request(Route('POST', '/channels/{channel_id}/webhooks', channel_id=channel_id), json=payload) + r = Route('POST', '/channels/{channel_id}/webhooks', channel_id=channel_id) + return self.request(r, json=payload, reason=reason) def channel_webhooks(self, channel_id): return self.request(Route('GET', '/channels/{channel_id}/webhooks', channel_id=channel_id)) -- cgit v1.2.3