@@ -1519,20 +1519,37 @@ class VoiceChannel(discord.abc.Messageable, VocalGuildChannel):
1519
1519
Bots and users with :attr:`~Permissions.manage_channels` or
1520
1520
:attr:`~Permissions.manage_messages` bypass slowmode.
1521
1521
1522
+ .. versionadded:: 2.5
1523
+ status: Optional[:class:`str`]
1524
+ The channel's status, if set.
1525
+
1522
1526
.. versionadded:: 2.5
1523
1527
flags: :class:`ChannelFlags`
1524
1528
Extra features of the channel.
1525
1529
1526
1530
.. versionadded:: 2.0
1527
1531
"""
1528
1532
1533
+ def __init__ (
1534
+ self ,
1535
+ * ,
1536
+ state : ConnectionState ,
1537
+ guild : Guild ,
1538
+ data : VoiceChannelPayload ,
1539
+ ):
1540
+ self .status : str | None = None
1541
+ super ().__init__ (state = state , guild = guild , data = data )
1542
+
1529
1543
def _update (self , guild : Guild , data : VoiceChannelPayload ):
1530
1544
super ()._update (guild , data )
1545
+ if data .get ("status" ):
1546
+ self .status = data .get ("status" )
1531
1547
1532
1548
def __repr__ (self ) -> str :
1533
1549
attrs = [
1534
1550
("id" , self .id ),
1535
1551
("name" , self .name ),
1552
+ ("status" , self .status ),
1536
1553
("rtc_region" , self .rtc_region ),
1537
1554
("position" , self .position ),
1538
1555
("bitrate" , self .bitrate ),
@@ -1955,6 +1972,31 @@ async def create_activity_invite(
1955
1972
** kwargs ,
1956
1973
)
1957
1974
1975
+ async def set_status (
1976
+ self , status : str | None , * , reason : str | None = None
1977
+ ) -> None :
1978
+ """|coro|
1979
+
1980
+ Sets the status of the voice channel.
1981
+
1982
+ You must have the :attr:`~Permissions.set_voice_channel_status` permission to use this.
1983
+
1984
+ Parameters
1985
+ ----------
1986
+ status: Union[:class:`str`, None]
1987
+ The new status.
1988
+ reason: Optional[:class:`str`]
1989
+ The reason for setting the status. Shows up on the audit log.
1990
+
1991
+ Raises
1992
+ ------
1993
+ Forbidden
1994
+ You do not have proper permissions to set the status.
1995
+ HTTPException
1996
+ Setting the status failed.
1997
+ """
1998
+ await self ._state .http .set_voice_channel_status (self .id , status , reason = reason )
1999
+
1958
2000
1959
2001
class StageChannel (discord .abc .Messageable , VocalGuildChannel ):
1960
2002
"""Represents a Discord guild stage channel.
0 commit comments