python电报bot模块(telebot)

时间:2018-09-16 16:15:05

标签: python

我已经编写了一个带有Telebot模块的简单示例bot,但是我不知道如何解决此问题。我的代码是:

import telebot

bot = telebot.testBot("699870969:AAHth6QQWI8GR2CuCyW9V98F3CXUIA2siAw")

@bot.message_handler(commands = ['start', 'help'])
def send_welcome(message):
   bot.reply_to(message, "hesam, how are you ?")


@bot.message_handler(func=lambda message: True)
def echo_all(message):
   bot.reply_to(message, message.text)

bot.polling()
  

错误:Telebot模块没有测试bot的属性

1 个答案:

答案 0 :(得分:0)

您似乎误拼了TeleBot类名。参见the example