From 6a59f1d9827d894f5a348396e7fe782467cd6d36 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Mon, 23 Apr 2018 16:17:31 +0200 Subject: [PATCH] Let normal snip command also save if not existing --- stdplugins/snip.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stdplugins/snip.py b/stdplugins/snip.py index 4f5b3dd..f97dbfb 100644 --- a/stdplugins/snip.py +++ b/stdplugins/snip.py @@ -20,7 +20,9 @@ snips = storage.snips or {} @borg.on(events.NewMessage(pattern=r'.snip (\S+)')) async def on_snip(event): name = event.pattern_match.group(1) - if name in snips: + if name not in snips: + await on_snip_save(event) + else: snip = snips[name] if snip['type'] == TYPE_PHOTO: media = types.InputPhoto(snip['id'], snip['hash'])