我使用的是TeleBot库,所有东西都在主机上运行,但是当我在Heroku上下载代码时,它显示了以下错误:
Traceback (most recent call last):
File "main.py", line 7, in <module>
@bot.message_handler(commands=['start'])
AttributeError: 'TeleBot' object has no attribute 'message_handler'代码:
import telebot
import token_for_bot
bot = telebot.TeleBot(token_for_bot)
@bot.message_handler(commands=['start'])
def start_message(message):
bot.send_message(message.chat.id, 'HI')
bot.polling()有什么问题?
发布于 2019-11-22 23:01:27
尝试在Heroku控制台上执行此操作
pip3 uninstall telebot然后
pip3 install pytelegrambotapi --upgrade但是,您是否使用虚拟环境,是否有文件requirements.txt和Procfile?
https://stackoverflow.com/questions/57827171
复制相似问题