Add support for Discord's slow mode.

Adds the following:

* `slowmode_delay` for `TextChannel.edit`
* `slowmode_delay` attribute for `TextChannel`
This commit is contained in:
Rapptz
2018-09-14 22:52:39 -04:00
parent 21309c2d72
commit 0352c80a17
3 changed files with 24 additions and 8 deletions

View File

@ -495,7 +495,8 @@ class HTTPClient:
def edit_channel(self, channel_id, *, reason=None, **options):
r = Route('PATCH', '/channels/{channel_id}', channel_id=channel_id)
valid_keys = ('name', 'parent_id', 'topic', 'bitrate', 'nsfw', 'user_limit', 'position', 'permission_overwrites')
valid_keys = ('name', 'parent_id', 'topic', 'bitrate', 'nsfw',
'user_limit', 'position', 'permission_overwrites', 'rate_limit_per_user')
payload = {
k: v for k, v in options.items() if k in valid_keys
}