![](/img/trans.png)
[英]How to add user to group using Telethon (Telegram python library) InviteToChannelRequest
[英]Telethon InviteToChannelRequest
您好,我嘗試使用 Telethon InviteToChannelRequest 將用戶添加到我的頻道。 我的代碼:
channel = InputPeerChannel(id, hash)
user = InputPeerUser(id, hash)
client(InviteToChannelRequest(channel=channel, users=[user]))
我沒有收到錯誤,但它不起作用。 我嘗試了幾乎所有可能類型的頻道和用戶,但似乎沒有任何效果。 知道我做錯了什么嗎?
您可以使用AddChatUserRequest
方法:
client(AddChatUserRequest(
chat_id=123456789,
user_id=example,
fwd_limit=10
))
注意:您需要是頻道管理員
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.