forked from uniborg/uniborg
Let normal snip command also save if not existing
This commit is contained in:
parent
bdb402e645
commit
6a59f1d982
|
@ -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'])
|
||||
|
|
Loading…
Reference in New Issue