Skip to content

Commit eddcb7c

Browse files
committed
update NPM readme
1 parent 7e48e0d commit eddcb7c

File tree

1 file changed

+34
-26
lines changed

1 file changed

+34
-26
lines changed

packages/main/README.md

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,47 @@
1-
# cf-workers-telegram-bot
2-
3-
[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/codebam/cf-workers-telegram-bot)
1+
<h3 align="center">
2+
<img src="https://raw.githubusercontent.com/codebam/cf-workers-telegram-bot/master/assets/logo.png" width="100" />
3+
<br/>
4+
CF workers telegram bot
5+
<br/>
6+
</h3>
7+
8+
<h6 align="center">
9+
<a href="https://github.com/codebam/cf-workers-telegram-bot/wiki">Wiki</a>
10+
·
11+
<a href="https://codebam.github.io/cf-workers-telegram-bot-docs/">Docs</a>
12+
</h6>
13+
14+
<p align="center">
15+
<a href="https://github.com/codebam/cf-workers-telegram-bot/stargazers"> <img src="https://img.shields.io/github/stars/codebam/cf-workers-telegram-bot?style=for-the-badge&logo=starship&color=111111&logoColor=ffffff&labelColor=000000" alt="GitHub stars"/></a>
16+
<a href="https://github.com/codebam/cf-workers-telegram-bot/issues">
17+
<img src="https://img.shields.io/github/issues/codebam/cf-workers-telegram-bot?style=for-the-badge&logo=gitbook&color=111111&logoColor=ffffff&labelColor=000000" alt="GitHub issues"/></a>
18+
<a href="https://github.com/codebam/cf-workers-telegram-bot"> <img src="https://img.shields.io/github/forks/codebam/cf-workers-telegram-bot?style=for-the-badge&logo=git&color=111111&logoColor=ffffff&labelColor=000000" alt="GitHub forks"/></a>
19+
<a href="https://www.npmjs.com/package/@codebam/cf-workers-telegram-bot"> <img src="https://img.shields.io/npm/v/@codebam/cf-workers-telegram-bot?style=for-the-badge&logo=npm&color=111111&logoColor=ffffff&labelColor=000000" alt="npm version" /></a>
20+
</p>
421

522
![screenshot of cf-workers-telegram-bot](/screenshot.png)
623

7-
serverless telegram bot on cf workers
8-
9-
To get continuous conversation with AI working make sure you add a database
10-
to your wrangler.toml and initailize it with the schema.sql
11-
1224
```sh
1325
npm i @codebam/cf-workers-telegram-bot
1426
```
1527

16-
See `worker.ts` and follow the instructions below.
28+
See `worker.ts` for an example of what a bot might look like. Just import from `@codebam/cf-workers-telegram-bot`.
29+
30+
- `npm create cloudflare@latest`
31+
- `npx wrangler login`
32+
- `npx wrangler secret put SECRET_TELEGRAM_API_TOKEN`, set it to your telegram bot token that you got from `@BotFather`
33+
- `npx wrangler deploy`
34+
- Open this url in your browser to set your webhook `https://your-worker.username.workers.dev/SECRET_TELEGRAM_API_TOKEN?command=set`
35+
36+
To set up GitHub actions to deploy when you push, see https://github.com/cloudflare/wrangler-action
1737

1838
---
1939

20-
To use the deploy button:
40+
These instructions are for if you want to deploy a copy of the bot along with
41+
the library. Such as if you need extra API requests that haven't been
42+
implemented yet.
43+
44+
[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/codebam/cf-workers-telegram-bot)
2145

2246
- Click the deploy button
2347
- Navigate to your new **GitHub repository &gt; Settings &gt; Secrets** and add the following secrets:
@@ -31,19 +55,3 @@ To use the deploy button:
3155
```
3256
3357
- Push to `master` to trigger a deploy
34-
35-
To fork this repo and use wrangler:
36-
37-
- Click fork
38-
- `npm i -g wrangler`
39-
- `wrangler secret put SECRET_TELEGRAM_API_TOKEN` and set it to your telegram
40-
bot token
41-
- `wrangler d1 create llama2`
42-
- put the database block from the command in your wrangler.toml
43-
- `wrangler d1 execute --remote llama2 --file ./schema.sql`
44-
- `wrangler deploy`
45-
- Done!
46-
47-
## Getting started with cf-workers-telegram-bot
48-
49-
Once you've deployed the bot you can get your Webhook command URL by calling `await bot.webhook.set()`

0 commit comments

Comments
 (0)