I want to send python script output to a telegram bot what libraries should I use and if possible how to use it.
I tried this but not working
import requests
def telegram_bot_sendtxt(bot_message):
bot_token = "Bot_token"
bot_chatID = "chat_id"
send_txt = "https://api.telegram.org/bot" + bot_token + "/sendMessage?chat_id= " + bot_chatID + "&parse_mode=MarkdownV2&text=" + bot_message
response = requests.get(send_txt)
return response.json
telegram_bot_sendtxt("test")
2
Answers
See here. There are many libraries and code examples.
Thy with this one: Python Telegram Bot