Reputation: 31
I made a bot that sends files from an external server with a URL.
I want the bot to send files directly from your server.
What am I doing wrong? Why didn't the open()
command work?
import telebot
bot = telebot.TeleBot("Token")
@bot.message_handler(commands=['start','help'])
def send_start_message(message):
bot.reply_to(message, "Hi.")
@bot.message_handler(func=lambda m: True)
def echo_all(message):
print(message.text)
duck = open('duck.png','r')
bot.send_photo(message.chat.id, duck)
bot.send_message(message.chat.id, "hi")
bot.polling()
Upvotes: 2
Views: 7936