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
This commit is contained in:
Rapptz
2017-09-13 09:38:05 -04:00
parent e24914be0b
commit 53b4890435
8 changed files with 249 additions and 32 deletions

View File

@ -31,10 +31,11 @@ __all__ = ['ChannelType', 'MessageType', 'VoiceRegion', 'VerificationLevel',
'AuditLogAction', 'AuditLogActionCategory', 'UserFlags', ]
class ChannelType(Enum):
text = 0
private = 1
voice = 2
group = 3
text = 0
private = 1
voice = 2
group = 3
category = 4
def __str__(self):
return self.name