@codebam/cf-workers-telegram-bot 6.1.0 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +18 -6
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,12 +1,20 @@
1
1
  # cf-workers-telegram-bot
2
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)
4
+
5
+ ![screenshot of cf-workers-telegram-bot](/screenshot.png)
6
+
3
7
  serverless telegram bot on cf workers
4
8
 
5
9
  The original `worker.js` is the content of Nikhil John's
6
10
  https://github.com/nikhiljohn10/telegram-bot-worker which is licensed with MIT.
7
11
  My modifications are licensed under the Apache license.
8
12
 
9
- [![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/codebam/cf-workers-telegram-bot)
13
+ The first bot configuration is fully featured, and responds to all received
14
+ messages with llama2 if a command isn't found.
15
+
16
+ To get continuous conversation with llama2 working make sure you add a database
17
+ to your wrangler.toml and initailize it with the schema.sql
10
18
 
11
19
  To use the deploy button:
12
20
 
@@ -14,8 +22,8 @@ To use the deploy button:
14
22
  - Navigate to your new **GitHub repository > Settings > Secrets** and add the following secrets:
15
23
 
16
24
  ```yaml
17
- - Name: CF_API_TOKEN (should be added automatically)
18
- - Name: CF_ACCOUNT_ID (should be added automatically)
25
+ - Name: CLOUDFLARE_API_TOKEN (should be added automatically)
26
+ - Name: CLOUDFLARE_ACCOUNT_ID (should be added automatically)
19
27
 
20
28
  - Name: SECRET_TELEGRAM_API_TOKEN
21
29
  - Value: your-telegram-bot-token
@@ -26,9 +34,13 @@ To use the deploy button:
26
34
  To fork this repo and use wrangler:
27
35
 
28
36
  - Click fork
37
+ - `npm i -g wrangler`
29
38
  - `wrangler secret put SECRET_TELEGRAM_API_TOKEN` and set it to your telegram
30
39
  bot token
31
- - `wrangler publish`
40
+ - `wrangler d1 create llama2`
41
+ - put the database block from the command in your wrangler.toml
42
+ - `wrangler d1 execute --remote llama2 --file ./schema.sql`
43
+ - `wrangler deploy`
32
44
  - Done!
33
45
 
34
46
  ## Getting started with cf-workers-telegram-bot
@@ -36,10 +48,10 @@ To fork this repo and use wrangler:
36
48
  Once you've deployed the bot you can get your Webhook command URL by doing any
37
49
  of the following.
38
50
 
39
- - sha256sum(YourTelegramSecretKey) is the path to your webhook commands and
51
+ - sha256sum(SECRET_TELEGRAM_API_TOKEN) is the path to your webhook commands and
40
52
  should be put at the end of your worker URL to access commands such as
41
53
  setting your webhook
42
- - Use `sha256sum <<< "your secret key"` to get the path
54
+ - Use `echo -n yoursecretkey | sha256sum` to get the path
43
55
  - Open the Cloudflare Worker Logs under **Workers &gt; cf-workers-telegram-bot
44
56
  &gt; Logs &gt; Begin log stream** and make a GET request (open it in your browser)
45
57
  to your Worker URL and look at the logs to see your Access URL
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebam/cf-workers-telegram-bot",
3
- "version": "6.1.0",
3
+ "version": "6.2.0",
4
4
  "description": "serverless telegram bot on cf workers",
5
5
  "main": "./dist/main/src/main.js",
6
6
  "module": "./dist/main/src/main.js",
@@ -41,5 +41,5 @@
41
41
  "typescript": "^5.4.5",
42
42
  "typescript-eslint": "^7.8.0"
43
43
  },
44
- "gitHead": "0f3db27086c56ef9d50370c217ed09b5d5b3d401"
44
+ "gitHead": "cf3c23508164f91e2050ff87c59053ca86548f9b"
45
45
  }