aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-08-27 04:13:46 -0400
committerRapptz <[email protected]>2019-08-27 04:13:46 -0400
commit1488957a6f34c91659c07d7cc318ddfffb44cfe7 (patch)
treee3fefa508c72550b7bd859ff28a8b84bd131d318
parentAdd versionadded string to GuildChannel.permissions_synced (diff)
downloaddiscord.py-1488957a6f34c91659c07d7cc318ddfffb44cfe7.tar.xz
discord.py-1488957a6f34c91659c07d7cc318ddfffb44cfe7.zip
Add Message.is_system to more intuitively filter system messages.
-rw-r--r--discord/message.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/discord/message.py b/discord/message.py
index 8acd87cf..233d46f6 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -567,6 +567,13 @@ class Message:
guild_id = getattr(self.guild, 'id', '@me')
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')
def system_content(self):
r"""A property that returns the content that is rendered