- Create a project on Deno Deploy.
- Set the
BOT_TOKEN
variable to your token (this can be done in project’s settings). - Set your bot’s webhook url to
https://<PROJECT_NAME>.deno.dev/<BOT_TOKEN>
(replacing<...>
with respective values). To do that, you can open the request URL in your browser:
https://api.telegram.org/bot<BOT_TOKEN>/setWebhook?url=https://<PROJECT_NAME>.deno.dev/<BOT_TOKEN>
- Push your project to a GitHub repository.
- Set up GitHub Integration in the project’s settings. Select
server.ts
as entry point. - You’re done! New versions will be automatically deployed on push.
- Install
deployctl
- Create a new access token. Save it somewhere
- Run this command to deploy:
deployctl deploy --project <PROJECT_NAME> ./server.ts --prod --token <ACCESS_TOKEN>
Use poll.ts
to run the bot locally for development. Note that it will delete
the webhook URL and you’ll need to repeat the 3rd step to be able to run the bot
on Deno Deploy.