Netlify Functions for Hermes, the Kleros Messenger. A god who delivers jury duty summons sent from the Kleros Court.
netlify login
...
# if site already exists
netlify link
...
# if site doesn't exist
netlify init
...
yarn dev
curl -s -X POST http://localhost:8888/.netlify/functions/update -H "Accept: application/json" -H "x-telegram-bot-api-secret-token: 123" -d '{"message": { "foo": "bar" }}'
- Sending a message to your bot on Telegram
- Visiting
https://api.telegram.org/bot${BOT_TOKEN}/getUpdates
, find the corresponding message and retrieve the chatId - Set the value to the environment variable
$NOTIFICATION_CHANNEL
Set this environment variable, if needed extrapolate $USER
$ export WEB_HOOK_URL=https://dev-$USER--kleros-tg-court-notifications.netlify.live/.netlify/functions/update
$ yarn bot-init
Setting multilang bot info . . .
setting bot name en Hermes | The Kleros Messenger
setting bot name fr Hermes | Le messager de Kleros
...
setting commands es
setting webhook
yarn dev --live dev-$USER
curl -s -X POST -H "Accept: application/json" https://dev-$USER--tg-court-functions.netlify.live/.netlify/functions/update -H "x-telegram-bot-api-secret-token: 123" -d '{"message": { "foo": "bar" }}'
Me:
/subscribe vitalik.eth
Bot:
Thank you! I will notify you when a dispute is created for this juror.