You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.5 KiB

# Telegram API sending message without rate limit.
1 month ago
## Table of contents
- [Instructions](#instructions)
1 month ago
## Instructions
1 month ago
There are 2 endpoints handled by this microservice:
1 -> GET request to [{BASE_URL}/bot${botToken}/sendMessage]({BASE_URL}/bot${botToken}/sendMessage)
1 month ago
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>)
1 month ago
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:
1 month ago
[{BASE_URL}/bot<Bot_token>/sendMessage?chat_id=<chat_id>&text=<text>]({BASE_URL}/bot<Bot_token>/sendMessage?chat_id=<chat_id>&text=<text>)
1 month ago
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)
1 month ago
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:
1 month ago
[{BASE_URL}/bot<Bot_token>/sendMessage]({BASE_URL}/bot<Bot_token>/sendMessage) with request body:
```{
1 month ago
"chat_id": <chat_id>,
"text": <text>
}```
1 month ago
p.s. Requires redis and preffered configuration for redis is host being at 127.0.0.1 and port being at 6379