This is a simple Telegram message gateway.
- Clone this repository
- Run
npm install
- Create a
config.json
based on theconfig.json.example
file - Configure your custom instance of
RappyNotify
- Run
node index.js
The config.json
file contains the following options:
Option | Description |
---|---|
token |
The Telegram bot token |
port |
The port to run the server on |
logIPs |
Whether or not to log IPs in the console |
timeFormat |
The format of the time in the console |
adminToken * |
Authorization token required to perform actions like POST /refresh |
users |
An array of users |
users[x].id |
The user's internal ID (not the telegram id!) |
users[x].aliases |
An array of aliases for the user |
users[x].private |
Decides if the user info can be shown on GET /:user |
users[x].conversation |
The ID of the conversation to send messages to |
users[x].auth |
An object containing authentication options for the user |
users[x].auth.active |
Whether or not an auth key is needed to send messages to the user |
users[x].auth.key |
The key the user needs to enter to send messages |
groups |
An array of groups |
groups[x].id |
The group's internal ID |
groups[x].aliases |
An array of aliases for the group |
groups[x].private |
Decides if the group info can be shown on GET /:group |
groups[x].users |
The users who are in the group |
groups[x].users[x].id |
The user id (Note: The user must exist in the users array) |
groups[x].users[x].private |
If the user's username is shown in GET /:group |
groups[x].auth |
An object containing authentication options for the group |
groups[x].auth.active |
Whether or not an auth key is needed to send messages to the group |
groups[x].auth.key |
The auth key that is needed to send messages |
ratelimiter |
An object containing ratelimiter options |
ratelimiter.enabled |
Whether or not to enable the ratelimiter |
ratelimiter.max |
The maximum amount of requests a user can send in the time window |
ratelimiter.seconds |
The length of the ratelimiter time window in seconds |
ratelimiter.bypassTokens |
An array of strings you can put in the x-ratelimit-bypass header to bypass the ratelimit |
* Is optional so you can leave it empty
To send a message to a user or a group, simply send a POST
request to /:id
where id
is a user or a group id or one of their aliases. The request body should contain a JSON object with the message
property. If the user has authentication enabled, you also need to include an Authorization
header with the value of their key.
Just send a POST
request to /refresh
and the config get's refreshed.