From 199d9b15eadbd87794674c81f8932158c362169c Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Mon, 2 Jul 2018 15:30:21 +0200 Subject: [PATCH] Fix sed plugin ignoring edits --- stdplugins/sed.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stdplugins/sed.py b/stdplugins/sed.py index 206cb1f..02422ef 100644 --- a/stdplugins/sed.py +++ b/stdplugins/sed.py @@ -77,6 +77,12 @@ async def group_has_sedbot(group): async def on_message(event): last_msgs[event.chat_id].appendleft(event.message) +@borg.on(events.MessageEdited) +async def on_edit(event): + for m in last_msgs[event.chat_id]: + if m.id == event.id: + m.raw_text = event.raw_text + break @borg.on(events.NewMessage( pattern=re.compile(r"^s/((?:\\/|[^/])+)/((?:\\/|[^/])*)(/.*)?")))