【发布时间】:2021-05-15 04:16:31
【问题描述】:
我正在使用 telethon 在电报频道中添加用户,但如何从特定电报频道中删除或删除用户?
restrict user so they can’t see messages 使用EditBannedRequest 有一个功能,但我想从“特定”中删除或删除用户
电报频道。
【问题讨论】:
标签: python python-3.x telethon
我正在使用 telethon 在电报频道中添加用户,但如何从特定电报频道中删除或删除用户?
restrict user so they can’t see messages 使用EditBannedRequest 有一个功能,但我想从“特定”中删除或删除用户
电报频道。
【问题讨论】:
标签: python python-3.x telethon
尝试使用https://tl.telethon.dev/index.html 的原始 API 请求
请求应该是DeleteContactsRequest,可以在https://tl.telethon.dev/methods/contacts/delete_contacts.html找到
例子
from telethon.sync import TelegramClient
from telethon import functions, types
with TelegramClient(name, api_id, api_hash) as client:
result = client(functions.contacts.DeleteContactsRequest(id=['username']))
print(result.stringify())
【讨论】: