@@ -225,7 +225,7 @@ def __init__(
225
225
226
226
@property
227
227
def _repr_attrs (self ) -> tuple [str , ...]:
228
- return "id" , "name" , "position" , "nsfw" , " category_id"
228
+ return "id" , "name" , "position" , "category_id"
229
229
230
230
def __repr__ (self ) -> str :
231
231
attrs = [(val , getattr (self , val )) for val in self ._repr_attrs ]
@@ -790,7 +790,7 @@ async def edit(self, *, reason=None, **options):
790
790
position: :class:`int`
791
791
The new channel's position.
792
792
nsfw: :class:`bool`
793
- To mark the channel as NSFW or not .
793
+ Whether the channel is marked as NSFW .
794
794
sync_permissions: :class:`bool`
795
795
Whether to sync permissions with the channel's new or pre-existing
796
796
category. Defaults to ``False``.
@@ -1012,6 +1012,8 @@ def _update(self, guild: Guild, data: ForumChannelPayload) -> None:
1012
1012
if self .default_sort_order is not None :
1013
1013
self .default_sort_order = try_enum (SortOrder , self .default_sort_order )
1014
1014
1015
+ self .default_reaction_emoji = None
1016
+
1015
1017
reaction_emoji_ctx : dict = data .get ("default_reaction_emoji" )
1016
1018
if reaction_emoji_ctx is not None :
1017
1019
emoji_name = reaction_emoji_ctx .get ("emoji_name" )
@@ -1086,7 +1088,7 @@ async def edit(self, *, reason=None, **options):
1086
1088
position: :class:`int`
1087
1089
The new channel's position.
1088
1090
nsfw: :class:`bool`
1089
- To mark the channel as NSFW or not .
1091
+ Whether the channel is marked as NSFW .
1090
1092
sync_permissions: :class:`bool`
1091
1093
Whether to sync permissions with the channel's new or pre-existing
1092
1094
category. Defaults to ``False``.
@@ -1451,7 +1453,7 @@ async def edit(self, *, reason=None, **options):
1451
1453
position: :class:`int`
1452
1454
The new channel's position.
1453
1455
nsfw: :class:`bool`
1454
- To mark the channel as NSFW or not .
1456
+ Whether the channel is marked as NSFW .
1455
1457
sync_permissions: :class:`bool`
1456
1458
Whether to sync permissions with the channel's new or pre-existing
1457
1459
category. Defaults to ``False``.
@@ -1691,6 +1693,11 @@ class VoiceChannel(discord.abc.Messageable, VocalGuildChannel):
1691
1693
Extra features of the channel.
1692
1694
1693
1695
.. versionadded:: 2.0
1696
+
1697
+ nsfw: :class:`bool`
1698
+ Whether the channel is marked as NSFW.
1699
+
1700
+ .. versionadded:: 2.7
1694
1701
"""
1695
1702
1696
1703
def __init__ (
@@ -1998,6 +2005,7 @@ async def edit(
1998
2005
rtc_region : VoiceRegion | None = ...,
1999
2006
video_quality_mode : VideoQualityMode = ...,
2000
2007
slowmode_delay : int = ...,
2008
+ nsfw : bool = ...,
2001
2009
reason : str | None = ...,
2002
2010
) -> VoiceChannel | None : ...
2003
2011
@@ -2048,6 +2056,15 @@ async def edit(self, *, reason=None, **options):
2048
2056
2049
2057
.. versionadded:: 2.0
2050
2058
2059
+ slowmode_delay: :class:`int`
2060
+ Specifies the slowmode rate limit for user in this channel, in seconds.
2061
+ A value of `0` disables slowmode. The maximum value possible is `21600`.
2062
+
2063
+ nsfw: :class:`bool`
2064
+ Whether the channel is marked as NSFW.
2065
+
2066
+ .. versionadded:: 2.7
2067
+
2051
2068
Returns
2052
2069
-------
2053
2070
Optional[:class:`.VoiceChannel`]
@@ -2202,6 +2219,15 @@ class StageChannel(discord.abc.Messageable, VocalGuildChannel):
2202
2219
last_message_id: Optional[:class:`int`]
2203
2220
The ID of the last message sent to this channel. It may not always point to an existing or valid message.
2204
2221
.. versionadded:: 2.5
2222
+
2223
+ slowmode_delay: :class:`int`
2224
+ Specifies the slowmode rate limit for user in this channel, in seconds.
2225
+ The maximum value possible is `21600`.
2226
+
2227
+ nsfw: :class:`bool`
2228
+ Whether the channel is marked as NSFW.
2229
+
2230
+ .. versionadded:: 2.7
2205
2231
"""
2206
2232
2207
2233
__slots__ = ("topic" ,)
@@ -2661,6 +2687,16 @@ async def edit(self, *, reason=None, **options):
2661
2687
2662
2688
.. versionadded:: 2.0
2663
2689
2690
+ bitrate: :class:`int`
2691
+ The channel's preferred audio bitrate in bits per second.
2692
+
2693
+ user_limit: :class:`int`
2694
+ The channel's limit for number of members that can be in a voice channel.
2695
+
2696
+ slowmode_delay: :class:`int`
2697
+ Specifies the slowmode rate limit for user in this channel, in seconds.
2698
+ A value of `0` disables slowmode. The maximum value possible is `21600`.
2699
+
2664
2700
Returns
2665
2701
-------
2666
2702
Optional[:class:`.StageChannel`]
@@ -2717,12 +2753,9 @@ class CategoryChannel(discord.abc.GuildChannel, Hashable):
2717
2753
position: Optional[:class:`int`]
2718
2754
The position in the category list. This is a number that starts at 0. e.g. the
2719
2755
top category is position 0. Can be ``None`` if the channel was received in an interaction.
2720
- nsfw: :class:`bool`
2721
- If the channel is marked as "not safe for work".
2722
2756
2723
2757
.. note::
2724
2758
2725
- To check if the channel or the guild of that channel are marked as NSFW, consider :meth:`is_nsfw` instead.
2726
2759
flags: :class:`ChannelFlags`
2727
2760
Extra features of the channel.
2728
2761
@@ -2733,7 +2766,6 @@ class CategoryChannel(discord.abc.GuildChannel, Hashable):
2733
2766
"name" ,
2734
2767
"id" ,
2735
2768
"guild" ,
2736
- "nsfw" ,
2737
2769
"_state" ,
2738
2770
"position" ,
2739
2771
"_overwrites" ,
@@ -2747,7 +2779,9 @@ def __init__(self, *, state: ConnectionState, guild: Guild, data: CategoryChanne
2747
2779
self ._update (guild , data )
2748
2780
2749
2781
def __repr__ (self ) -> str :
2750
- return f"<CategoryChannel id={ self .id } name={ self .name !r} position={ self .position } nsfw={ self .nsfw } >"
2782
+ return (
2783
+ f"<CategoryChannel id={ self .id } name={ self .name !r} position={ self .position } "
2784
+ )
2751
2785
2752
2786
def _update (self , guild : Guild , data : CategoryChannelPayload ) -> None :
2753
2787
# This data will always exist
@@ -2757,7 +2791,6 @@ def _update(self, guild: Guild, data: CategoryChannelPayload) -> None:
2757
2791
2758
2792
# This data may be missing depending on how this object is being created/updated
2759
2793
if not data .pop ("_invoke_flag" , False ):
2760
- self .nsfw : bool = data .get ("nsfw" , False )
2761
2794
self .position : int = data .get ("position" )
2762
2795
self .flags : ChannelFlags = ChannelFlags ._from_value (data .get ("flags" , 0 ))
2763
2796
self ._fill_overwrites (data )
@@ -2771,21 +2804,16 @@ def type(self) -> ChannelType:
2771
2804
"""The channel's Discord type."""
2772
2805
return ChannelType .category
2773
2806
2774
- def is_nsfw (self ) -> bool :
2775
- """Checks if the category is NSFW."""
2776
- return self .nsfw
2777
-
2778
2807
@copy_doc (discord .abc .GuildChannel .clone )
2779
2808
async def clone (self , * , name : str | None = None , reason : str | None = None ) -> CategoryChannel :
2780
- return await self ._clone_impl ({"nsfw" : self . nsfw }, name = name , reason = reason )
2809
+ return await self ._clone_impl ({}, name = name , reason = reason )
2781
2810
2782
2811
@overload
2783
2812
async def edit (
2784
2813
self ,
2785
2814
* ,
2786
2815
name : str = ...,
2787
2816
position : int = ...,
2788
- nsfw : bool = ...,
2789
2817
overwrites : Mapping [Role | Member , PermissionOverwrite ] = ...,
2790
2818
reason : str | None = ...,
2791
2819
) -> CategoryChannel | None : ...
@@ -2813,8 +2841,6 @@ async def edit(self, *, reason=None, **options):
2813
2841
The new category's name.
2814
2842
position: :class:`int`
2815
2843
The new category's position.
2816
- nsfw: :class:`bool`
2817
- To mark the category as NSFW or not.
2818
2844
reason: Optional[:class:`str`]
2819
2845
The reason for editing this category. Shows up on the audit log.
2820
2846
overwrites: Dict[Union[:class:`Role`, :class:`Member`, :class:`~discord.abc.Snowflake`], :class:`PermissionOverwrite`]
@@ -2946,6 +2972,25 @@ async def create_forum_channel(self, name: str, **options: Any) -> ForumChannel:
2946
2972
"""
2947
2973
return await self .guild .create_forum_channel (name , category = self , ** options )
2948
2974
2975
+ @utils .deprecated (
2976
+ since = "2.7" ,
2977
+ removed = "3.0" ,
2978
+ reference = "NSFW categories are not available in the Discord API." ,
2979
+ )
2980
+ def is_nsfw (self ) -> bool :
2981
+ return False
2982
+
2983
+ # TODO: Remove in 3.0
2984
+
2985
+ @property
2986
+ @utils .deprecated (
2987
+ since = "2.7" ,
2988
+ removed = "3.0" ,
2989
+ reference = "NSFW categories are not available in the Discord API." ,
2990
+ )
2991
+ def nsfw (self ) -> bool :
2992
+ return False
2993
+
2949
2994
2950
2995
DMC = TypeVar ("DMC" , bound = "DMChannel" )
2951
2996
0 commit comments