Steve C
3 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with
22 additions and
0 deletions
-
discord/enums.py
-
discord/flags.py
-
discord/message.py
-
discord/types/message.py
-
docs/api.rst
|
|
@ -275,6 +275,7 @@ class MessageType(Enum): |
|
|
|
guild_incident_report_false_alarm = 39 |
|
|
|
purchase_notification = 44 |
|
|
|
poll_result = 46 |
|
|
|
emoji_added = 63 |
|
|
|
|
|
|
|
|
|
|
|
class SpeakingState(Enum): |
|
|
|
|
|
@ -371,6 +371,15 @@ class SystemChannelFlags(BaseFlags): |
|
|
|
""" |
|
|
|
return 32 |
|
|
|
|
|
|
|
@flag_value |
|
|
|
def emoji_added(self): |
|
|
|
""":class:`bool`: Returns ``True`` if the system channel is used for |
|
|
|
emoji added notifications. |
|
|
|
|
|
|
|
.. versionadded:: 2.7 |
|
|
|
""" |
|
|
|
return 256 |
|
|
|
|
|
|
|
|
|
|
|
@fill_with_flags() |
|
|
|
class MessageFlags(BaseFlags): |
|
|
|
|
|
@ -2865,6 +2865,9 @@ class Message(PartialMessage, Hashable): |
|
|
|
) |
|
|
|
return f"{self.author.display_name}'s poll {poll_title.value} has closed." # type: ignore |
|
|
|
|
|
|
|
if self.type is MessageType.emoji_added: |
|
|
|
return f'{self.author.name} added a new emoji, {self.content}' |
|
|
|
|
|
|
|
# Fallback for unknown message types |
|
|
|
return '' |
|
|
|
|
|
|
|
|
|
@ -175,6 +175,7 @@ MessageType = Literal[ |
|
|
|
39, |
|
|
|
44, |
|
|
|
46, |
|
|
|
63, |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1924,6 +1924,14 @@ of :class:`enum.Enum`. |
|
|
|
|
|
|
|
The system message sent when a poll has closed. |
|
|
|
|
|
|
|
.. versionadded:: 2.5 |
|
|
|
|
|
|
|
.. attribute:: emoji_added |
|
|
|
|
|
|
|
The system message sent when a custom emoji is added to the guild. |
|
|
|
|
|
|
|
.. versionadded:: 2.7 |
|
|
|
|
|
|
|
.. class:: UserFlags |
|
|
|
|
|
|
|
Represents Discord User flags. |
|
|
|