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 committed 2017-09-13 09:44:36 -04:00
1 parent e24914be0b
commit 53b4890435
8 files changed
+249 -32

No files matched your search

+5 -4
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