A Telegram bot that sends notifications when new grants are created or new stages are submitted, triggered via webhooks.
-
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)
-
Install dependencies:
yarn install
- start dev server:
yarn dev
- Use ngrok to expose your local server to the internet:
ngrok http http://localhost:8080
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..."
}
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",
...
}
}