【发布时间】:2022-01-16 03:19:36
【问题描述】:
所以,我是编码和 Python 的超级初学者,正在尝试为我朋友即将到来的生日制作一个电报机器人。我在这里和那里都知道我的基础知识,所以请友善!我正在使用 pyTelegramBotAPI 和 Replit。基本上,我希望机器人在正确触发命令后发送一些图像。我正在正确复制图像路径的代码,但不知何故此错误不断弹出。救命!
photo1 = open(r"C:\Users\User\Desktop\bday\IMG_2201.PNG", 'rb')
@bot.message_handler(commands=['photo'])
def msg4(message):
bot.send_photo(message.chat.id, photo1)
my code on replit and the error
what i think im supposed to code for my bot to send an image
【问题讨论】:
标签: python telegram-bot py-telegram-bot-api