@@ -232,7 +232,7 @@ def __init__(
232
232
233
233
@property
234
234
def _repr_attrs (self ) -> tuple [str , ...]:
235
- return "id" , "name" , "position" , "nsfw" , " category_id"
235
+ return "id" , "name" , "position" , "category_id"
236
236
237
237
def __repr__ (self ) -> str :
238
238
attrs = [(val , getattr (self , val )) for val in self ._repr_attrs ]
@@ -828,7 +828,7 @@ async def edit(self, *, reason=None, **options):
828
828
position: :class:`int`
829
829
The new channel's position.
830
830
nsfw: :class:`bool`
831
- To mark the channel as NSFW or not .
831
+ Whether the channel is marked as NSFW .
832
832
sync_permissions: :class:`bool`
833
833
Whether to sync permissions with the channel's new or pre-existing
834
834
category. Defaults to ``False``.
@@ -1055,6 +1055,8 @@ def _update(self, guild: Guild, data: ForumChannelPayload) -> None:
1055
1055
if self .default_sort_order is not None :
1056
1056
self .default_sort_order = try_enum (SortOrder , self .default_sort_order )
1057
1057
1058
+ self .default_reaction_emoji = None
1059
+
1058
1060
reaction_emoji_ctx : dict = data .get ("default_reaction_emoji" )
1059
1061
if reaction_emoji_ctx is not None :
1060
1062
emoji_name = reaction_emoji_ctx .get ("emoji_name" )
@@ -1131,7 +1133,7 @@ async def edit(self, *, reason=None, **options):
1131
1133
position: :class:`int`
1132
1134
The new channel's position.
1133
1135
nsfw: :class:`bool`
1134
- To mark the channel as NSFW or not .
1136
+ Whether the channel is marked as NSFW .
1135
1137
sync_permissions: :class:`bool`
1136
1138
Whether to sync permissions with the channel's new or pre-existing
1137
1139
category. Defaults to ``False``.
@@ -1509,7 +1511,7 @@ async def edit(self, *, reason=None, **options):
1509
1511
position: :class:`int`
1510
1512
The new channel's position.
1511
1513
nsfw: :class:`bool`
1512
- To mark the channel as NSFW or not .
1514
+ Whether the channel is marked as NSFW .
1513
1515
sync_permissions: :class:`bool`
1514
1516
Whether to sync permissions with the channel's new or pre-existing
1515
1517
category. Defaults to ``False``.
@@ -1757,6 +1759,11 @@ class VoiceChannel(discord.abc.Messageable, VocalGuildChannel):
1757
1759
Extra features of the channel.
1758
1760
1759
1761
.. versionadded:: 2.0
1762
+
1763
+ nsfw: :class:`bool`
1764
+ Whether the channel is marked as NSFW.
1765
+
1766
+ .. versionadded:: 2.7
1760
1767
"""
1761
1768
1762
1769
def __init__ (
@@ -2075,6 +2082,7 @@ async def edit(
2075
2082
rtc_region : VoiceRegion | None = ...,
2076
2083
video_quality_mode : VideoQualityMode = ...,
2077
2084
slowmode_delay : int = ...,
2085
+ nsfw : bool = ...,
2078
2086
reason : str | None = ...,
2079
2087
) -> VoiceChannel | None : ...
2080
2088
@@ -2125,6 +2133,15 @@ async def edit(self, *, reason=None, **options):
2125
2133
2126
2134
.. versionadded:: 2.0
2127
2135
2136
+ slowmode_delay: :class:`int`
2137
+ Specifies the slowmode rate limit for user in this channel, in seconds.
2138
+ A value of `0` disables slowmode. The maximum value possible is `21600`.
2139
+
2140
+ nsfw: :class:`bool`
2141
+ Whether the channel is marked as NSFW.
2142
+
2143
+ .. versionadded:: 2.7
2144
+
2128
2145
Returns
2129
2146
-------
2130
2147
Optional[:class:`.VoiceChannel`]
@@ -2283,6 +2300,15 @@ class StageChannel(discord.abc.Messageable, VocalGuildChannel):
2283
2300
last_message_id: Optional[:class:`int`]
2284
2301
The ID of the last message sent to this channel. It may not always point to an existing or valid message.
2285
2302
.. versionadded:: 2.5
2303
+
2304
+ slowmode_delay: :class:`int`
2305
+ Specifies the slowmode rate limit for user in this channel, in seconds.
2306
+ The maximum value possible is `21600`.
2307
+
2308
+ nsfw: :class:`bool`
2309
+ Whether the channel is marked as NSFW.
2310
+
2311
+ .. versionadded:: 2.7
2286
2312
"""
2287
2313
2288
2314
__slots__ = ("topic" ,)
@@ -2767,6 +2793,16 @@ async def edit(self, *, reason=None, **options):
2767
2793
2768
2794
.. versionadded:: 2.0
2769
2795
2796
+ bitrate: :class:`int`
2797
+ The channel's preferred audio bitrate in bits per second.
2798
+
2799
+ user_limit: :class:`int`
2800
+ The channel's limit for number of members that can be in a voice channel.
2801
+
2802
+ slowmode_delay: :class:`int`
2803
+ Specifies the slowmode rate limit for user in this channel, in seconds.
2804
+ A value of `0` disables slowmode. The maximum value possible is `21600`.
2805
+
2770
2806
Returns
2771
2807
-------
2772
2808
Optional[:class:`.StageChannel`]
@@ -2823,12 +2859,9 @@ class CategoryChannel(discord.abc.GuildChannel, Hashable):
2823
2859
position: Optional[:class:`int`]
2824
2860
The position in the category list. This is a number that starts at 0. e.g. the
2825
2861
top category is position 0. Can be ``None`` if the channel was received in an interaction.
2826
- nsfw: :class:`bool`
2827
- If the channel is marked as "not safe for work".
2828
2862
2829
2863
.. note::
2830
2864
2831
- To check if the channel or the guild of that channel are marked as NSFW, consider :meth:`is_nsfw` instead.
2832
2865
flags: :class:`ChannelFlags`
2833
2866
Extra features of the channel.
2834
2867
@@ -2839,7 +2872,6 @@ class CategoryChannel(discord.abc.GuildChannel, Hashable):
2839
2872
"name" ,
2840
2873
"id" ,
2841
2874
"guild" ,
2842
- "nsfw" ,
2843
2875
"_state" ,
2844
2876
"position" ,
2845
2877
"_overwrites" ,
@@ -2856,8 +2888,7 @@ def __init__(
2856
2888
2857
2889
def __repr__ (self ) -> str :
2858
2890
return (
2859
- "<CategoryChannel"
2860
- f" id={ self .id } name={ self .name !r} position={ self .position } nsfw={ self .nsfw } >"
2891
+ f"<CategoryChannel id={ self .id } name={ self .name !r} position={ self .position } "
2861
2892
)
2862
2893
2863
2894
def _update (self , guild : Guild , data : CategoryChannelPayload ) -> None :
@@ -2868,7 +2899,6 @@ def _update(self, guild: Guild, data: CategoryChannelPayload) -> None:
2868
2899
2869
2900
# This data may be missing depending on how this object is being created/updated
2870
2901
if not data .pop ("_invoke_flag" , False ):
2871
- self .nsfw : bool = data .get ("nsfw" , False )
2872
2902
self .position : int = data .get ("position" )
2873
2903
self .flags : ChannelFlags = ChannelFlags ._from_value (data .get ("flags" , 0 ))
2874
2904
self ._fill_overwrites (data )
@@ -2882,23 +2912,18 @@ def type(self) -> ChannelType:
2882
2912
"""The channel's Discord type."""
2883
2913
return ChannelType .category
2884
2914
2885
- def is_nsfw (self ) -> bool :
2886
- """Checks if the category is NSFW."""
2887
- return self .nsfw
2888
-
2889
2915
@utils .copy_doc (discord .abc .GuildChannel .clone )
2890
2916
async def clone (
2891
2917
self , * , name : str | None = None , reason : str | None = None
2892
2918
) -> CategoryChannel :
2893
- return await self ._clone_impl ({"nsfw" : self . nsfw }, name = name , reason = reason )
2919
+ return await self ._clone_impl ({}, name = name , reason = reason )
2894
2920
2895
2921
@overload
2896
2922
async def edit (
2897
2923
self ,
2898
2924
* ,
2899
2925
name : str = ...,
2900
2926
position : int = ...,
2901
- nsfw : bool = ...,
2902
2927
overwrites : Mapping [Role | Member , PermissionOverwrite ] = ...,
2903
2928
reason : str | None = ...,
2904
2929
) -> CategoryChannel | None : ...
@@ -2926,8 +2951,6 @@ async def edit(self, *, reason=None, **options):
2926
2951
The new category's name.
2927
2952
position: :class:`int`
2928
2953
The new category's position.
2929
- nsfw: :class:`bool`
2930
- To mark the category as NSFW or not.
2931
2954
reason: Optional[:class:`str`]
2932
2955
The reason for editing this category. Shows up on the audit log.
2933
2956
overwrites: Dict[Union[:class:`Role`, :class:`Member`, :class:`~discord.abc.Snowflake`], :class:`PermissionOverwrite`]
@@ -3075,6 +3098,25 @@ async def create_forum_channel(self, name: str, **options: Any) -> ForumChannel:
3075
3098
"""
3076
3099
return await self .guild .create_forum_channel (name , category = self , ** options )
3077
3100
3101
+ @utils .deprecated (
3102
+ since = "2.7" ,
3103
+ removed = "3.0" ,
3104
+ reference = "NSFW categories are not available in the Discord API." ,
3105
+ )
3106
+ def is_nsfw (self ) -> bool :
3107
+ return False
3108
+
3109
+ # TODO: Remove in 3.0
3110
+
3111
+ @property
3112
+ @utils .deprecated (
3113
+ since = "2.7" ,
3114
+ removed = "3.0" ,
3115
+ reference = "NSFW categories are not available in the Discord API." ,
3116
+ )
3117
+ def nsfw (self ) -> bool :
3118
+ return False
3119
+
3078
3120
3079
3121
DMC = TypeVar ("DMC" , bound = "DMChannel" )
3080
3122
0 commit comments