mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-19 04:24:41 +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,
|
||||
]
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user