https://github.com/endocrimes/endobot
https://github.com/endocrimes/endobot
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/endocrimes/endobot
- Owner: endocrimes
- Created: 2020-04-19T09:30:10.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-22T16:29:52.000Z (about 6 years ago)
- Last Synced: 2025-01-24T14:13:06.596Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 1.3 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# endobot
endobot is a personal telegram bot for doing random stuff. Mostly for notifying
me when things happen.
## Running
```bash
export JWT_SECRET="my-secret-key"
export TELEGRAM_BOT_TOKEN="your-telegram-api-key"
export LISTEN_ADDR=":8080"
./endobot
```
## The Bot
### Commands
#### `/token`
This command generates a new JWT that can be used to authenticate with the bots
API.
## API
(Sorry these docs are bad. I should use some tooling around this, but this is
just notes for myself rn)
### Authentication
All APIs require authentication. Authentication tokens can be generated by
messaging the Telegram bot with a `/token` command.
The API will parse tokens from two places, firstly the `Authorization` header.
If the `Authorization` header is empty or not present, then it will fall back to
a `token` URL Param.
### POST /notify
#### Body
```json
{
"message": "the message contents",
"disable_notification": false
}
```