diff --git a/requirements-stdborg.txt b/requirements-stdborg.txt new file mode 100644 index 0000000..4f9256d --- /dev/null +++ b/requirements-stdborg.txt @@ -0,0 +1 @@ +regex diff --git a/requirements.txt b/requirements.txt index 437350f..15ef170 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1 @@ telethon-aio - diff --git a/stdplugins/re.py b/stdplugins/re.py index 426d82f..df3e908 100644 --- a/stdplugins/re.py +++ b/stdplugins/re.py @@ -7,7 +7,7 @@ from telethon.tl import types, functions HEADER = "[[regex]]\n" KNOWN_RE_BOTS = re.compile( - r'(regex|moku|BananaButler_)bot', + r'(regex|moku|BananaButler_|rgx|l4mR)bot', flags=re.IGNORECASE ) @@ -75,8 +75,7 @@ async def group_has_regex(group): @borg.on(events.NewMessage) async def on_message(event): - chat_id = utils.get_peer_id(await event.input_chat) - last_msgs[chat_id].appendleft(event.message) + last_msgs[event.chat_id].appendleft(event.message) @borg.on(events.NewMessage( diff --git a/stdplugins/snip.py b/stdplugins/snip.py index acaac59..dd9d905 100644 --- a/stdplugins/snip.py +++ b/stdplugins/snip.py @@ -72,6 +72,7 @@ async def on_snip_list(event): @borg.on(events.NewMessage(pattern=r'.snipd (\S+)', outgoing=True)) async def on_snip_delete(event): snips.pop(event.pattern_match.group(1), None) + storage.snips = snips await event.delete()