Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/janikvonrotz/hydrome-bot
HydroMeBot is a Telegram bot that reminds you to water your plants.
https://github.com/janikvonrotz/hydrome-bot
Last synced: about 2 months ago
JSON representation
HydroMeBot is a Telegram bot that reminds you to water your plants.
- Host: GitHub
- URL: https://github.com/janikvonrotz/hydrome-bot
- Owner: janikvonrotz
- Created: 2020-01-07T19:12:38.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T04:56:07.000Z (about 2 years ago)
- Last Synced: 2024-04-17T01:46:11.607Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 828 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HydroMeBot
HydroMeBot is a Telegram bot that reminds you to water your plants. It runs as a serverless function on [Now](https://zeit.co/download), uses [RedisLabs](https://app.redislabs.com/) to store its state and utilizes [GitHub Actions](https://github.com/features/actions) to schedule reminders.
Telegram link: [t.me/HydroMeBot](https://t.me/HydroMeBot)
## Setup
Register a new Telegram bot with BotFather.
Create a RedisLabs database.
Clone this repo and rename it.
Create an `.env` file with these variables:
```
TELEGRAM_TOKEN=
REDIS_URI=redis://@:/0
```Export these variables to your current session.
`export $(cat .env | xargs)`
Set these variables as now secrets.
```
now secrets add hydrome_bot_telegram_token $TELEGRAM_TOKEN
now secrets add hydrome_bot_redis_uri $REDIS_URI
```Deploy with now.
`now --prod`
Then set the Telegram bot wehook with curl.
`curl https://api.telegram.org/bot$TELEGRAM_TOKEN/setWebhook?url=/api`
Test the bot by writing `/start`.
### GitHub Action
The `send-notifications.js` script is used by GitHub Action to schedule reminder notifications. See `.github/workflows/cron.yml` for details.
The runner authenticates with the Telegram token. In order to enable GitHub Action for your cloned repo you must add the Telegram token as a repo secret.
Further change the static url in `script/job-notifications.js`.
## Troubleshooting
Check status of the webhook.
`curl https://api.telegram.org/bot$TELEGRAM_TOKEN/getWebhookInfo`