import telebot
import urllib.request
import pyautogui
bot = telebot.TeleBot("TOKEN", parse_mode=None)
@bot.message_handler('start')
def send_welcome(message):
bot.reply_to(message, "Hi Wellcome To Server Manager Bot")
enter code here
@bot.message_handler('getip')
def send_targetip(message):
target_ip = urllib.request.urlopen("http://ip.42.pl/short")
ip = target_ip.read()
bot.reply_to(message,ip)
@bot.message_handler('screen')
def capture_screen(send_photo):
screenimage = pyautogui.screenshot("screen.png")
screenimage.save("C:\Users\HO3IN\Desktop\screen.png")
photo = open("C:\Users\user\Desktop\screen.png",'rb')
bot.send_photo(capture_screen,photo)
photo.close()
bot.polling()
I can't send screenshot from bot, show me this error:
question from:https://stackoverflow.com/questions/65873682/send-picture-with-telebot-in-pythoninit.py:515 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: chat not found"