aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-04-09 08:00:39 -0700
committerGravatar Numerlor <[email protected]>2020-04-09 20:28:09 +0200
commit9d6425474b8efa2dd4aba0086c1e8aaeb5eafeed (patch)
treef47f8f5933be1473d8e513700dd8385c2708351b
parentSuppress 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.py5
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:
"""