M
M
Master Ruby2021-07-26 00:09:30
Python
Master Ruby, 2021-07-26 00:09:30

How to send a message to a telegram bot?

Tell me, is it possible to send a message to a bot through a python script?
Not by means of a regular application (I open a cart, find a bot and send him a message), but by means of a python.

I tried:

data = {"chat_id": "854030241", "text": "hi!"}
url = "https://api.telegram.org/bot1418682426:AAEEsgT0thpVK9CIKShn26SgcXF3R8Q9rjg/sendMessage"

requests.get(url, data)


but in this way, I send a message to myself through the bot.
I need to send a command to the bot (it runs the script) through the script or using linux tools so that it performs a specific function.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-07-26
@SoreMix

From one bot to another write or what? Bots do not see messages from other bots.
You can only send via the client API. pyrogram / telethon

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question