{"repo":"cvzi/telegram-bot-cloudflare","free":true,"listed":false,"github":"https://github.com/cvzi/telegram-bot-cloudflare","clone":"git clone https://github.com/cvzi/telegram-bot-cloudflare.git","description":"A minimal example of a Telegram Bot on Cloudflare Workers","language":"JavaScript","stars":486,"topics":["cf-worker","cloudflare-worker","cloudflare-workers","minimal","minimal-example","telegram","telegram-bot","bot-template"],"license":"CC0-1.0","category":"chat-messaging","readme_excerpt":"Telegram Bot on Cloudflare Workers A minimal example of a Telegram Bot running on a Cloudflare Worker. Setup: 1. Get your new bot token from @BotFather: https://core.telegram.org/bots#6-botfather 2. Sign up to Cloudflare Workers: https://workers.cloudflare.com/ 3. In the Cloudflare Dashboard go to \"Workers\", then click \"Create application\" and then \"Create worker\" 4. Choose a name and click \"Deploy\" to create the worker 5. Click on \"Configure worker\" - \"Settings\" - \"Variables\" 6. Add a new variable with the name ENV BOT TOKEN and the value of your bot token from @BotFather 7. Add a new variable with the name ENV BOT SECRET and set the value to a random secret. See https://core.telegram.org/bots/api#setwebhook 8. Click on \"Quick Edit\" to change the source code of your new worker 9. Copy and paste the code from bot.js into the editor 10. Optional: Change the WEBHOOK variable to a different path. See https://core.telegram.org/bots/api#setwebhook 11. Click on \"Save and Deploy\" 12. In the middle panel append /registerWebhook to the url. For example: https://my-worker-123.username.workers.dev/registerWebhook 13. Click \"Send\". In the right panel should appear Ok . If 401 Unauthorized appears, you may have used a wrong bot token. 14. That's it, now you can send a text message to your Telegram bot Bot behaviour The bot will send the original message back with Echo: prepended. If you want to change it, look at the function onMessage() . It receives a Message object and sends a text bac","default_branch":null,"files":null,"tree":[],"storefront":"/r/cvzi","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/cvzi/telegram-bot-cloudflare/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}