A Telegram bot for sending reminders in group channels.
This bot makes reminders hard-coded, meaning channel members can't change them, allowing its use in untrusted group channels.
- Clone the repo
- Run
npm ci
- Run
cp .env.example .env
- Insert your telegram bot token into the
.env
file asTELEGRAM_TOKEN
. - Run
npm run deploy
. This runs the bot usingforever
. Learn more aboutforever
.
Your bot is now running and ready to configure.
- Add the bot to the desired group channel.
- Run
/start
on the bot (in group channels, use/start@bot_username
). The bot tells you your chat's ID. - Insert the chat id as
PR_CHAT_ID
into the.env
file. - Run
npm run deploy:restart
to restart the bot with the chat ID enabled.
The bot is now active and will send reminders as configured in the reminders.js
file.
You can set up the reminders in the reminders.js
file. It consists of an array of objects that each contain a cron
field (the CRON expression) and a message
field (the message that gets sent on the CRON schedule) as well as an array of the chat IDs the reminder gets sent to.
Update the file (you can use the web tool CronTab to build your CRON expression) and set the message that should get sent. After that, just run npm run deploy:restart
and the new reminder gets used.
Essentially the same as the deployment workflow (clone the repo, install dependencies with npm ci
, create the .env
and insert the TELEGRAM_TOKEN
). But instead of running npm run deploy
, use npm start
during development for easier debugging capabilities.