From 29dcf845de00dec9f14902470f666a680d9b2a47 Mon Sep 17 00:00:00 2001 From: stijndcl Date: Mon, 16 Jan 2023 21:27:32 +0100 Subject: [PATCH 1/2] Add extra debug info to sync command --- didier/cogs/owner.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/didier/cogs/owner.py b/didier/cogs/owner.py index 974896e..1c2e76b 100644 --- a/didier/cogs/owner.py +++ b/didier/cogs/owner.py @@ -85,11 +85,17 @@ class Owner(commands.Cog): if flags.copy_globals: self.client.tree.copy_global_to(guild=guild) - await self.client.tree.sync(guild=guild) + synced_commands = await self.client.tree.sync(guild=guild) else: - await self.client.tree.sync() + synced_commands = await self.client.tree.sync() + + command_names = "\n".join([cmd.name for cmd in synced_commands]) await ctx.message.add_reaction("🔄") + await ctx.reply( + f"Successfully synced {len(synced_commands)} application commands: ```\n{command_names}\n```", + mention_author=False, + ) @commands.group(name="Add", aliases=["Create"], case_insensitive=True, invoke_without_command=False) async def add_msg(self, ctx: commands.Context): From 617e69b7a350201e767e5d85f3c7c4281adfa8d8 Mon Sep 17 00:00:00 2001 From: stijndcl Date: Mon, 16 Jan 2023 21:33:58 +0100 Subject: [PATCH 2/2] Keep the original message when sniping edits --- didier/didier.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/didier/didier.py b/didier/didier.py index 318cc1c..018f34d 100644 --- a/didier/didier.py +++ b/didier/didier.py @@ -382,6 +382,12 @@ class Didier(commands.Bot): if not should_snipe(before): return + # If the edited message is currently present in the snipe cache, + # don't update the , but instead change the + existing = self.sniped.get(before.channel.id, None) + if existing is not None and existing[0].id == before.id: + before = existing[0] + self.sniped[before.channel.id] = ( before, after,