support if reply_to key doesn't exist in raw post

This commit is contained in:
Tristan Lee
2022-12-25 13:58:09 -08:00
parent cca3f174b1
commit aad3e67a01

View File

@@ -161,7 +161,7 @@ class TelegramTelethonTransformer(Transformer):
fwd_from = channel.id
reply_to = None
if raw['reply_to']:
if raw.get('reply_to'):
reply_to_id = str(raw['reply_to']['reply_to_msg_id'])
post = session.query(Post).filter_by(channel=data.channel, platform_id=reply_to_id).first()
if post is None: