Giter Site home page Giter Site logo

mortezahtgamer / cf-workers-telegram-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codebam/cf-workers-telegram-bot

1.0 0.0 0.0 2.1 MB

Serverless Telegram Bot on CloudFlare Workers

Home Page: https://t.me/TuxRobot

License: Apache License 2.0

TypeScript 98.16% Makefile 1.84%

cf-workers-telegram-bot's Introduction

cf-workers-telegram-bot

serverless telegram bot on cf workers

The original worker.js is the content of Nikhil John's https://github.com/nikhiljohn10/telegram-bot-worker which is licensed with MIT. My modifications are licensed under the Apache license.

Deploy to Cloudflare Workers

To use the deploy button:

  • Click the deploy button

  • Navigate to your new GitHub repository > Settings > Secrets and add the following secrets:

    - Name: CF_API_TOKEN (should be added automatically)
    - Name: CF_ACCOUNT_ID (should be added automatically)
    
    - Name: SECRET_TELEGRAM_API_TOKEN
    - Value: your-telegram-bot-token
  • Push to master to trigger a deploy

To fork this repo and use wrangler:

  • Click fork
  • wrangler secret put SECRET_TELEGRAM_API_TOKEN and set it to your telegram bot token
  • wrangler publish
  • Done!

Getting started with cf-workers-telegram-bot

Once you've deployed the bot you can get your Webhook command URL by doing any of the following.

  • sha256sum(YourTelegramSecretKey) is the path to your webhook commands and should be put at the end of your worker URL to access commands such as setting your webhook
  • Use sha256sum <<< "your secret key" to get the path
  • Open the Cloudflare Worker Logs under Workers > cf-workers-telegram-bot > Logs > Begin log stream and make a GET request (open it in your browser) to your Worker URL and look at the logs to see your Access URL
  • Run wrangler tail --format pretty from inside your git repository and make a GET request to your Worker URL

Example URL for setting the Webhook and dropping pending updates:

https://cf-workers-telegram-bot.codebam.workers.dev/a948904f2f0f479b8f8197694b30184b0d2ed1c1cd2a1ec0fb85d299a192a447?command=set

cf-workers-telegram-bot's People

Contributors

codebam avatar dependabot[bot] avatar github-actions[bot] avatar nikhiljohn10 avatar mortezahtgamer avatar chrisspiegl avatar

Stargazers

Meisam Maani avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.