检查用户是否为频道成员

问题描述 投票:0回答:1

我使用 python-telegram-bot 并使用 get_chat_member 方法。我的代码是:

user_id = update.effective_chat.id
print(user_id)
channel_username = "@Numbew"
await context.bot.get_chat_member(channel_username, user_id)

我既是频道成员又是频道管理员,但仍然出现以下错误: 文件“C:\Users sus\AppData\Local\Programs\Python\Python312\Lib\site-packages elegram equest_baserequest.py”,第 379 行,在 _request_wrapper 中 引发 BadRequest(消息) telegram.error.BadRequest:找不到用户

问题出在哪里? 难道就没有其他方法吗?人工智能也没有帮助

python asynchronous bots telegram python-telegram-bot
1个回答
0
投票

你可能感到困惑

update.effective_user.id
update.effective_chat.id

使用这些

https://github.com/python-telegram-bot/python-telegram-bot/tree/master/examples

© www.soinside.com 2019 - 2024. All rights reserved.