mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-05 09:26:10 +00:00
Add support for emoji_added message type
This commit is contained in:
@ -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,
|
||||
]
|
||||
|
||||
|
||||
|
@ -1925,6 +1925,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.
|
||||
|
Reference in New Issue
Block a user