【问题标题】:Telebot - Check if the bot is admin on a channelTelebot - 检查机器人是否是频道的管理员
【发布时间】:2020-12-22 13:11:11
【问题描述】:

我需要检查机器人是否是频道的管理员。我正在使用库 pyTelegramBotAPI。

我试过这个:

bot.get_chat_member(msg.forward_from_chat.id, '@TestBot')

但它给了我这个错误:

[b'{"ok":false,"error_code":400,"description":"错误请求:指定了错误的 user_id"}']"

【问题讨论】:

    标签: python telegram-bot py-telegram-bot-api


    【解决方案1】:

    好的,我知道为什么它不起作用了。 user_id 参数用于int,因此放置机器人的用户名不起作用。要解决此问题,只需使用 @getidsbot 之类的方法获取机器人的 ID,并将 ID 作为参数 user_id 放入 method get_chat_member()

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-13
      • 1970-01-01
      • 2018-12-20
      • 1970-01-01
      • 2018-02-02
      • 1970-01-01
      • 1970-01-01
      • 2020-12-30
      相关资源
      最近更新 更多