Fix constructing PtsInfo for channels

This commit is contained in:
Lonami Exo 2022-01-23 12:34:16 +01:00
parent 0d597d1003
commit de2cd1f2cf

View File

@ -69,7 +69,10 @@ class PtsInfo:
pts = getattr(update, 'pts', None)
if pts:
pts_count = getattr(update, 'pts_count', None) or 0
entry = getattr(update, 'channel_id', None) or ENTRY_ACCOUNT
try:
entry = update.message.peer_id.channel_id
except AttributeError:
entry = getattr(update, 'channel_id', None) or ENTRY_ACCOUNT
return cls(pts=pts, pts_count=pts_count, entry=entry)
qts = getattr(update, 'qts', None)