mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
Keep the original message when sniping edits
This commit is contained in:
parent
29dcf845de
commit
617e69b7a3
1 changed files with 6 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue