nicolasdanelon / my-tiny-bot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Preparation

  1. Create a project on Deno Deploy.
  2. Set the BOT_TOKEN variable to your token (this can be done in project’s settings).
  3. 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>

https://api.telegram.org/bot5993377175:AAHeqM4u-zh0DcG3dPb3-s2E4QeSX1v2c5U/setWebhook?url=https://my-tiny-bot.deno.dev/5993377175:AAHeqM4u-zh0DcG3dPb3-s2E4QeSX1v2c5U


Deploying with GitHub (easy)

  1. Push your project to a GitHub repository.
  2. Set up GitHub Integration in the project’s settings. Select server.ts as entry point.
  3. You’re done! New versions will be automatically deployed on push.

Deploying with deployctl (advanced)

  1. Install deployctl
  2. Create a new access token. Save it somewhere
  3. Run this command to deploy: deployctl deploy --project <PROJECT_NAME> ./server.ts --prod --token <ACCESS_TOKEN>

Running the bot locally

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.

About


Languages

Language:TypeScript 100.0%