Skip to content

Commit 988c84f

Browse files
committed
feat: Added support for text-in-stage
1 parent 1c1852b commit 988c84f

File tree

3 files changed

+92
-5
lines changed

3 files changed

+92
-5
lines changed

discord/channel.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,7 +1501,7 @@ async def edit(self, *, reason=None, **options):
15011501
await self._edit(options, reason=reason)
15021502

15031503

1504-
class StageChannel(VocalGuildChannel):
1504+
class StageChannel(VocalGuildChannel, abc.Messageable):
15051505
"""Represents a Discord guild stage channel.
15061506
15071507
.. versionadded:: 1.7
@@ -1547,7 +1547,7 @@ class StageChannel(VocalGuildChannel):
15471547
The region for the stage channel's voice communication.
15481548
A value of ``None`` indicates automatic voice region detection.
15491549
"""
1550-
__slots__ = ('topic',)
1550+
__slots__ = ('topic', 'last_message_id')
15511551

15521552
def __repr__(self):
15531553
attrs = [
@@ -1561,15 +1561,18 @@ def __repr__(self):
15611561
('category_id', self.category_id)
15621562
]
15631563
return '<%s %s>' % (self.__class__.__name__, ' '.join('%s=%r' % t for t in attrs))
1564-
1564+
15651565
def _update(self, guild, data):
15661566
super()._update(guild, data)
15671567
self.topic = data.get('topic')
15681568

15691569
@staticmethod
15701570
def channel_type():
15711571
return ChannelType.stage_voice
1572-
1572+
1573+
async def _get_channel(self):
1574+
return self
1575+
15731576
@property
15741577
def requesting_to_speak(self):
15751578
"""List[:class:`Member`]: A list of members who are requesting to speak in the stage channel."""
@@ -1629,6 +1632,7 @@ async def edit(self, *, reason=None, **options):
16291632

16301633
await self._edit(options, reason=reason)
16311634

1635+
16321636
class CategoryChannel(abc.GuildChannel, Hashable):
16331637
"""Represents a Discord channel category.
16341638

discord/enums.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,14 @@ class MessageType(Enum):
621621
guild_invite_reminder = 22
622622
context_menu_command = 23
623623
automoderation_action = 24
624-
624+
role_subscription_purchase = 25
625+
interaction_premium_upsell = 26
626+
stage_start = 27
627+
stage_end = 28
628+
stage_speaker_change = 29
629+
stage_raise_hand = 30
630+
stage_topic_change = 31
631+
guild_application_premium_subscription = 32
625632

626633

627634
class VoiceRegion(Enum):

docs/api.rst

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,82 @@ of :class:`enum.Enum`.
11831183
Discovery requirements for 3 weeks in a row.
11841184

11851185
.. versionadded:: 1.7
1186+
.. attribute:: thread_created
1187+
1188+
The system message denoting that a thread has been created.
1189+
1190+
.. versionadded:: 2.0
1191+
.. attribute:: reply
1192+
1193+
A message that is a reply to another message.
1194+
1195+
.. versionadded:: 2.0
1196+
.. attribute:: chat_input_command
1197+
1198+
A message that is a slash command.
1199+
1200+
.. versionadded:: 2.0
1201+
.. attribute:: thread_starter_message
1202+
1203+
A message that is the first message in a thread.
1204+
1205+
.. versionadded:: 2.0
1206+
.. attribute:: guild_invite_reminder
1207+
1208+
The system message denoting that a guild invite reminder has been sent.
1209+
1210+
.. versionadded:: 2.0
1211+
.. attribute:: context_menu_command
1212+
1213+
A message that is a context menu command.
1214+
1215+
.. versionadded:: 2.0
1216+
.. attribute:: automoderation_action
1217+
1218+
A log message from discords auto moderation system.
1219+
1220+
.. versionadded:: 2.0
1221+
.. attribute:: role_subscription_purchase
1222+
1223+
A message informing about a role subscription purchase.
1224+
1225+
.. versionadded:: 2.0
1226+
.. attribute:: interaction_premium_upsell
1227+
1228+
A message informing about a premium upsell.
1229+
1230+
.. versionadded:: 2.0
1231+
.. attribute:: stage_start
1232+
1233+
A message informing about a stage starting.
1234+
1235+
.. versionadded:: 2.0
1236+
.. attribute:: stage_end
1237+
1238+
A message informing about a stage ending.
1239+
1240+
.. versionadded:: 2.0
1241+
.. attribute:: stage_speaker_change
1242+
1243+
A message informing about a stage having a new speaker.
1244+
1245+
.. versionadded:: 2.0
1246+
.. attribute:: stage_raise_hand
1247+
1248+
A message informing about someone raising their hand in a stage.
1249+
1250+
.. versionadded:: 2.0
1251+
.. attribute:: stage_topic_change
1252+
1253+
A message informing about the topic of a stage been changed.
1254+
1255+
.. versionadded:: 2.0
1256+
.. attribute:: guild_application_premium_subscription
1257+
1258+
The system message denoting that a member has subscribed to a guild application.
1259+
1260+
.. versionadded:: 2.4
1261+
11861262

11871263
.. class:: ComponentType
11881264

0 commit comments

Comments
 (0)