Add Guild.create_forum and CategoryChannel.create_forum

This commit is contained in:
Alex Nørgaard
2022-06-09 05:56:31 +01:00
committed by GitHub
parent ae51d5849a
commit 6a58cabf5c
2 changed files with 114 additions and 0 deletions

View File

@ -1943,6 +1943,20 @@ class CategoryChannel(discord.abc.GuildChannel, Hashable):
"""
return await self.guild.create_stage_channel(name, category=self, **options)
async def create_forum(self, name: str, **options: Any) -> ForumChannel:
"""|coro|
A shortcut method to :meth:`Guild.create_forum` to create a :class:`ForumChannel` in the category.
.. versionadded:: 2.0
Returns
--------
:class:`ForumChannel`
The channel that was just created.
"""
return await self.guild.create_forum(name, category=self, **options)
class ForumChannel(discord.abc.GuildChannel, Hashable):
"""Represents a Discord guild forum channel.