1

以下代码用于加入电报组:

from telethon.sync import TelegramClient
from telethon import functions, types

with TelegramClient(name, api_id, api_hash) as client:
    result = client(functions.messages.ImportChatInviteRequest(
        hash='A4LmkR23G0IGxBE71zZfo1'
    ))
    print(result.stringify())

工作完成后如何离开那个小组?

4

1 回答 1

1

你可以使用client.delete_dialog

await client.delete_dialog('username')
# can accept chat ID too
于 2020-09-26T18:00:30.027 回答