我想用用戶帳戶阻止像用戶或機(jī)器人這樣的實(shí)體。我找不到任何方法。此外,最好有一些解除阻止實(shí)體的方法。
1 回答

30秒到達(dá)戰(zhàn)場
TA貢獻(xiàn)1828條經(jīng)驗(yàn) 獲得超6個贊
您需要使用所謂的原始 API。搜索“block”會將我們帶到BlockRequest一個示例中:
from telethon.sync import TelegramClient
from telethon import functions, types
with TelegramClient(name, api_id, api_hash) as client:
result = client(functions.contacts.BlockRequest(
id='username'
))
print(result)
添加回答
舉報(bào)
0/150
提交
取消