mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-15 03:25:48 +02:00
Merge pull request #163 from stijndcl/snipe-original
Make edit snipe keep the original message
This commit is contained in:
commit
c7b0bb8606
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