Bot for notification of actual power outages and notification of planned outages
- Send a message about actual outages
- Send messages about scheduled outages
- Displays the amount of time electricity has been present or absent
- The ability to disable the bot
- Ability to disable scheduled messages
- The ability to update real-time notifications about the status of electricity
| Command | Description |
|---|---|
turn_bot |
Turn on/off the Bot |
turn_emergency |
Turn on/off planned messages |
| Command | Description |
|---|---|
get_id |
Return current chat id |
get_message_id |
Return messageID for reply message (only chats) |
curr_status |
Return current online status |
- You configure the config
- You add the bot to the channel or chat and give it the necessary rights
- If there is no response from the set endpoint within 15 seconds (or 3 ping attempts), the bot will send information that the power is off
- Every evening at 19:00, the bot will send a schedule of outages for the next day for the specified group
- Also, in one message, if you specify (update
.envfile) which bot will update information in real time
- Docker
(or golang) - Docker-Compose
(or golang) - Makefile
- Clone this repository
git clone https://github.com/sergikoio/blackout-bot.git - Create .env file
cp .env.example .env - Create messages.json file
cp messages.json.example messages.json - Edit
.envfile andmessages.jsonif needed - Run Bot:
- With Docker:
make build - Local with Go:
go mod downloadgo run main.go- run from
rootuser - only if you want to use PINGREQUEST_TYPE
- run from
- With Docker:
- Where to get the endpoint?
- You should start a server at home that will respond to any request. Or use your router (see something like: router in global). But for this you must have either a permanent IP address or DDNS on the router
- For which city is the schedule of scheduled outages made?
- Kyiv
- Where can I launch the bot?
- VPS, Qovery, Heroku, etc...
Any contributions are welcome, also if there are problems in the process, then create an issue