@@ -532,14 +532,16 @@ async def clone(
532532 category : Optional [CategoryChannel ] = None ,
533533 reason : Optional [str ] = None ,
534534 ) -> TextChannel :
535+ base : Dict [Any , Any ] = {
536+ 'topic' : self .topic ,
537+ 'nsfw' : self .nsfw ,
538+ 'default_auto_archive_duration' : self .default_auto_archive_duration ,
539+ 'default_thread_rate_limit_per_user' : self .default_thread_slowmode_delay ,
540+ }
541+ if not self .is_news ():
542+ base ['rate_limit_per_user' ] = self .slowmode_delay
535543 return await self ._clone_impl (
536- {
537- 'topic' : self .topic ,
538- 'rate_limit_per_user' : self .slowmode_delay ,
539- 'nsfw' : self .nsfw ,
540- 'default_auto_archive_duration' : self .default_auto_archive_duration ,
541- 'default_thread_rate_limit_per_user' : self .default_thread_slowmode_delay ,
542- },
544+ base ,
543545 name = name ,
544546 category = category ,
545547 reason = reason ,
@@ -1395,7 +1397,9 @@ async def create_webhook(self, *, name: str, avatar: Optional[bytes] = None, rea
13951397 return Webhook .from_state (data , state = self ._state )
13961398
13971399 @utils .copy_doc (discord .abc .GuildChannel .clone )
1398- async def clone (self , * , name : Optional [str ] = None , reason : Optional [str ] = None ) -> Self :
1400+ async def clone (
1401+ self , * , name : Optional [str ] = None , category : Optional [CategoryChannel ] = None , reason : Optional [str ] = None
1402+ ) -> Self :
13991403 base = {
14001404 'bitrate' : self .bitrate ,
14011405 'user_limit' : self .user_limit ,
@@ -1409,6 +1413,7 @@ async def clone(self, *, name: Optional[str] = None, reason: Optional[str] = Non
14091413 return await self ._clone_impl (
14101414 base ,
14111415 name = name ,
1416+ category = category ,
14121417 reason = reason ,
14131418 )
14141419
@@ -1506,18 +1511,6 @@ def type(self) -> Literal[ChannelType.voice]:
15061511 """:class:`ChannelType`: The channel's Discord type."""
15071512 return ChannelType .voice
15081513
1509- @utils .copy_doc (discord .abc .GuildChannel .clone )
1510- async def clone (
1511- self ,
1512- * ,
1513- name : Optional [str ] = None ,
1514- category : Optional [CategoryChannel ] = None ,
1515- reason : Optional [str ] = None ,
1516- ) -> VoiceChannel :
1517- return await self ._clone_impl (
1518- {'bitrate' : self .bitrate , 'user_limit' : self .user_limit }, name = name , category = category , reason = reason
1519- )
1520-
15211514 @overload
15221515 async def edit (self ) -> None :
15231516 ...
@@ -1788,16 +1781,6 @@ def type(self) -> Literal[ChannelType.stage_voice]:
17881781 """:class:`ChannelType`: The channel's Discord type."""
17891782 return ChannelType .stage_voice
17901783
1791- @utils .copy_doc (discord .abc .GuildChannel .clone )
1792- async def clone (
1793- self ,
1794- * ,
1795- name : Optional [str ] = None ,
1796- category : Optional [CategoryChannel ] = None ,
1797- reason : Optional [str ] = None ,
1798- ) -> StageChannel :
1799- return await self ._clone_impl ({}, name = name , category = category , reason = reason )
1800-
18011784 @property
18021785 def instance (self ) -> Optional [StageInstance ]:
18031786 """Optional[:class:`StageInstance`]: The running stage instance of the stage channel.
0 commit comments