diff options
author | 2021-10-08 14:24:14 +0100 | |
---|---|---|
committer | 2021-10-08 14:24:14 +0100 | |
commit | 3c26b4d2fc4746da13695c31ef4dc7435f35525f (patch) | |
tree | 1f3f491842ff5a20affdaa444e25f71ce1560c7b | |
parent | `.topic` command improvements. (diff) |
Add handling for `discord.NotFound` when re-rolling / removing reaction
-rw-r--r-- | bot/exts/utilities/conversationstarters.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bot/exts/utilities/conversationstarters.py b/bot/exts/utilities/conversationstarters.py index 2316c50d..fcb5f977 100644 --- a/bot/exts/utilities/conversationstarters.py +++ b/bot/exts/utilities/conversationstarters.py @@ -100,8 +100,13 @@ class ConvoStarters(commands.Cog): await message.clear_reaction("🔄") break else: - await message.edit(embed=self._build_topic_embed(message.channel.id)) - await message.remove_reaction(reaction, user) + try: + await message.edit(embed=self._build_topic_embed(message.channel.id)) + except discord.NotFound: + break + + with suppress(discord.NotFound): + await message.remove_reaction(reaction, user) @commands.command() @commands.cooldown(1, 60*2, commands.BucketType.channel) |