Bot for tracking new deployments on DigitalOcean and sending notifications to messengers (at the moment, only Telegram available).
- Fork this repository to your folder
- Talk to @BotFather and go through some dialog options until you've successfully created a bot. You should receive a token in the format of
123456789:blablabla
- Copy
.env.example
to.env
- Edit
.env
by changing the environment variables (see below) - Run the project with
cargo run
WORK_INTERVAL
- how often to check in seconds. The recommended range is 15-60 seconds.
DO_TOKEN
- You can generate an OAuth token by visiting the Applications & API section of the DigitalOcean control panel for your account. Set scope to READ only value.
DB_PATH
- the folder where the database will be located
MSG_PATH
- message template folder
TG_TOKEN
- the token you received when you created the botTG_CHAT_ID
- the ID of the chat you added the bot to (see below).
LOG_SHOW_DATETIME
- set totrue
if you want the time and date to be displayed in the logs,false
if you don't.LOG_LEVEL
- log level. Recommended values:debug
for debugging andinfo
for working in production.
- Make a request to the following URL (use the token you received when you created the bot):
https://api.telegram.org/bot<token>/getUpdates
The API response should look something like this:
{
ok: true,
result: [
{
update_id: 805747995,
my_chat_member: {
chat: {
id: -123456789,
title: "Some Title",
type: "group",
all_members_are_administrators: true
},
...
Where you will find the chat id you need.