Skip to content

Commit

Permalink
Update telegram bot readme
Browse files Browse the repository at this point in the history
  • Loading branch information
brettimus committed Dec 10, 2024
1 parent ee89c6d commit f85b0f2
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
1 change: 1 addition & 0 deletions examples/honc-telegram-bot/.dev.vars.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
TELEGRAM_API_TOKEN=
DATABASE_URL=
36 changes: 30 additions & 6 deletions examples/honc-telegram-bot/README.md
Original file line number Diff line number Diff line change
@@ -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<YOUR_BOT_TOKEN>/setWebhook?url=<YOUR_WEBHOOK_URL>
```
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!

0 comments on commit f85b0f2

Please sign in to comment.