Marys is a webhook to send message or notification to Telegram. Marys is derived from one of One Piece character: The Marys. Its main purpose is currently as a notifier service for my personal projects.
Send a POST request to the Marys endpoint. For example, the endpoint is http://localhost:8080/notifications
, then send this JSON to the endpoint:
{
"sender": "Indra",
"message": "Service X has been down for the last 5 minutes"
}
sender
and message
are required.
Since this project depends on Telegram, so we need to get ChatID (it can be channel, group, or personal message).
This repository also provides main.go
that can be run in development.
$ TELEGRAM_RECIPIENT_ID=<chat-id> \
TELEGRAM_TOKEN=<telegram-bot-token> \
TELEGRAM_URL=https://api.telegram.org/bot \
PORT=8080 \
go run cmd/api/main.go
Currently, this project is deployed in Google Cloud Functions. The deployment process definiton is stated and ruled in Github Actions.