halbot 1989.6.5 → 1989.6.7

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.
package/README.md CHANGED
@@ -0,0 +1,65 @@
1
+ # 🤖️ halbot
2
+
3
+ [![MIT licensed](https://img.shields.io/badge/license-MIT-blue)](./LICENSE)
4
+ [![Node.js Package](https://github.com/Leask/halbot/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/Leask/halbot/actions/workflows/npm-publish.yml)
5
+
6
+ Just another `ChatGPT`/`Bing Chat` Telegram bob, which is simple design, easy to use, extendable and fun.
7
+
8
+ Features
9
+
10
+ - Telegram Bot (`Telegram Bot` token required)
11
+ - ChatGPT (`OpenAI` API key required)
12
+ - Bing Chat (`Bing Chat` user token required)
13
+ - Speech-to-text (`Google Cloud` API key required)
14
+ - Text-to-speech (`Google Cloud` API key required)
15
+
16
+ ## How to use
17
+
18
+ Make the `halbot` json config file and put it in this path `~/.halbot.json`:
19
+
20
+ ```json
21
+ {
22
+ // REQUIRED, string.
23
+ "telegramToken": "[[Telegram Bot API Token]]",
24
+ // OPTIONAL, string.
25
+ // One of the chatGptKey or bingToken is required.
26
+ "chatGptKey": "[[ChatGPT API Key]]",
27
+ // OPTIONAL, string.
28
+ // One of the chatGptKey or bingToken is required.
29
+ "bingToken": "[[Bing Usertoken from cookies]]",
30
+ // OPTIONAL, string.
31
+ // Set this field if you need TTS/STT features.
32
+ "googleApiKey": "[[Google Cloud API Key]]",
33
+ // OPTIONAL, undefined || array of string.
34
+ // To open the bot to PUBLIC, DO NOT set this field;
35
+ // To restrict the bot to PRIVATE, set chat/group/channel ids in this array.
36
+ "private": ["[[CHAT_ID]]", "[[GROUP_ID]]", "[[CHANNEL_ID]]", ...],
37
+ // OPTIONAL, string.
38
+ // Use a HOME GROUP to authentication users.
39
+ // Anyone in this group can access the bot.
40
+ "homeGroup": "[[GROUP_ID]]",
41
+ // OPTIONAL, array of enum string.
42
+ // Enum: 'private', 'mention', 'group', 'channel'.
43
+ // Defaule: ['private', 'mention'].
44
+ // By default, it will only reply to `private` chats and group `mention`s.
45
+ // Adding 'group' or 'channel' may cause too much disturbance.
46
+ "chatType": ["mention", "private"]
47
+ }
48
+ ```
49
+
50
+ Then, run the bot:
51
+
52
+ ```bash
53
+ $ npx halbot
54
+ ```
55
+
56
+ ## Integrate to your project
57
+
58
+ ```bash
59
+ $ npm i halbot
60
+ ```
61
+
62
+ ```js
63
+ const { halbot } = require('halbot');
64
+
65
+ ```
package/index.mjs CHANGED
@@ -33,4 +33,4 @@ const init = async (options) => {
33
33
  };
34
34
 
35
35
  export default init;
36
- export { bot, hal, speech, utilitas };
36
+ export { bot, hal, init, speech, utilitas };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "halbot",
3
3
  "description": "Just another ChatGPT/Bing Telegram bob.",
4
- "version": "1989.6.5",
4
+ "version": "1989.6.7",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/halbot",
7
7
  "type": "module",
@@ -33,7 +33,7 @@
33
33
  "@google-cloud/text-to-speech": "^4.2.1",
34
34
  "@waylaidwanderer/chatgpt-api": "^1.28.10",
35
35
  "telegraf": "^4.12.2",
36
- "utilitas": "^1992.3.42"
36
+ "utilitas": "^1992.3.43"
37
37
  },
38
38
  "devDependencies": {}
39
39
  }
package/config.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "telegramToken": "// Telegram Bot API Token",
3
- "chatGptKey": "// ChatGPT API Key",
4
- "bingToken": "// Bing Usertoken from cookies",
5
- "googleApiKey": "// Google Cloud API Key"
6
- }