diff options
| author | Ilya Lukyanov <[email protected]> | 2020-03-30 18:51:34 +0100 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2020-04-04 03:15:47 -0400 |
| commit | d2cc8aa459571eb981bda88f91c736524872bb26 (patch) | |
| tree | a190fcf8a336b66d41732b730ddab50958b54a53 | |
| parent | Allow for optional custom error handler in tasks extension (diff) | |
| download | discord.py-d2cc8aa459571eb981bda88f91c736524872bb26.tar.xz discord.py-d2cc8aa459571eb981bda88f91c736524872bb26.zip | |
Add position argument to Guild.create_category
This way we can specify category position upon creation
| -rw-r--r-- | discord/guild.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/guild.py b/discord/guild.py index 9b5a0753..0e5a7b8f 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -892,7 +892,7 @@ class Guild(Hashable): self._channels[channel.id] = channel return channel - async def create_category(self, name, *, overwrites=None, reason=None): + async def create_category(self, name, *, overwrites=None, reason=None, position=None): """|coro| Same as :meth:`create_text_channel` except makes a :class:`CategoryChannel` instead. @@ -902,7 +902,7 @@ class Guild(Hashable): The ``category`` parameter is not supported in this function since categories cannot have categories. """ - data = await self._create_channel(name, overwrites, ChannelType.category, reason=reason) + data = await self._create_channel(name, overwrites, ChannelType.category, reason=reason, position=position) channel = CategoryChannel(state=self._state, guild=self, data=data) # temporarily add to the cache |