I'm trying to upload the outcomes of my code (they are images) in a group with a Telegram bot.
I've tried:
import requests
import numpy as np
paths=np.array([])
for z in range(8):
paths=np.append(paths,str(f"path\\{z}.jpg"))
url="https://api.telegram.org/bot<<my-bot-http-token>>/senddocument?chat_id=<<chat-id>>"
for path in paths:
files={'document':open(path,'rb')}
resp=requests.post(url,files=files)
It works but it sends the files separately and I want to group them then send.