Похожие чаты

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 ответов

55 просмотров

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

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

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

30500 за редактор? )
Владимир
47
any reference of this implementation?
BitBuddha
29
Ⓐrtto, [4/23/24 7:02 PM] Please explain more fully how it is not working exactly, and what are the steps you are taking, and what error messages come or what happens. Ⓐrtto, ...
Ezza Kezza
2
sounds like people have lost their kaspa on tradeogre... does this mean tradeogre not trustworthy?
Ezza Kezza
15
Страшнейшая правда про списки ЦБ. С первых дней жизни P2P сферы, молодые человеки, начитавшись законодательной базы и "внутренних" документов, решили, что им противостоит сер...
Foxcool
3
Недавно Google Project Zero нашёл багу в SQLite с помощью LLM, о чём достаточно было шумно в определённых интернетах, которые сопровождались рассказами, что скоро всех "ибешни...
Alex Sherbakov
5
So much speculation in the last week. So much volatility in price. This is because Hedera has a GC that isn't using the network it's governing. Why aren't people asking why a...
Summit Seeker R
9
Anyone else having this error when trying to make transactions?
Datzel
11
Question: How viable is it to use Anvil as the backend infrastructure for managing a TradFi portfolio, while integrating Flexa for instant liquidity and payment solutions? Cou...
Kevin
2
вы делали что-то подобное и как? может есть либы готовые? увидел картинку нокода, где всё линиями соединено и стало интересно попробовать то же в ddl на lua сделать. решил с ч...
Victor
8
Карта сайта