Похожие чаты

Guys, hello! I have a question: Using the python REQUESTS library, you

can make it so that by means of a POST telegram request the bot will send a message to a specific user
The code for this action looks something like this:

import request

id_user = '1234567890'
message = ‘Hello!’
url = “https://api.telegram.org/botTOKEN_MY_BOT/sendMessage”

payload = {
'chat_id': id_user,
'text': message
}

requests.post(url, data=payload)

——————

Do you know if it is also possible, using the REQUESTS library, to perform requests through which a telegram bot running on TELETHON will send a message to a specific user?
Interested in sending via REQUESTS

13 ответов

72 просмотра

Yeah it's possible but it's like you go through a 1000 km way instead on going through a 10 km way which is shorter and better. Telegram bot frameworks have been made to ease working with bot api

123- Автор вопроса
CɪᴘʜᴇʀX ₂₃ . ₁₆
Yeah it's possible but it's like you go through a ...

Yes, thank you, but still, if you know, please give me a code example) Something like (pseudo code): import request import Telethon.session as TS id_user = '1234567890' message = ‘Hello!’ url = “https://api.telegram.org/botTS/sendMessage” payload = { 'api_id': api_id, 'api_hash', api_hash, 'chat_id': id_user, 'text': message } requests.post(url, data=payload)

123
Yes, thank you, but still, if you know, please giv...

There is none. if you want one, you have to make your own API for it

123- Автор вопроса
⎞ .·. ⎝ ⎝
There is none. if you want one, you have to make y...

Does this mean that I can ONLY send messages from the executable file in which TELETHON is running? Or are there other ways?

yes. unless you make your own api for it

123- Автор вопроса
123- Автор вопроса
⎞ .·. ⎝ ⎝
yes. unless you make your own api for it

The question is in continuation of the topic of my own api. For example, I launched Flask with endpoint, which accepts the request and after processing it, how should the method of sending a message on behalf of the TELETHON bot be called? I don't understand it, because a file with Flask is one file, and a file with TELEPHONE is another file. It is likely that you need to import some methods from the running TELETHON file into the Flask file. Am I right?

123
The question is in continuation of the topic of my...

The flask api needs the telethon to run with it in the same place. then you call your own api with "requests" aka the Flask, your api needs to call telethon' client instance to conduct the action also telethon is async, using Flask will be harder, use Quart instead

123- Автор вопроса
⎞ .·. ⎝ ⎝
The flask api needs the telethon to run with it in...

For an async approach, instead of Flask, I should use QUART or AioHTTP, right?)

⎞ .·. ⎝ ⎝
yes. unless you make your own api for it

Hello dear sir , i have one question, currently I am steaming to another platform using item_download , so is there any limitations, that 1000 or 10k can viewer can watch a video at once ? 😄 I am asking this question to avoid in trouble in future Currently i have 30 50 viewer

John
Hello dear sir , i have one question, currently I ...

you have to test it on your own. Telegram downloads have limits for active processes at once. unless you cache them locally and download once

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта