Fix some crashes
This commit is contained in:
parent
2d317d1044
commit
8fc4b5902b
@ -151,7 +151,7 @@ async def matrix_transaction(request):
|
|||||||
body = await request.json()
|
body = await request.json()
|
||||||
events = body['events']
|
events = body['events']
|
||||||
for event in events:
|
for event in events:
|
||||||
if event['age'] > 600000:
|
if 'age' in event and event['age'] > 600000:
|
||||||
print('discarded event of age', event['age'])
|
print('discarded event of age', event['age'])
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
@ -482,6 +482,8 @@ async def aiotg_message(chat, match):
|
|||||||
|
|
||||||
elif 'reply_to_message' in chat.message:
|
elif 'reply_to_message' in chat.message:
|
||||||
re_msg = chat.message['reply_to_message']
|
re_msg = chat.message['reply_to_message']
|
||||||
|
if not 'text' in re_msg:
|
||||||
|
return
|
||||||
if 'last_name' in re_msg['from']:
|
if 'last_name' in re_msg['from']:
|
||||||
msg_from = '{} {} (Telegram)'.format(re_msg['from']['first_name'],
|
msg_from = '{} {} (Telegram)'.format(re_msg['from']['first_name'],
|
||||||
re_msg['from']['last_name'])
|
re_msg['from']['last_name'])
|
||||||
|
Loading…
Reference in New Issue
Block a user