|
|
@ -525,7 +525,13 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): |
|
|
|
return self.__class__(state=self._state, guild=self.guild, data=payload) # type: ignore |
|
|
|
|
|
|
|
@utils.copy_doc(discord.abc.GuildChannel.clone) |
|
|
|
async def clone(self, *, name: Optional[str] = None, reason: Optional[str] = None) -> TextChannel: |
|
|
|
async def clone( |
|
|
|
self, |
|
|
|
*, |
|
|
|
name: Optional[str] = None, |
|
|
|
category: Optional[CategoryChannel] = None, |
|
|
|
reason: Optional[str] = None, |
|
|
|
) -> TextChannel: |
|
|
|
return await self._clone_impl( |
|
|
|
{ |
|
|
|
'topic': self.topic, |
|
|
@ -535,6 +541,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): |
|
|
|
'default_thread_rate_limit_per_user': self.default_thread_slowmode_delay, |
|
|
|
}, |
|
|
|
name=name, |
|
|
|
category=category, |
|
|
|
reason=reason, |
|
|
|
) |
|
|
|
|
|
|
@ -1499,6 +1506,18 @@ class VoiceChannel(VocalGuildChannel): |
|
|
|
""":class:`ChannelType`: The channel's Discord type.""" |
|
|
|
return ChannelType.voice |
|
|
|
|
|
|
|
@utils.copy_doc(discord.abc.GuildChannel.clone) |
|
|
|
async def clone( |
|
|
|
self, |
|
|
|
*, |
|
|
|
name: Optional[str] = None, |
|
|
|
category: Optional[CategoryChannel] = None, |
|
|
|
reason: Optional[str] = None, |
|
|
|
) -> VoiceChannel: |
|
|
|
return await self._clone_impl( |
|
|
|
{'bitrate': self.bitrate, 'user_limit': self.user_limit}, name=name, category=category, reason=reason |
|
|
|
) |
|
|
|
|
|
|
|
@overload |
|
|
|
async def edit(self) -> None: |
|
|
|
... |
|
|
@ -1769,6 +1788,16 @@ class StageChannel(VocalGuildChannel): |
|
|
|
""":class:`ChannelType`: The channel's Discord type.""" |
|
|
|
return ChannelType.stage_voice |
|
|
|
|
|
|
|
@utils.copy_doc(discord.abc.GuildChannel.clone) |
|
|
|
async def clone( |
|
|
|
self, |
|
|
|
*, |
|
|
|
name: Optional[str] = None, |
|
|
|
category: Optional[CategoryChannel] = None, |
|
|
|
reason: Optional[str] = None, |
|
|
|
) -> StageChannel: |
|
|
|
return await self._clone_impl({}, name=name, category=category, reason=reason) |
|
|
|
|
|
|
|
@property |
|
|
|
def instance(self) -> Optional[StageInstance]: |
|
|
|
"""Optional[:class:`StageInstance`]: The running stage instance of the stage channel. |
|
|
@ -2046,7 +2075,13 @@ class CategoryChannel(discord.abc.GuildChannel, Hashable): |
|
|
|
return self.nsfw |
|
|
|
|
|
|
|
@utils.copy_doc(discord.abc.GuildChannel.clone) |
|
|
|
async def clone(self, *, name: Optional[str] = None, reason: Optional[str] = None) -> CategoryChannel: |
|
|
|
async def clone( |
|
|
|
self, |
|
|
|
*, |
|
|
|
name: Optional[str] = None, |
|
|
|
category: Optional[CategoryChannel] = None, |
|
|
|
reason: Optional[str] = None, |
|
|
|
) -> CategoryChannel: |
|
|
|
return await self._clone_impl({'nsfw': self.nsfw}, name=name, reason=reason) |
|
|
|
|
|
|
|
@overload |
|
|
@ -2563,7 +2598,13 @@ class ForumChannel(discord.abc.GuildChannel, Hashable): |
|
|
|
return self._type == ChannelType.media.value |
|
|
|
|
|
|
|
@utils.copy_doc(discord.abc.GuildChannel.clone) |
|
|
|
async def clone(self, *, name: Optional[str] = None, reason: Optional[str] = None) -> ForumChannel: |
|
|
|
async def clone( |
|
|
|
self, |
|
|
|
*, |
|
|
|
name: Optional[str] = None, |
|
|
|
category: Optional[CategoryChannel], |
|
|
|
reason: Optional[str] = None, |
|
|
|
) -> ForumChannel: |
|
|
|
base = { |
|
|
|
'topic': self.topic, |
|
|
|
'rate_limit_per_user': self.slowmode_delay, |
|
|
@ -2582,6 +2623,7 @@ class ForumChannel(discord.abc.GuildChannel, Hashable): |
|
|
|
return await self._clone_impl( |
|
|
|
base, |
|
|
|
name=name, |
|
|
|
category=category, |
|
|
|
reason=reason, |
|
|
|
) |
|
|
|
|
|
|
|