From 1488957a6f34c91659c07d7cc318ddfffb44cfe7 Mon Sep 17 00:00:00 2001 From: Rapptz <rapptz@gmail.com> Date: Tue, 27 Aug 2019 04:13:46 -0400 Subject: [PATCH] Add Message.is_system to more intuitively filter system messages. --- discord/message.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/discord/message.py b/discord/message.py index 8acd87cf0..233d46f63 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