diff options
| author | Rapptz <[email protected]> | 2017-09-13 09:38:05 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2017-09-13 09:44:36 -0400 |
| commit | 53b48904358866e62c6afec1a548424f12c7e1d1 (patch) | |
| tree | 77d14c0e8e0bf62311f731e29bec9487cab684d3 /discord/http.py | |
| parent | [commands] Fix NameError when given an invalid prefix. (diff) | |
| download | discord.py-53b48904358866e62c6afec1a548424f12c7e1d1.tar.xz discord.py-53b48904358866e62c6afec1a548424f12c7e1d1.zip | |
Add category support.
This adds:
* CategoryChannel, which represents a category
* Guild.by_category() which traverses the channels grouping by category
* Guild.categories to get a list of categories
* abc.GuildChannel.category to get the category a channel belongs to
* sync_permissions keyword argument to abc.GuildChannel.edit to sync
permissions with a pre-existing or new category
* category keyword argument to abc.GuildChannel.edit to move a channel
to a category
Diffstat (limited to 'discord/http.py')
| -rw-r--r-- | discord/http.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/discord/http.py b/discord/http.py index aca91bb6..458e68d3 100644 --- a/discord/http.py +++ b/discord/http.py @@ -500,16 +500,16 @@ class HTTPClient: def edit_channel(self, channel_id, *, reason=None, **options): r = Route('PATCH', '/channels/{channel_id}', channel_id=channel_id) - valid_keys = ('name', 'topic', 'bitrate', 'nsfw', 'user_limit', 'position') + valid_keys = ('name', 'topic', 'bitrate', 'nsfw', 'user_limit', 'position', 'permission_overwrites') payload = { k: v for k, v in options.items() if k in valid_keys } return self.request(r, reason=reason, json=payload) - def move_channel_position(self, guild_id, positions, *, reason=None): + def bulk_channel_update(self, guild_id, data, *, reason=None): r = Route('PATCH', '/guilds/{guild_id}/channels', guild_id=guild_id) - return self.request(r, json=positions, reason=reason) + return self.request(r, json=data, reason=reason) def create_channel(self, guild_id, name, channe_type, permission_overwrites=None, *, reason=None): payload = { |