Merge pull request #4 from expectocode/improvements

Improvements
This commit is contained in:
udf 2018-06-03 14:02:39 +02:00 committed by GitHub
commit 8c58ea65e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

1
requirements-stdborg.txt Normal file
View File

@ -0,0 +1 @@
regex

View File

@ -1,2 +1 @@
telethon-aio telethon-aio

View File

@ -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(

View File

@ -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()