|
|
@ -532,14 +532,16 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): |
|
|
|
category: Optional[CategoryChannel] = None, |
|
|
|
reason: Optional[str] = None, |
|
|
|
) -> TextChannel: |
|
|
|
base: Dict[Any, Any] = { |
|
|
|
'topic': self.topic, |
|
|
|
'nsfw': self.nsfw, |
|
|
|
'default_auto_archive_duration': self.default_auto_archive_duration, |
|
|
|
'default_thread_rate_limit_per_user': self.default_thread_slowmode_delay, |
|
|
|
} |
|
|
|
if not self.is_news(): |
|
|
|
base['rate_limit_per_user'] = self.slowmode_delay |
|
|
|
return await self._clone_impl( |
|
|
|
{ |
|
|
|
'topic': self.topic, |
|
|
|
'rate_limit_per_user': self.slowmode_delay, |
|
|
|
'nsfw': self.nsfw, |
|
|
|
'default_auto_archive_duration': self.default_auto_archive_duration, |
|
|
|
'default_thread_rate_limit_per_user': self.default_thread_slowmode_delay, |
|
|
|
}, |
|
|
|
base, |
|
|
|
name=name, |
|
|
|
category=category, |
|
|
|
reason=reason, |
|
|
@ -1395,7 +1397,9 @@ class VocalGuildChannel(discord.abc.Messageable, discord.abc.Connectable, discor |
|
|
|
return Webhook.from_state(data, state=self._state) |
|
|
|
|
|
|
|
@utils.copy_doc(discord.abc.GuildChannel.clone) |
|
|
|
async def clone(self, *, name: Optional[str] = None, reason: Optional[str] = None) -> Self: |
|
|
|
async def clone( |
|
|
|
self, *, name: Optional[str] = None, category: Optional[CategoryChannel] = None, reason: Optional[str] = None |
|
|
|
) -> Self: |
|
|
|
base = { |
|
|
|
'bitrate': self.bitrate, |
|
|
|
'user_limit': self.user_limit, |
|
|
@ -1409,6 +1413,7 @@ class VocalGuildChannel(discord.abc.Messageable, discord.abc.Connectable, discor |
|
|
|
return await self._clone_impl( |
|
|
|
base, |
|
|
|
name=name, |
|
|
|
category=category, |
|
|
|
reason=reason, |
|
|
|
) |
|
|
|
|
|
|
@ -1506,18 +1511,6 @@ 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: |
|
|
|
... |
|
|
@ -1788,16 +1781,6 @@ 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. |
|
|
|