You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/main/README.md
+34-26Lines changed: 34 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,47 @@
1
-
# cf-workers-telegram-bot
2
-
3
-
[](https://deploy.workers.cloudflare.com/?url=https://github.com/codebam/cf-workers-telegram-bot)

6
23
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
-
12
24
```sh
13
25
npm i @codebam/cf-workers-telegram-bot
14
26
```
15
27
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
17
37
18
38
---
19
39
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
+
[](https://deploy.workers.cloudflare.com/?url=https://github.com/codebam/cf-workers-telegram-bot)
21
45
22
46
- Click the deploy button
23
47
- Navigate to your new **GitHub repository > Settings > Secrets** and add the following secrets:
@@ -31,19 +55,3 @@ To use the deploy button:
31
55
```
32
56
33
57
- 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
0 commit comments