Skip to content

indrasaputra/marys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Marys

Go Report Card Workflow Go Reference

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.

Owner

Indra Saputra

Usage

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.

How to Run

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

Deployment

Currently, this project is deployed in Google Cloud Functions. The deployment process definiton is stated and ruled in Github Actions.