mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-30 05:13:45 +03:00
Fix invalid access to .participants on chat forbidden result
This commit is contained in:
parent
7b94530bfc
commit
302a823c88
|
@ -83,7 +83,7 @@ from .tl.types import (
|
||||||
InputMessageEntityMentionName, DocumentAttributeVideo,
|
InputMessageEntityMentionName, DocumentAttributeVideo,
|
||||||
UpdateEditMessage, UpdateEditChannelMessage, UpdateShort, Updates,
|
UpdateEditMessage, UpdateEditChannelMessage, UpdateShort, Updates,
|
||||||
MessageMediaWebPage, ChannelParticipantsSearch, PhotoSize, PhotoCachedSize,
|
MessageMediaWebPage, ChannelParticipantsSearch, PhotoSize, PhotoCachedSize,
|
||||||
PhotoSizeEmpty, MessageService
|
PhotoSizeEmpty, MessageService, ChatParticipants
|
||||||
)
|
)
|
||||||
from .tl.types.messages import DialogsSlice
|
from .tl.types.messages import DialogsSlice
|
||||||
from .extensions import markdown, html
|
from .extensions import markdown, html
|
||||||
|
@ -1278,6 +1278,11 @@ class TelegramClient(TelegramBareClient):
|
||||||
elif isinstance(entity, InputPeerChat):
|
elif isinstance(entity, InputPeerChat):
|
||||||
# TODO We *could* apply the `filter` here ourselves
|
# TODO We *could* apply the `filter` here ourselves
|
||||||
full = self(GetFullChatRequest(entity.chat_id))
|
full = self(GetFullChatRequest(entity.chat_id))
|
||||||
|
if not isinstance(full.full_chat.participants, ChatParticipants):
|
||||||
|
# ChatParticipantsForbidden won't have ``.participants``
|
||||||
|
_total[0] = 0
|
||||||
|
return
|
||||||
|
|
||||||
if _total:
|
if _total:
|
||||||
_total[0] = len(full.full_chat.participants.participants)
|
_total[0] = len(full.full_chat.participants.participants)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user