【发布时间】:2020-06-21 21:29:41
【问题描述】:
我想在 Python-Telegram-Bot 中获取具有此功能的频道成员列表:
context.bot.getChatMember("@*****",update.message.chat_id)
我这样做:
a=context.bot.getChatMember("@*****",update.message.chat_id)
但是当我想打印时,如果该用户不在该频道中,它不会返回任何内容,但如果该用户在该频道中,它会返回用户信息
如果该用户不在该频道上,我想获取 (a) 的值。
我使用了 pdb,我得到了 'telegram.error.BadRequest: User not found' 这个错误,但是当我想打印它时什么也不打印,当我在 pdb 中打印 (a) 时,它显示 *** NameError:名称“a”未定义
我该怎么办?
以及如何获取频道成员列表
【问题讨论】:
-
你能告诉我们你的错误吗?
-
我使用了 pdb,我得到了 'telegram.error.BadRequest: User not found' 这个错误,但是当我想打印它时什么也不打印,当我在 pdb 中打印(a)时它说*** NameError: name 'a' is not defined
-
啊,那你能把它加到你的问题里吗?
-
抱歉,我正在添加。
标签: python python-3.x telegram telegram-bot python-telegram-bot