Setup Telegram
Last updated
Was this helpful?
Last updated
Was this helpful?
Users can setup Telegram to receive notifications. This is a bit tricky to set up from an instance's administration point of view if you want to test locally.
First of all, you need to setup a Telegram bot to be able to receive notifications. Then you need to configure Monica with the right .env variables. Finally, you need to send the webhook URL to Telegram so Telegram can communicate with your local setup.
Follow the first steps described in so you can create a bot. Note that you will need the token that Telegram will send you right after creating your bot.
Locate the .env file and fill these three variables that are about Telegram.
The bot token is given by Telegram after you create the bot.
The bot URL is the URL of your bot. It's derivated from the name of your bot (for us, it's monicahq_bot
), prefixed by https://t.me/
. The name of your bot is the username that you've chosen upon the creation of your bot.
The webhook URL is not an URL per se. It's a random string, as long as possible, that will be used to sign the webhooks sent by Telegram. You have to defined it yourself.
We now need to inform Telegram which webhook URL it should use to send notifications.
The structure of the webhook URL should be as follow
Let's assume your public URL is https://app.monicahq.com (our instance). If we take this URL and the .env variables set above, the webhook URL will be:
Now, we need to inform Telegram of this webhook URL. Telegram needs this structure:
In our case, we would have this URL
Simply copy and paste the URL above in your browser and Telegram should send you this JSON back.
That means your URL is registered, and Telegram will work.