diff options
| author | 2020-04-09 08:00:39 -0700 | |
|---|---|---|
| committer | 2020-04-09 20:28:09 +0200 | |
| commit | 9d6425474b8efa2dd4aba0086c1e8aaeb5eafeed (patch) | |
| tree | f47f8f5933be1473d8e513700dd8385c2708351b | |
| parent | Suppress errors when resetting permissions. (diff) | |
HelpChannels: check author of dormant message
In a testing environment, the bot may try to edit the message of a
different bot. Therefore, the author of the message should be checked
to ensure the current bot sent it.
| -rw-r--r-- | bot/cogs/help_channels.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/bot/cogs/help_channels.py b/bot/cogs/help_channels.py index a6fa05d90..5f59a9d60 100644 --- a/bot/cogs/help_channels.py +++ b/bot/cogs/help_channels.py @@ -390,14 +390,13 @@ class HelpChannels(Scheduler, commands.Cog): log.info("Cog is ready!") self.ready.set() - @staticmethod - def is_dormant_message(message: t.Optional[discord.Message]) -> bool: + def is_dormant_message(self, message: t.Optional[discord.Message]) -> bool: """Return True if the contents of the `message` match `DORMANT_MSG`.""" if not message or not message.embeds: return False embed = message.embeds[0] - return embed.description.strip() == DORMANT_MSG.strip() + return message.author == self.bot.user and embed.description.strip() == DORMANT_MSG.strip() async def move_idle_channel(self, channel: discord.TextChannel, has_task: bool = True) -> None: """ |