⟁ᴡ
Size: a a a
⟁ᴡ
⟁ᴡ
АВ
⟁ᴡ
from telethon.tl import types
chats = []
channels = []
async for d in client.iter_dialogs():
if d.is_group and not d.is_channel and d.entity.migrated_to is not None or (d.is_channel and not d.entity.megagroup or d.is_user or isinstance(d.entity, types.ChatForbidden)): continue
else:
chats.append(d)
if not d.is_group and d.is_channel or (d.is_channel and not d.entity.megagroup or d.is_user or isinstance(d.entity, types.ChatForbidden)):
channels.append(d)
print(chats, channels)
⟁ᴡ
⟁ᴡ
⟁ᴡ
async for d in client.iter_dialogs():
if d.is_group:
print(d.id, d.title)
⟁ᴡ
async for d in client.iter_dialogs():
if d.is_channel:
print(d.id, d.title)
⟁ᴡ
p(dir(message))
Result: - '_abc_impl'
- '_action_entities'
- '_broadcast'
- '_buttons'
- '_buttons_count'
- '_buttons_flat'
- '_bytes'
- '_chat'
- '_chat_peer'
- '_client'
- '_document_by_attribute'
- '_file'
- '_finish_init'
- '_forward'
- '_input_chat'
- '_input_sender'
- '_needed_markup_bot'
- '_refetch_chat'
- '_refetch_sender'
- '_reload_message'
- '_reply_message'
- '_sender'
- '_sender_id'
- '_set_buttons'
- '_text'
- '_via_bot'
- '_via_input_bot'
- 'action'
- 'action_entities'
- 'audio'
- 'button_count'
- 'buttons'
- 'chat'
- 'chat_id'
- 'click'
- 'client'
- 'contact'
- 'date'
- 'delete'
- 'dice'
- 'document'
- 'download_media'
- 'edit'
- 'edit_date'
- 'edit_hide'
- 'entities'
- 'file'
- 'forward'
- 'forward_to'
- 'from_id'
- 'from_reader'
- 'from_scheduled'
- 'fwd_from'
- 'game'
- 'geo'
- 'get_buttons'
- 'get_chat'
- 'get_entities_text'
- 'get_input_chat'
- 'get_input_sender'
- 'get_reply_message'
- 'get_sender'
- 'gif'
- 'grouped_id'
- 'has_affecting_media'
- 'has_real_media'
- 'id'
- 'input_chat'
- 'input_sender'
- 'invoice'
- 'is_channel'
- 'is_group'
- 'is_private'
- 'is_reply'
- 'legacy'
- 'mark_read'
- 'media'
- 'media_unread'
- 'mentioned'
- 'message'
- 'out'
- 'photo'
- 'pin'
- 'poll'
- 'post'
- 'post_author'
- 'pretty_format'
- 'raw_text'
- 'reply'
- 'reply_markup'
- 'reply_to_msg_id'
- 'respond'
- 'restriction_reason'
- 'sender'
- 'sender_id'
- 'silent'
- 'sticker'
- 'text'
- 'to_id'
- 'venue'
- 'via_bot'
- 'via_bot_id'
- 'via_input_bot'
- 'video'
- 'video_note'
- 'views'
- 'voice'
- 'web_preview'
⟁ᴡ
p(dir(message))
Result: - '_abc_impl'
- '_action_entities'
- '_broadcast'
- '_buttons'
- '_buttons_count'
- '_buttons_flat'
- '_bytes'
- '_chat'
- '_chat_peer'
- '_client'
- '_document_by_attribute'
- '_file'
- '_finish_init'
- '_forward'
- '_input_chat'
- '_input_sender'
- '_needed_markup_bot'
- '_refetch_chat'
- '_refetch_sender'
- '_reload_message'
- '_reply_message'
- '_sender'
- '_sender_id'
- '_set_buttons'
- '_text'
- '_via_bot'
- '_via_input_bot'
- 'action'
- 'action_entities'
- 'audio'
- 'button_count'
- 'buttons'
- 'chat'
- 'chat_id'
- 'click'
- 'client'
- 'contact'
- 'date'
- 'delete'
- 'dice'
- 'document'
- 'download_media'
- 'edit'
- 'edit_date'
- 'edit_hide'
- 'entities'
- 'file'
- 'forward'
- 'forward_to'
- 'from_id'
- 'from_reader'
- 'from_scheduled'
- 'fwd_from'
- 'game'
- 'geo'
- 'get_buttons'
- 'get_chat'
- 'get_entities_text'
- 'get_input_chat'
- 'get_input_sender'
- 'get_reply_message'
- 'get_sender'
- 'gif'
- 'grouped_id'
- 'has_affecting_media'
- 'has_real_media'
- 'id'
- 'input_chat'
- 'input_sender'
- 'invoice'
- 'is_channel'
- 'is_group'
- 'is_private'
- 'is_reply'
- 'legacy'
- 'mark_read'
- 'media'
- 'media_unread'
- 'mentioned'
- 'message'
- 'out'
- 'photo'
- 'pin'
- 'poll'
- 'post'
- 'post_author'
- 'pretty_format'
- 'raw_text'
- 'reply'
- 'reply_markup'
- 'reply_to_msg_id'
- 'respond'
- 'restriction_reason'
- 'sender'
- 'sender_id'
- 'silent'
- 'sticker'
- 'text'
- 'to_id'
- 'venue'
- 'via_bot'
- 'via_bot_id'
- 'via_input_bot'
- 'video'
- 'video_note'
- 'views'
- 'voice'
- 'web_preview'
- 'is_channel'
- 'is_group'
АВ
⟁ᴡ
⟁ᴡ
[d.entity.id for d in await client.get_dialogs() if (d.is_group and not d.is_channel) or (d.is_group and d.is_channel and d.entity.admin_rights is not None and d.entity.admin_rights.invite_users) or d.is_channel and d.is_channel and d.entity.creator]
⟁ᴡ
⟁ᴡ
for d in await client.get_dialogs():
if (d.is_group and not d.is_channel) or (d.is_group and d.is_channel and d.entity.admin_rights is not None and d.entity.admin_rights.invite_users) or d.is_channel and d.is_channel and d.entity.creator:
print((d)).stringify()
оно же (ну почти)АВ
КА
async for d in client.iter_dialogs():
if d.is_group:
print(d.id, d.title)
КА
⟁ᴡ
d.entity.migrated_to
и isinstance(d.entity, types.ChatForbidden)
и чего-то ещё⟁ᴡ
from telethon.tl.functions.messages import GetAllChatsRequest
[i.title for i in (await client(GetAllChatsRequest([]))).chats if hasattr(i, "deactivated")]