forked from uniborg/uniborg
Remove delay before making draft and only fire on \n.e
This commit is contained in:
parent
e43d3b29bf
commit
7426cea6d2
|
@ -14,7 +14,6 @@ from stdplugins.kbass_core import self_reply_cmd
|
||||||
|
|
||||||
@self_reply_cmd(borg, r"^\.e$")
|
@self_reply_cmd(borg, r"^\.e$")
|
||||||
async def on_edit_start(event, target):
|
async def on_edit_start(event, target):
|
||||||
await asyncio.sleep(3) # tdesktop doesn't sync drafts when the window is active
|
|
||||||
await borg(SaveDraftRequest(
|
await borg(SaveDraftRequest(
|
||||||
peer=await event.get_input_chat(),
|
peer=await event.get_input_chat(),
|
||||||
message=(target.message or '.') + '\n.e',
|
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):
|
async def on_edit_end(event, target):
|
||||||
text = event.pattern_match.group(1)
|
text = event.pattern_match.group(1)
|
||||||
message = event.message.message[:-2]
|
message = event.message.message[:-2]
|
||||||
|
|
Loading…
Reference in New Issue