Merge pull request #163 from stijndcl/snipe-original

Make edit snipe keep the original message
pull/165/head
Stijn De Clercq 2023-01-16 21:37:21 +01:00 committed by GitHub
commit c7b0bb8606
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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,