Skip to content

BuidlGuidl/ens-pg-admin-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ENS PG Telegram Bot

A Telegram bot that sends notifications when new grants are created or new stages are submitted, triggered via webhooks.

Setup

  1. Copy .env.example to .env and fill in your values:

    • Get a Telegram bot token from @BotFather
    • Create a channel and add the bot as an admin
    • Get your channel ID (checkout this instructions)
    • Set a secure webhook secret
    • Choose your port (default: 8080)
  2. Install dependencies:

yarn install
  1. start dev server:
yarn dev
  1. Use ngrok to expose your local server to the internet:
ngrok http http://localhost:8080

API Endpoints

POST /webhook/grant

Notify about a new grant creation.

Headers:

Content-Type: application/json
X-Webhook-Secret: your_secret_here

Body example:

{
  "id": 1,
  "grantNumber": 1,
  "title": "My Grant",
  "description": "Description...",
  "milestones": "Milestones...",
  "requestedFunds": "1000000000000000000",
  "github": "https://github.com/...",
  "email": "[email protected]",
  "builderAddress": "0x..."
}

POST /webhook/stage

Notify about a new stage creation.

Headers:

Content-Type: application/json
X-Webhook-Secret: your_secret_here

Body example:

{
  "id": 1,
  "stageNumber": 1,
  "milestone": "First milestone",
  "grantId": 1,
  "status": "proposed",
  "grant": {
    "id": 1,
    "title": "My Grant",
    ...
  }
}

About

Bot to notify about new grants and stage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published