diff options
| author | Rapptz <[email protected]> | 2019-04-18 22:20:02 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-04-18 22:31:55 -0400 |
| commit | eb4de55f6d99f4f9d03f998dbabf6a04b91f2fc2 (patch) | |
| tree | 9598f493f6858ff593e9459a6532019b18b9eab7 /discord/http.py | |
| parent | Add abc.GuildChannel.clone to clone a channel with another name. (diff) | |
| download | discord.py-eb4de55f6d99f4f9d03f998dbabf6a04b91f2fc2.tar.xz discord.py-eb4de55f6d99f4f9d03f998dbabf6a04b91f2fc2.zip | |
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.
Diffstat (limited to 'discord/http.py')
| -rw-r--r-- | discord/http.py | 5 |
1 files changed, 3 insertions, 2 deletions
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)) |