diff --git a/examples/honc-telegram-bot/.dev.vars.example b/examples/honc-telegram-bot/.dev.vars.example index ce8189276..a90fe6470 100644 --- a/examples/honc-telegram-bot/.dev.vars.example +++ b/examples/honc-telegram-bot/.dev.vars.example @@ -1 +1,2 @@ +TELEGRAM_API_TOKEN= DATABASE_URL= diff --git a/examples/honc-telegram-bot/README.md b/examples/honc-telegram-bot/README.md index 21389e333..1cde31308 100644 --- a/examples/honc-telegram-bot/README.md +++ b/examples/honc-telegram-bot/README.md @@ -1,11 +1,35 @@ ## 🪿 Goose telegram bot -> TODO +This is a HONC app that allows you operate a telegram bot. -Need to set webhook for the bot. +### Setup -Which you can do by pinging running: +In telegram, go to the botfather and create a new bot. This will give you an api token. -```sh -https://api.telegram.org/bot/setWebhook?url= -``` \ No newline at end of file +Set this in the `.dev.vars` file as `TELEGRAM_API_TOKEN`. + +Next, you need to set webhook for the bot. + +You can do this in the Studio UI! + +Add a custom route to the Honc app: + +``` +POST https://api.telegram.org/:botIdToken/setWebhook +``` + +Then fill in the url param for `:botIdToken` with the word "bot" concatenated with your api token. + +``` +botMYAPIKEY +``` + +Finally, make a post request with the body: + +```json +{ + "url": "https://webhonc.mies.workers.dev/_YOUR_WEBHONC_ID/webhook" +} +``` + +You should be good to go!