-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
31 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
TELEGRAM_API_TOKEN= | ||
DATABASE_URL= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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! |