grammyjs / grammyjs/website

feat: `SetWebhookUtil` component

Open
#517 1 comment 2 reactions 0 assignees View on GitHub
chore help wanted
Dominant language
TypeScript
Stars
52
Forks
138
PR merge metrics
No merged PRs in 30d

Description

It would be awesome to have a tiny utility component which can be included in all the hosting guides which require a webhook to be set. While it is not hard for many users to correctly set the webhook URL using `curl` or other tools, some beginners struggle with understanding which URL to fetch.

It would be nice to have a small interactive component on the website which lets users paste their token and URL and then it will set the webhook for them. It could also get some neat information to validate the info:

1. Call `getMe` with the token to confirm the bot name
2. Pass the URL to the `URL` constructor to validate the URL
3. Display information from `getWebhookInfo` so that there is an easy way to confirm that things are working correctly
4. Provide a tooltip that explains that the bot token will never be used for anything else than setting for this component to function, and tell users to never give away their token to anyone, no matter how polite a website asks.
5. Have a link that opens the chat with the new bot in a new tab so that users can easily head over to Telegram when the webhook was set and the bot is working.
6. Perhaps have a second button to delete the webhook again? This might not be necessary, but it could be that it feels more natural to have it. Sometimes people feel the urge to clean up after themselves.
7. Perhaps store the token locally in the browser so that it persists across page loads? We must not do this if it feels shady, I don't want anyone to believe we store the token server-side (even though we will never do this)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.