bot-base / telegram-bot-template

Telegram bot template based on grammY
294 stars 46 forks source link

Offer secret-generating command #550

Closed mrienstra closed 1 month ago

mrienstra commented 1 month ago

Would be convenient when running through setup to see a quick way to generate a new secret for the webhook (X-Telegram-Bot-Api-Secret-Token, AKA secret_token, botWebhookSecret, or BOT_WEBHOOK_SECRET).

E.g. in these instructions (code): https://github.com/bot-base/telegram-bot-template/tree/deploy/vercel#usage

These seem like solid options, but surely there are others (and I'm not an expert on security, so don't take my word for it!):

node -e "console.log(crypto.randomBytes(256*0.75).toString('base64url'))"
python3 -c "import secrets; print(secrets.token_urlsafe(256))"
deptyped commented 1 month ago

Great idea, thanks! Added.