halbot 1990.1.38 → 1990.1.40

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 +58 -14
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -20,11 +20,14 @@ alt="Halbot live demo" width="240" height="180" border="10" /></a>
20
20
 
21
21
  ## Features
22
22
 
23
- - Telegram Bot (`Telegram Bot` token required)
24
- - ChatGPT (`OpenAI` API key required)
25
- - Bing Chat (`Bing Chat` user token required)
23
+ - [Telegram](https://telegram.org/) Bot (`Telegram Bot` token required)
24
+ - [ChatGPT]https://openai.com/blog/chatgpt) (`OpenAI` API key required)
25
+ - [Bing Chat](https://www.bing.com/) (`Bing Chat` user token required)
26
26
  - Speech-to-text (`Google Cloud` API key required, or your own engine)
27
27
  - Text-to-speech (`Google Cloud` API key required, or your own engine)
28
+ - OCR/OBJECT_DETECT (`Google Cloud` API key required, or your own engine)
29
+ - Feeding webpage and [YouTube](https://www.youtube.com/) to enhance your prompt
30
+ - Custom prompt and [🧠 Awesome ChatGPT Prompts](https://github.com/f/awesome-chatgpt-prompts) at your fingertips
28
31
  - Support `private` and `public` mode, with multiple authenticate methods.
29
32
  - `Middleware` style workflow, easy to extend.
30
33
  - Realtime stream-style response, no more waiting.
@@ -66,7 +69,7 @@ All supported configuration fields:
66
69
  "bingToken": "[[Bing Usertoken from cookies]]",
67
70
 
68
71
  // OPTIONAL, string.
69
- // Set this field if you need TTS/STT features.
72
+ // Set this field if you need TTS/STT/OCR/OBJECT_DETECT features.
70
73
  "googleApiKey": "[[Google Cloud API Key]]",
71
74
 
72
75
  // OPTIONAL, undefined || array of string.
@@ -90,23 +93,32 @@ All supported configuration fields:
90
93
  // Adding 'group' or 'channel' may cause too much disturbance.
91
94
  "chatType": ["mention", "private"],
92
95
 
96
+ // OPTIONAL, string.
97
+ "hello": "[[initial prompt]]",
98
+
99
+ // OPTIONAL, string.
100
+ "info": "[[bot description]]",
101
+
102
+ // OPTIONAL, string.
103
+ "help": "[[help information]]",
104
+
93
105
  // OPTIONAL, object.
94
106
  // Session storage, support MariaDB/MySQL and Redis for now.
95
107
  // If omitted, the bot will use memory storage and sync to this file.
96
108
  // Example: (Compatibility: https://github.com/sidorares/node-mysql2)
97
109
  "session": {
98
- type: [['MARIADB' || 'MYSQL']],
99
- host: [[DATABASE HOST]],
100
- database: [[DATABASE NAME]],
101
- user: [[DATABASE USER]],
102
- password: [[DATABASE PASSWORD]],
110
+ "type": "[["MARIADB" || "MYSQL"]]",
111
+ "host": "[[DATABASE HOST]]",
112
+ "database": "[[DATABASE NAME]]",
113
+ "user": "[[DATABASE USER]]",
114
+ "password": "[[DATABASE PASSWORD]]",
103
115
  ...[[OTHER DATABASE OPTIONS]],
104
116
  },
105
117
  // OR: (Compatibility: https://github.com/luin/ioredis)
106
118
  "session": {
107
- type: 'REDIS',
108
- host: [[REDIS HOST]],
109
- password: [[REDIS PASSWORD]],
119
+ "type": "REDIS",
120
+ "host": "[[REDIS HOST]]",
121
+ "password": "[[REDIS PASSWORD]]",
110
122
  ...[[OTHER REDIS OPTIONS]],
111
123
  },
112
124
 
@@ -159,8 +171,14 @@ const config = {
159
171
  // OPTIONAL, object.
160
172
  // Your own speech-to-text and text-to-speech engine.
161
173
  speech: {
162
- stt: [[sttClient]],
163
- tts: [[ttsClient]],
174
+ stt: [[stt api]],
175
+ tts: [[tts api]],
176
+ },
177
+
178
+ // OPTIONAL, object.
179
+ // Your own computer-vision engine.
180
+ vision {
181
+ see: [[ocr/object_detect api]]
164
182
  },
165
183
 
166
184
  // OPTIONAL, string.
@@ -188,6 +206,32 @@ const config = {
188
206
  set: async (key, session) => { /* save session object by chatId. */ },
189
207
  },
190
208
 
209
+ // OPTIONAL, object.
210
+ // Adding extra commands.
211
+ cmds: {
212
+ [[commandA]]: [[descriptionA]],
213
+ [[commandB]]: [[descriptionB]],
214
+ ...[[OTHER COMMANDS]],
215
+ },
216
+
217
+ // OPTIONAL, object.
218
+ // Adding extra configurations
219
+ args: {
220
+ [[argA]]: {
221
+ type: 'string',
222
+ short: [[short cut]],
223
+ default: [[default value]],
224
+ desc: [[description]],
225
+ },
226
+ [[argB]]: {
227
+ type: 'binary',
228
+ short: [[short cut]],
229
+ default: [[default value]],
230
+ desc: [[description]],
231
+ },
232
+ ...[[OTHER ARGS]],
233
+ },
234
+
191
235
  };
192
236
 
193
237
  await halbot(config);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "halbot",
3
3
  "description": "Just another ChatGPT/Bing Chat Telegram bob, which is simple design, easy to use, extendable and fun.",
4
- "version": "1990.1.38",
4
+ "version": "1990.1.40",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/halbot",
7
7
  "type": "module",
@@ -39,7 +39,7 @@
39
39
  "jsdom": "^21.1.1",
40
40
  "mysql2": "^3.2.0",
41
41
  "telegraf": "^4.12.2",
42
- "utilitas": "^1993.3.33",
42
+ "utilitas": "^1993.3.35",
43
43
  "youtube-transcript": "^1.0.5"
44
44
  }
45
45
  }