@zhin.js/adapter-qq 1.0.17 → 1.0.18
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/CHANGELOG.md +9 -0
- package/lib/index.d.ts +23 -11
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +63 -39
- package/lib/index.js.map +1 -1
- package/package.json +3 -8
package/CHANGELOG.md
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -1,22 +1,30 @@
|
|
|
1
1
|
import { Bot, PrivateMessageEvent, GroupMessageEvent, ReceiverMode, ApplicationPlatform } from "qq-official-bot";
|
|
2
|
-
export { ReceiverMode
|
|
3
|
-
export type { ApplicationPlatform, Intent
|
|
4
|
-
import { Bot as ZhinBot, Adapter, Message, SendOptions } from "zhin.js";
|
|
5
|
-
declare module
|
|
2
|
+
export { ReceiverMode } from "qq-official-bot";
|
|
3
|
+
export type { ApplicationPlatform, Intent } from "qq-official-bot";
|
|
4
|
+
import { Bot as ZhinBot, Adapter, Plugin, Message, SendOptions } from "zhin.js";
|
|
5
|
+
declare module "zhin.js" {
|
|
6
|
+
namespace Plugin {
|
|
7
|
+
interface Contexts {
|
|
8
|
+
qq: QQAdapter;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
6
11
|
interface RegisteredAdapters {
|
|
7
|
-
qq:
|
|
12
|
+
qq: QQAdapter;
|
|
8
13
|
}
|
|
9
14
|
}
|
|
10
|
-
export type QQBotConfig<T extends ReceiverMode, M extends ApplicationPlatform = ApplicationPlatform> =
|
|
11
|
-
context:
|
|
12
|
-
name:
|
|
15
|
+
export type QQBotConfig<T extends ReceiverMode, M extends ApplicationPlatform = ApplicationPlatform> = Bot.Config<T, M> & {
|
|
16
|
+
context: "qq";
|
|
17
|
+
name: string;
|
|
18
|
+
data_dir?: string;
|
|
13
19
|
};
|
|
14
20
|
export interface QQBot<T extends ReceiverMode, M extends ApplicationPlatform = ApplicationPlatform> {
|
|
15
21
|
$config: QQBotConfig<T, M>;
|
|
16
22
|
}
|
|
17
|
-
export declare class QQBot<T extends ReceiverMode, M extends ApplicationPlatform = ApplicationPlatform> extends Bot implements ZhinBot<
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
export declare class QQBot<T extends ReceiverMode, M extends ApplicationPlatform = ApplicationPlatform> extends Bot implements ZhinBot<QQBotConfig<T, M>, PrivateMessageEvent | GroupMessageEvent> {
|
|
24
|
+
adapter: QQAdapter;
|
|
25
|
+
$connected: boolean;
|
|
26
|
+
get $id(): string;
|
|
27
|
+
constructor(adapter: QQAdapter, config: QQBotConfig<T, M>);
|
|
20
28
|
private handleQQMessage;
|
|
21
29
|
$connect(): Promise<void>;
|
|
22
30
|
$disconnect(): Promise<void>;
|
|
@@ -24,4 +32,8 @@ export declare class QQBot<T extends ReceiverMode, M extends ApplicationPlatform
|
|
|
24
32
|
$sendMessage(options: SendOptions): Promise<string>;
|
|
25
33
|
$recallMessage(id: string): Promise<void>;
|
|
26
34
|
}
|
|
35
|
+
declare class QQAdapter extends Adapter<QQBot<ReceiverMode>> {
|
|
36
|
+
constructor(plugin: Plugin);
|
|
37
|
+
createBot(config: QQBotConfig<ReceiverMode>): QQBot<ReceiverMode>;
|
|
38
|
+
}
|
|
27
39
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,EACH,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAC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WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;IA6BnD,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAUhD;AAED,cAAM,SAAU,SAAQ,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;gBACtC,MAAM,EAAE,MAAM;IAI1B,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC;CAGlE"}
|
package/lib/index.js
CHANGED
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
import { Bot } from "qq-official-bot";
|
|
1
|
+
import { Bot, } from "qq-official-bot";
|
|
2
2
|
import path from "path";
|
|
3
|
-
export { ReceiverMode
|
|
4
|
-
import { usePlugin, Adapter,
|
|
3
|
+
export { ReceiverMode } from "qq-official-bot";
|
|
4
|
+
import { usePlugin, Adapter, Message, segment, } from "zhin.js";
|
|
5
5
|
const plugin = usePlugin();
|
|
6
|
+
const { provide, useContext } = plugin;
|
|
6
7
|
export class QQBot extends Bot {
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
adapter;
|
|
9
|
+
$connected = false;
|
|
10
|
+
get $id() {
|
|
11
|
+
return this.$config.name;
|
|
12
|
+
}
|
|
13
|
+
constructor(adapter, config) {
|
|
9
14
|
if (!config.data_dir)
|
|
10
|
-
config.data_dir = path.join(process.cwd(),
|
|
15
|
+
config.data_dir = path.join(process.cwd(), "data");
|
|
11
16
|
super(config);
|
|
17
|
+
this.adapter = adapter;
|
|
12
18
|
this.$config = config;
|
|
13
19
|
}
|
|
14
20
|
handleQQMessage(msg) {
|
|
15
21
|
const message = this.$formatMessage(msg);
|
|
16
|
-
|
|
17
|
-
plugin.logger.
|
|
18
|
-
plugin.dispatch(`message.${message.$channel.type}.receive`, message);
|
|
22
|
+
this.adapter.emit("message.receive", message);
|
|
23
|
+
plugin.logger.debug(`${this.$config.name} recv ${message.$channel.type}(${message.$channel.id}):${segment.raw(message.$content)}`);
|
|
19
24
|
}
|
|
20
25
|
async $connect() {
|
|
21
|
-
this.on(
|
|
22
|
-
this.on(
|
|
23
|
-
this.on(
|
|
26
|
+
this.on("message.group", this.handleQQMessage.bind(this));
|
|
27
|
+
this.on("message.guild", this.handleQQMessage.bind(this));
|
|
28
|
+
this.on("message.private", this.handleQQMessage.bind(this));
|
|
24
29
|
await this.start();
|
|
25
30
|
this.$connected = true;
|
|
26
31
|
}
|
|
@@ -30,15 +35,15 @@ export class QQBot extends Bot {
|
|
|
30
35
|
}
|
|
31
36
|
$formatMessage(msg) {
|
|
32
37
|
let target_id = msg.user_id;
|
|
33
|
-
if (msg.message_type ===
|
|
38
|
+
if (msg.message_type === "guild")
|
|
34
39
|
target_id = msg.channel_id;
|
|
35
|
-
if (msg.message_type ===
|
|
40
|
+
if (msg.message_type === "group")
|
|
36
41
|
target_id = msg.group_id;
|
|
37
|
-
if (msg.sub_type ===
|
|
42
|
+
if (msg.sub_type === "direct")
|
|
38
43
|
target_id = `direct:${msg.guild_id}`;
|
|
39
44
|
const result = Message.from(msg, {
|
|
40
45
|
$id: msg.message_id?.toString(),
|
|
41
|
-
$adapter:
|
|
46
|
+
$adapter: "qq",
|
|
42
47
|
$bot: this.$config.name,
|
|
43
48
|
$sender: {
|
|
44
49
|
id: msg.sender.user_id?.toString(),
|
|
@@ -46,7 +51,7 @@ export class QQBot extends Bot {
|
|
|
46
51
|
},
|
|
47
52
|
$channel: {
|
|
48
53
|
id: target_id,
|
|
49
|
-
type: msg.message_type ===
|
|
54
|
+
type: msg.message_type === "guild" ? "channel" : msg.message_type,
|
|
50
55
|
},
|
|
51
56
|
$content: msg.message,
|
|
52
57
|
$raw: msg.raw_message,
|
|
@@ -58,45 +63,41 @@ export class QQBot extends Bot {
|
|
|
58
63
|
if (!Array.isArray(content))
|
|
59
64
|
content = [content];
|
|
60
65
|
if (quote)
|
|
61
|
-
content.unshift({ type:
|
|
66
|
+
content.unshift({ type: "reply", data: { id: typeof quote === "boolean" ? result.$id : quote } });
|
|
62
67
|
return await this.$sendMessage({
|
|
63
68
|
...result.$channel,
|
|
64
|
-
context:
|
|
69
|
+
context: "qq",
|
|
65
70
|
bot: this.$config.name,
|
|
66
|
-
content
|
|
71
|
+
content,
|
|
67
72
|
});
|
|
68
|
-
}
|
|
73
|
+
},
|
|
69
74
|
});
|
|
70
75
|
return result;
|
|
71
76
|
}
|
|
72
77
|
async $sendMessage(options) {
|
|
73
|
-
options = await plugin.app.handleBeforeSend(options);
|
|
74
78
|
switch (options.type) {
|
|
75
|
-
case
|
|
76
|
-
if (options.id.startsWith(
|
|
77
|
-
const id = options.id.replace(
|
|
79
|
+
case "private": {
|
|
80
|
+
if (options.id.startsWith("direct:")) {
|
|
81
|
+
const id = options.id.replace("direct:", "");
|
|
78
82
|
const result = await this.sendDirectMessage(id, options.content);
|
|
79
|
-
plugin.logger.
|
|
83
|
+
plugin.logger.debug(`${this.$config.name} send ${options.type}(${options.id}):${segment.raw(options.content)}`);
|
|
80
84
|
return `direct-${options.id}:${result.message_id.toString()}`;
|
|
81
85
|
}
|
|
82
86
|
else {
|
|
83
87
|
const result = await this.sendPrivateMessage(options.id, options.content);
|
|
84
|
-
plugin.logger.
|
|
88
|
+
plugin.logger.debug(`${this.$config.name} send ${options.type}(${options.id}):${segment.raw(options.content)}`);
|
|
85
89
|
return `private-${options.id}:${result.message_id.toString()}`;
|
|
86
90
|
}
|
|
87
|
-
break;
|
|
88
91
|
}
|
|
89
92
|
case "group": {
|
|
90
93
|
const result = await this.sendGroupMessage(options.id, options.content);
|
|
91
|
-
plugin.logger.
|
|
94
|
+
plugin.logger.debug(`${this.$config.name} send ${options.type}(${options.id}):${segment.raw(options.content)}`);
|
|
92
95
|
return `group-${options.id}:${result.message_id.toString()}`;
|
|
93
|
-
break;
|
|
94
96
|
}
|
|
95
|
-
case
|
|
97
|
+
case "channel": {
|
|
96
98
|
const result = await this.sendGuildMessage(options.id, options.content);
|
|
97
|
-
plugin.logger.
|
|
99
|
+
plugin.logger.debug(`${this.$config.name} send ${options.type}(${options.id}):${segment.raw(options.content)}`);
|
|
98
100
|
return `channel-${options.id}:${result.message_id.toString()}`;
|
|
99
|
-
break;
|
|
100
101
|
}
|
|
101
102
|
default:
|
|
102
103
|
throw new Error(`unsupported channel type ${options.type}`);
|
|
@@ -105,16 +106,39 @@ export class QQBot extends Bot {
|
|
|
105
106
|
async $recallMessage(id) {
|
|
106
107
|
if (!/^(private|group|channel|direct)-([^\:]+):(.+)$/.test(id))
|
|
107
108
|
throw new Error(`invalid message id ${id}`);
|
|
108
|
-
const
|
|
109
|
-
if (
|
|
109
|
+
const match = id.match(/^(private|group|channel|direct)-([^\:]+):(.+)$/);
|
|
110
|
+
if (!match)
|
|
111
|
+
return;
|
|
112
|
+
const [, target_type, target_id, message_id] = match;
|
|
113
|
+
if (target_type === "private")
|
|
110
114
|
await this.recallPrivateMessage(target_id, message_id);
|
|
111
|
-
if (target_type ===
|
|
115
|
+
if (target_type === "group")
|
|
112
116
|
await this.recallGroupMessage(target_id, message_id);
|
|
113
|
-
if (target_type ===
|
|
117
|
+
if (target_type === "channel")
|
|
114
118
|
await this.recallGuildMessage(target_id, message_id);
|
|
115
|
-
if (target_type ===
|
|
119
|
+
if (target_type === "direct")
|
|
116
120
|
await this.recallDirectMessage(target_id, message_id);
|
|
117
121
|
}
|
|
118
122
|
}
|
|
119
|
-
|
|
123
|
+
class QQAdapter extends Adapter {
|
|
124
|
+
constructor(plugin) {
|
|
125
|
+
super(plugin, "qq", []);
|
|
126
|
+
}
|
|
127
|
+
createBot(config) {
|
|
128
|
+
return new QQBot(this, config);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// 使用新的 provide() API 注册适配器
|
|
132
|
+
provide({
|
|
133
|
+
name: "qq",
|
|
134
|
+
description: "QQ Official Bot Adapter",
|
|
135
|
+
mounted: async (p) => {
|
|
136
|
+
const adapter = new QQAdapter(p);
|
|
137
|
+
await adapter.start();
|
|
138
|
+
return adapter;
|
|
139
|
+
},
|
|
140
|
+
dispose: async (adapter) => {
|
|
141
|
+
await adapter.stop();
|
|
142
|
+
},
|
|
143
|
+
});
|
|
120
144
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,GAKJ,MAAM,iBAAiB,CAAC;AACzB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAEL,SAAS,EACT,OAAO,EAEP,OAAO,EAGP,OAAO,GACR,MAAM,SAAS,CAAC;AAejB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;AAC3B,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;AAcvC,MAAM,OAAO,KACX,SAAQ,GAAG;IASQ;IANnB,UAAU,GAAY,KAAK,CAAC;IAE5B,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED,YAAmB,OAAkB,EAAE,MAAyB;QAC9D,IAAI,CAAC,MAAM,CAAC,QAAQ;YAAE,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;QACzE,KAAK,CAAC,MAAM,CAAC,CAAC;QAFG,YAAO,GAAP,OAAO,CAAW;QAGnC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAEO,eAAe,CAAC,GAA4C;QAClE,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;QACzC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,OA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4
|
"description": "zhin adapter for qq",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -30,13 +30,8 @@
|
|
|
30
30
|
"typescript": "^5.3.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"zhin.js": "1.
|
|
34
|
-
"
|
|
35
|
-
},
|
|
36
|
-
"peerDependenciesMeta": {
|
|
37
|
-
"@zhin.js/types": {
|
|
38
|
-
"optional": true
|
|
39
|
-
}
|
|
33
|
+
"@zhin.js/logger": "0.1.2",
|
|
34
|
+
"zhin.js": "1.0.18"
|
|
40
35
|
},
|
|
41
36
|
"files": [
|
|
42
37
|
"lib",
|