Answer the question
In order to leave comments, you need to log in
How to send screenshot PyTelegramBotApi?
This must be done without interaction with the bot, i.e. a screen bot sends it and the screen is deleted from the PC.
I suggested this code but it doesn't work.
im=ImageGrab.grab(bbox=(0,0,1920,1080))
im.save('im.png')
sleep(2)
def smt(message):
if im:
bot.send_photo(message.chat.id, 'im')
sleep(2)
path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'im.png')
os.remove(path)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question