Add Guild.create_category.

An alias, Guild.create_category_channel is provided.
This commit is contained in:
Rapptz 2017-09-13 17:01:42 -04:00
parent 233c2d80ef
commit 7df8897e3d

View File

@ -612,12 +612,22 @@ class Guild(Hashable):
def create_voice_channel(self, name, *, overwrites=None, reason=None):
"""|coro|
Same as :meth:`create_text_channel` except makes a
:class:`VoiceChannel` instead.
Same as :meth:`create_text_channel` except makes a :class:`VoiceChannel` instead.
"""
data = yield from self._create_channel(name, overwrites, ChannelType.voice, reason=reason)
return VoiceChannel(state=self._state, guild=self, data=data)
@asyncio.coroutine
def create_category(self, name, *, overwrites=None, reason=None):
"""|coro|
Same as :meth:`create_text_channel` except makes a :class:`CategoryChannel` instead.
"""
data = yield from self._create_channel(name, overwrites, ChannelType.category, reason=reason)
return CategoryChannel(state=self._state, guild=self, data=data)
create_category_channel = create_category
@asyncio.coroutine
def leave(self):
"""|coro|