I try to build a Telegram bot using python and Telegram Bot API and since Telegram Bot API is censored in my country I found [this][1] script to bypass it by an app deployed using Google Apps Script. but the problem is that it just sends text and not files, so I would like the web app to sort of redirect the files I'm sending to it to Telegram, This is a part of my python code:
fr = open("result.txt", "rb")
files = {"document": fr}
script_url = 'https://script.google.com/macros/s/AKfycby20pnglgWTp4oV0tDTKuU87XmvkS6EZd-LTuoCmMM3Ge7PbGJ/exec?bot_token=' + token + '&method=sendDocument&args={"chat_id": ' + chat_id + '}'
requests.post(
url=script_url,
files=files
)
so I'm using a post method to send the file to the web app but on the web app side I don't know how to grab that file and send it to Telegram. [1]: https://gist.github.com/manzoorwanijk/ee9ed032caedf2bb0c83dea73bc9a28e