Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/codebam/cf-workers-telegram-bot
Telegram Bot library for CloudFlare Workers
https://github.com/codebam/cf-workers-telegram-bot
ai cloudflare llama2 llama3 mistral telegram webhook worker
Last synced: 3 days ago
JSON representation
Telegram Bot library for CloudFlare Workers
- Host: GitHub
- URL: https://github.com/codebam/cf-workers-telegram-bot
- Owner: codebam
- License: apache-2.0
- Fork: true (nikhiljohn10/telegram-bot-worker)
- Created: 2022-02-16T01:45:00.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-10-28T04:51:19.000Z (3 months ago)
- Last Synced: 2024-10-29T09:06:01.419Z (3 months ago)
- Topics: ai, cloudflare, llama2, llama3, mistral, telegram, webhook, worker
- Language: TypeScript
- Homepage: https://t.me/TuxRobot
- Size: 5.41 MB
- Stars: 239
- Watchers: 2
- Forks: 208
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
CF Workers Telegram Bot
Docs
Wiki![screenshot of cf-workers-telegram-bot](https://raw.githubusercontent.com/codebam/cf-workers-telegram-bot/master/assets/screenshot.png)
```sh
npm i @codebam/cf-workers-telegram-bot
```See [cwtb-consumer](https://github.com/codebam/cwtb-consumer) for an example of what a bot might look like. Just import from `@codebam/cf-workers-telegram-bot`.
See [my blog post](https://seanbehan.ca/posts/cf-workers-telegram-bot) for a more in-depth guide for how to set up a bot.
- `npm create cloudflare@latest`
- `npx wrangler login`
- `npx wrangler secret put SECRET_TELEGRAM_API_TOKEN`, set it to your telegram bot token that you got from `@BotFather`
- `npx wrangler deploy`
- Open this url in your browser to set your webhook `https://your-worker.username.workers.dev/SECRET_TELEGRAM_API_TOKEN?command=set`To set up GitHub actions to deploy when you push, see https://github.com/cloudflare/wrangler-action
---
These instructions are for if you want to deploy a copy of the bot along with
the library. Such as if you need extra API requests that haven't been
implemented yet.[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/codebam/cf-workers-telegram-bot)
- Click the deploy button
- Navigate to your new **GitHub repository > Settings > Secrets** and add the following secrets:```yaml
- Name: CLOUDFLARE_API_TOKEN (should be added automatically)
- Name: CLOUDFLARE_ACCOUNT_ID (should be added automatically)- Name: SECRET_TELEGRAM_API_TOKEN
- Value: your-telegram-bot-token
```- Push to `master` to trigger a deploy