mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-07 10:22:59 +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
|
guild_incident_report_false_alarm = 39
|
||||||
purchase_notification = 44
|
purchase_notification = 44
|
||||||
poll_result = 46
|
poll_result = 46
|
||||||
|
emoji_added = 63
|
||||||
|
|
||||||
|
|
||||||
class SpeakingState(Enum):
|
class SpeakingState(Enum):
|
||||||
|
@ -371,6 +371,15 @@ class SystemChannelFlags(BaseFlags):
|
|||||||
"""
|
"""
|
||||||
return 32
|
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()
|
@fill_with_flags()
|
||||||
class MessageFlags(BaseFlags):
|
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
|
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
|
# Fallback for unknown message types
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
@ -175,6 +175,7 @@ MessageType = Literal[
|
|||||||
39,
|
39,
|
||||||
44,
|
44,
|
||||||
46,
|
46,
|
||||||
|
63,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -1925,6 +1925,14 @@ of :class:`enum.Enum`.
|
|||||||
|
|
||||||
The system message sent when a poll has closed.
|
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
|
.. class:: UserFlags
|
||||||
|
|
||||||
Represents Discord User flags.
|
Represents Discord User flags.
|
||||||
|
Reference in New Issue
Block a user