From 7426cea6d2c53aab75d8e338cf215339a82ac437 Mon Sep 17 00:00:00 2001 From: udf Date: Wed, 28 Nov 2018 15:09:29 +0200 Subject: [PATCH] Remove delay before making draft and only fire on \n.e --- stdplugins/kbass_edit.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stdplugins/kbass_edit.py b/stdplugins/kbass_edit.py index 970716d..5da8b5c 100644 --- a/stdplugins/kbass_edit.py +++ b/stdplugins/kbass_edit.py @@ -14,7 +14,6 @@ from stdplugins.kbass_core import self_reply_cmd @self_reply_cmd(borg, r"^\.e$") async def on_edit_start(event, target): - await asyncio.sleep(3) # tdesktop doesn't sync drafts when the window is active await borg(SaveDraftRequest( peer=await event.get_input_chat(), message=(target.message or '.') + '\n.e', @@ -24,7 +23,7 @@ async def on_edit_start(event, target): )) -@self_reply_cmd(borg, r'(?ms)^(.+)\.e$') +@self_reply_cmd(borg, r'(?ms)^(.+)\n\.e$') async def on_edit_end(event, target): text = event.pattern_match.group(1) message = event.message.message[:-2]