Use event.chat_id instead of event.input_chat

saving an await and a potential exception if input_chat could not be
found
This commit is contained in:
Tanuj 2018-06-01 00:54:37 +01:00
parent cfd6004dd9
commit 6bf457793c
1 changed files with 1 additions and 2 deletions

View File

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