README file modified

main
Bukxara 3 months ago
parent 49e5221924
commit 23d8398c1b

@ -1,34 +1,12 @@
# Telegram API sending message without rate limit. # Telegram API sending message without rate limit.
## Table of contents
- [Instructions](#instructions)
## Instructions ## Instructions
There are 2 endpoints handled by this microservice: There are 2 endpoints handled by this microservice:
1 -> GET request to [{BASE_URL}/bot${botToken}/sendMessage]({BASE_URL}/bot${botToken}/sendMessage) 1 -> GET
2 -> POST
url that you used for sending a message to chat through telegram bot (as GET request) usually looks like this:
[https://api.telegram.org/bot<Bot_token>/sendMessage?chat_id=<chat_id>&text=<text>](https://api.telegram.org/bot<Bot_token>/sendMessage?chat_id=<chat_id>&text=<text>)
As you can see, you only have to replace [https://api.telegram.org/](https://api.telegram.org/) part with {BASE_URL}, eventually looking like this:
[{BASE_URL}/bot<Bot_token>/sendMessage?chat_id=<chat_id>&text=<text>]({BASE_URL}/bot<Bot_token>/sendMessage?chat_id=<chat_id>&text=<text>)
2 -> POST request to {BASE_URL}/sendMessage
url that you used for sending a message to chat through telegram bot (as POST request) usually looks like this:
[https://api.telegram.org/bot<Bot_Token>/sendMessage](https://api.telegram.org/bot<Bot_Token>/sendMessage)
You are expected to do the same thing you did with GET request: replace [https://api.telegram.org/](https://api.telegram.org/) part with {BASE_URL}, eventually looking like this:
[{BASE_URL}/bot<Bot_token>/sendMessage]({BASE_URL}/bot<Bot_token>/sendMessage) with request body: The only thing you have to do is replace https://api.telegram.org/ part with {BASE_URL}
```{
"chat_id": <chat_id>,
"text": <text>
}```
p.s. Requires redis and preffered configuration for redis is host being at 127.0.0.1 and port being at 6379 ### Redis
Requires redis and preffered configuration for redis is host at 127.0.0.1 and port at 6379

@ -14,8 +14,8 @@ const requestQueue = new Queue("request-queue", {
}); });
const limiter = new Bottleneck({ const limiter = new Bottleneck({
maxConcurrent: 1, // Number of concurrent requests maxConcurrent: 1,
minTime: 1, // Minimum time between requests (in milliseconds) minTime: 1,
}); });
async function sendRequest(data) { async function sendRequest(data) {

Loading…
Cancel
Save