

GitHub - codebam/cf-workers-telegram-bot: Serverless Telegram Bot on CloudFlare...
source link: https://github.com/codebam/cf-workers-telegram-bot
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

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.
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 tokenwrangler 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
- Do a web search for sha256 calculator and paste your telegram secret key
- 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=setWebhook
Recommend
-
62
A few months ago we released a new way for people to run serverless Javascript called Cloudflare Workers. We believe Workers is the fastest way to execute serverless functions. If it is truely the fastest, and it...
-
40
Serverless is the new black. I mean everybody I know is moving to the serverless platforms or launching one. OK, maybe not everyone but Cloudflare is definitely moving in this direction with an audacious relatively new p...
-
7
Cloudflare Workers - the best serverless FaaS platform? Arek Nawo | 11 Mar 2021 | 7 min read When you hear the word “se...
-
7
-
27
Cloudflare Workers 转发 Telegram Bot 推送信息 在一些地区或者一些场景下访问 Telegram 会有难度,Cloudflare 虽说在一些地区速度也不理想,但总比没有强 将通知消息的标题和内容发送到 Cloudflare Workers 的边缘网络,然后 W...
-
5
☁️ What are Cloudflare Workers and Why use Them? We'll start this post on using Cloudflare Workers in Rust by taking a quick look at what workers are. Next we'll see why you might want to write Cloudflare Workers in Rust....
-
8
Create Serverless APIs using Cloudflare Workers, Durable Objects & Wrangler Features Easy routing & state management Basic JWT-based Auth (register, login, refresh token, dele...
-
10
al Posted on Feb 7...
-
6
Code is available on GitHub Telegram bots Telegram, one of the biggest messenger platform, offers a Bot API that allows third-party automation
-
8
I can't go a day (o...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK