python - getChatMembersCount 远程机器人

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

我的代码:

import telebot
bot = telebot.TeleBot(constants.token)

@bot.message_handler(commands=['roll'])
def handle_command(message):
    roll = random.randint(1, 100)
    bot.send_message(message.chat.id, roll)
    bot.getChatMembersCount()


bot.polling(none_stop=True, interval=0)

错误:

AttributeError: 'TeleBot' object has no attribute 'getChatMembersCount'

如何使用“getChatMembersCount”?

P。 S.我用https://github.com/eternnoir/pyTelegramBotAPI

最佳答案

它称为 get_chat_members_count ( direct link to implementation )。

来自https://github.com/eternnoir/pyTelegramBotAPI/ :

Methods

All API methods are located in the TeleBot class. They are renamed to follow common Python naming conventions. E.g. getMe is renamed to get_me and sendMessage to send_message.

关于python - getChatMembersCount 远程机器人,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48945023/

相关文章:

python - Cython:什么时候应该将字符串定义为 char*、str 或 bytes?

c# - 尝试使用 Bot Framework 在 Telegram 中发送消息时出错

Telegram Bot : How to mention user by its id (not its username)

java - 如何使用java为电报机器人制作一个url按钮

php - 我可以使用 WGET 生成给定 URL 的网站站点地图吗?

python - pyparsing:组合多个元素的setResultsName

python - 我有多个 flask 微服务彼此通信,如何配置docker?

python - jenkins python 模块导入错误

xcode 机器人编辑失败

search-engine - 如何阻止恶意的身份不明机器人爬行我的网站?