Keep the original message when sniping edits

pull/163/head
stijndcl 2023-01-16 21:33:58 +01:00
parent 29dcf845de
commit 617e69b7a3
1 changed files with 6 additions and 0 deletions

View File

@ -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 <before>, but instead change the <after>
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,