Add Message.is_system to more intuitively filter system messages.
This commit is contained in:
parent
3dc9f40be7
commit
1488957a6f
@ -567,6 +567,13 @@ class Message:
|
|||||||
guild_id = getattr(self.guild, 'id', '@me')
|
guild_id = getattr(self.guild, 'id', '@me')
|
||||||
return 'https://discordapp.com/channels/{0}/{1.channel.id}/{1.id}'.format(guild_id, self)
|
return 'https://discordapp.com/channels/{0}/{1.channel.id}/{1.id}'.format(guild_id, self)
|
||||||
|
|
||||||
|
def is_system(self):
|
||||||
|
""":class:`bool`: Whether the message is a system message.
|
||||||
|
|
||||||
|
..versionadded:: 1.3
|
||||||
|
"""
|
||||||
|
return self.type is not MessageType.default
|
||||||
|
|
||||||
@utils.cached_slot_property('_cs_system_content')
|
@utils.cached_slot_property('_cs_system_content')
|
||||||
def system_content(self):
|
def system_content(self):
|
||||||
r"""A property that returns the content that is rendered
|
r"""A property that returns the content that is rendered
|
||||||
|
Loading…
x
Reference in New Issue
Block a user