我的代码:
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”?
最佳答案
它称为 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/