forked from kate/uniborg
commit
8c58ea65e1
|
@ -0,0 +1 @@
|
||||||
|
regex
|
|
@ -1,2 +1 @@
|
||||||
telethon-aio
|
telethon-aio
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ from telethon.tl import types, functions
|
||||||
|
|
||||||
HEADER = "[[regex]]\n"
|
HEADER = "[[regex]]\n"
|
||||||
KNOWN_RE_BOTS = re.compile(
|
KNOWN_RE_BOTS = re.compile(
|
||||||
r'(regex|moku|BananaButler_)bot',
|
r'(regex|moku|BananaButler_|rgx|l4mR)bot',
|
||||||
flags=re.IGNORECASE
|
flags=re.IGNORECASE
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -75,8 +75,7 @@ async def group_has_regex(group):
|
||||||
|
|
||||||
@borg.on(events.NewMessage)
|
@borg.on(events.NewMessage)
|
||||||
async def on_message(event):
|
async def on_message(event):
|
||||||
chat_id = utils.get_peer_id(await event.input_chat)
|
last_msgs[event.chat_id].appendleft(event.message)
|
||||||
last_msgs[chat_id].appendleft(event.message)
|
|
||||||
|
|
||||||
|
|
||||||
@borg.on(events.NewMessage(
|
@borg.on(events.NewMessage(
|
||||||
|
|
|
@ -72,6 +72,7 @@ async def on_snip_list(event):
|
||||||
@borg.on(events.NewMessage(pattern=r'.snipd (\S+)', outgoing=True))
|
@borg.on(events.NewMessage(pattern=r'.snipd (\S+)', outgoing=True))
|
||||||
async def on_snip_delete(event):
|
async def on_snip_delete(event):
|
||||||
snips.pop(event.pattern_match.group(1), None)
|
snips.pop(event.pattern_match.group(1), None)
|
||||||
|
storage.snips = snips
|
||||||
await event.delete()
|
await event.delete()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue