Tlegram chat id. Send message
I created a bot, got an ID and added a bot to my TG chat, everything works fine, it will respond to commands. But how can such a function be implemented? I have a chat ID in which I am a member and I want to send a message on my own behalf (not on behalf of the bot, I'm not the admin of the group, I can't add it). Thank you
import requests
def telegram_bot_sendtext(bot_message):
bot_token = ''
bot_chatID = ''
send_text = 'https://api.telegram.org/bot' + bot_token + '/sendMessage?chat_id=' + bot_chatID + '&parse_mode=Markdown&text=' + bot_message
response = requests.get(send_text)
return response.json()
test = telegram_bot_sendtext("Testing Telegram bot")
print(test)