halbot 1989.6.6 → 1989.6.8
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 +65 -0
- package/index.mjs +1 -1
- package/package.json +2 -2
- package/config.json +0 -6
package/README.md
CHANGED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# 🤖️ halbot
|
|
2
|
+
|
|
3
|
+
[](./LICENSE)
|
|
4
|
+
[](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
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "halbot",
|
|
3
3
|
"description": "Just another ChatGPT/Bing Telegram bob.",
|
|
4
|
-
"version": "1989.6.
|
|
4
|
+
"version": "1989.6.8",
|
|
5
5
|
"private": false,
|
|
6
6
|
"homepage": "https://github.com/Leask/halbot",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"engines": {
|
|
9
9
|
"node": ">=18.x"
|
|
10
10
|
},
|
|
11
|
-
"main": "index.
|
|
11
|
+
"main": "index.mjs",
|
|
12
12
|
"bin": {
|
|
13
13
|
"halbot": "bin/halbot.mjs"
|
|
14
14
|
},
|