@alemonjs/qq-bot 2.1.0-alpha.19 → 2.1.0-alpha.20
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/lib/config.d.ts +8 -3
- package/lib/desktop.d.ts +1 -3
- package/lib/desktop.js +0 -10
- package/lib/hook.d.ts +12 -29
- package/lib/hook.js +0 -20
- package/lib/index.d.ts +4 -6
- package/lib/index.js +2 -5
- package/lib/index.webhook.d.ts +1 -0
- package/lib/index.webhook.js +0 -1
- package/lib/index.websoket.d.ts +1 -0
- package/lib/index.websoket.js +4 -5
- package/lib/message/AT_MESSAGE_CREATE.d.ts +1 -3
- package/lib/message/AT_MESSAGE_CREATE.js +1 -0
- package/lib/message/CHANNEL_CREATE.d.ts +15 -0
- package/lib/message/CHANNEL_CREATE.js +1 -0
- package/lib/message/CHANNEL_DELETE.d.ts +15 -0
- package/lib/message/CHANNEL_DELETE.js +1 -0
- package/lib/message/CHANNEL_UPDATE.d.ts +15 -0
- package/lib/message/CHANNEL_UPDATE.js +1 -0
- package/lib/message/DIRECT_MESSAGE_CREATE.d.ts +1 -8
- package/lib/message/DIRECT_MESSAGE_CREATE.js +1 -0
- package/lib/message/DIRECT_MESSAGE_DELETE.d.ts +17 -0
- package/lib/message/DIRECT_MESSAGE_DELETE.js +1 -0
- package/lib/message/ERROR.d.ts +1 -0
- package/lib/message/ERROR.js +1 -0
- package/lib/message/GUILD_CREATE.d.ts +15 -0
- package/lib/message/GUILD_CREATE.js +1 -0
- package/lib/message/GUILD_DELETE.d.ts +15 -0
- package/lib/message/GUILD_DELETE.js +1 -0
- package/lib/message/GUILD_MEMBER_ADD.d.ts +14 -0
- package/lib/message/GUILD_MEMBER_ADD.js +1 -0
- package/lib/message/GUILD_MEMBER_REMOVE.d.ts +14 -0
- package/lib/message/GUILD_MEMBER_REMOVE.js +1 -0
- package/lib/message/GUILD_MEMBER_UPDATE.d.ts +14 -0
- package/lib/message/GUILD_MEMBER_UPDATE.js +1 -0
- package/lib/message/GUILD_UPDATE.d.ts +15 -0
- package/lib/message/GUILD_UPDATE.js +1 -0
- package/lib/message/INTERACTION_CREATE.d.ts +1 -8
- package/lib/message/INTERACTION_CREATE.js +1 -0
- package/lib/message/MESSAGE_CREATE.d.ts +1 -0
- package/lib/message/MESSAGE_CREATE.js +1 -0
- package/lib/message/MESSAGE_DELETE.d.ts +1 -0
- package/lib/message/MESSAGE_DELETE.js +1 -0
- package/lib/message/MESSAGE_REACTION_ADD.d.ts +13 -0
- package/lib/message/MESSAGE_REACTION_ADD.js +1 -0
- package/lib/message/MESSAGE_REACTION_REMOVE.d.ts +13 -0
- package/lib/message/MESSAGE_REACTION_REMOVE.js +1 -0
- package/lib/message/PUBLIC_MESSAGE_DELETE.d.ts +15 -0
- package/lib/message/PUBLIC_MESSAGE_DELETE.js +1 -0
- package/lib/message/READY.d.ts +6 -0
- package/lib/message/READY.js +1 -0
- package/lib/message/group/C2C_MESSAGE_CREATE.d.ts +1 -3
- package/lib/message/group/C2C_MESSAGE_CREATE.js +1 -0
- package/lib/message/group/C2C_MSG_RECEIVE.d.ts +4 -0
- package/lib/message/group/C2C_MSG_RECEIVE.js +1 -0
- package/lib/message/group/C2C_MSG_REJECT.d.ts +4 -0
- package/lib/message/group/C2C_MSG_REJECT.js +1 -0
- package/lib/message/group/FRIEND_ADD.d.ts +4 -0
- package/lib/message/group/FRIEND_ADD.js +1 -0
- package/lib/message/group/FRIEND_DEL.d.ts +4 -0
- package/lib/message/group/FRIEND_DEL.js +1 -0
- package/lib/message/group/GROUP_ADD_ROBOT.d.ts +5 -0
- package/lib/message/group/GROUP_ADD_ROBOT.js +1 -0
- package/lib/message/group/GROUP_AT_MESSAGE_CREATE.d.ts +1 -6
- package/lib/message/group/GROUP_AT_MESSAGE_CREATE.js +1 -0
- package/lib/message/group/GROUP_DEL_ROBOT.d.ts +5 -0
- package/lib/message/group/GROUP_DEL_ROBOT.js +1 -0
- package/lib/message/group/GROUP_MSG_RECEIVE.d.ts +5 -0
- package/lib/message/group/GROUP_MSG_RECEIVE.js +1 -0
- package/lib/message/group/GROUP_MSG_REJECT.d.ts +5 -0
- package/lib/message/group/GROUP_MSG_REJECT.js +1 -0
- package/lib/register.d.ts +2 -0
- package/lib/register.js +0 -97
- package/lib/sdk/api.d.ts +6 -529
- package/lib/sdk/api.js +0 -526
- package/lib/sdk/client.webhook.d.ts +9 -0
- package/lib/sdk/client.webhook.js +0 -39
- package/lib/sdk/client.websoket.d.ts +9 -0
- package/lib/sdk/client.websoket.js +4 -57
- package/lib/sdk/config.d.ts +1 -0
- package/lib/sdk/instance.d.ts +3 -0
- package/lib/sdk/instance.js +3 -19
- package/lib/sdk/intents.d.ts +3 -0
- package/lib/sdk/intents.js +25 -90
- package/lib/sdk/message.d.ts +4 -0
- package/lib/sdk/message.group.d.ts +24 -0
- package/lib/sdk/message.group.js +1 -0
- package/lib/sdk/message.guild.d.ts +38 -0
- package/lib/sdk/message.guild.js +1 -0
- package/lib/sdk/message.js +1 -0
- package/lib/sdk/message.public.d.ts +6 -0
- package/lib/sdk/message.public.js +1 -0
- package/lib/sdk/typing.d.ts +21 -11
- package/lib/sdk/typing.js +1 -0
- package/lib/sdk/webhook.secret.d.ts +14 -0
- package/lib/sdk/webhook.secret.js +2 -19
- package/lib/sends.d.ts +29 -0
- package/lib/sends.js +19 -107
- package/lib/utils.d.ts +1 -0
- package/lib/utils.js +8 -0
- package/package.json +4 -4
package/lib/config.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import { Options as sdkOptions } from './sdk/typing';
|
|
2
|
+
export declare const platform = "qq-bot";
|
|
3
|
+
export type Options = {
|
|
4
|
+
master_key?: string[];
|
|
5
|
+
master_id?: string[];
|
|
6
|
+
} & sdkOptions;
|
|
7
|
+
export declare const getQQBotConfig: () => Options;
|
|
8
|
+
export declare const getMaster: (UserId: string) => readonly [boolean, string];
|
package/lib/desktop.d.ts
CHANGED
package/lib/desktop.js
CHANGED
|
@@ -3,30 +3,22 @@ import { dirname, join } from 'path';
|
|
|
3
3
|
import { fileURLToPath } from 'url';
|
|
4
4
|
import { getConfig, getConfigValue } from 'alemonjs';
|
|
5
5
|
|
|
6
|
-
// 当前目录
|
|
7
6
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
-
// 被激活的时候。
|
|
9
7
|
const activate = context => {
|
|
10
|
-
// 创建一个 webview。
|
|
11
8
|
const webView = context.createSidebarWebView(context);
|
|
12
|
-
// 当命令被触发的时候。
|
|
13
9
|
context.onCommand('open.qq-bot', () => {
|
|
14
10
|
const dir = join(__dirname, '../', 'dist', 'index.html');
|
|
15
11
|
const scriptReg = /<script.*?src="(.+?)".*?>/;
|
|
16
12
|
const styleReg = /<link.*?rel="stylesheet".*?href="(.+?)".*?>/;
|
|
17
13
|
const iconReg = /<link.*?rel="icon".*?href="(.+?)".*?>/g;
|
|
18
|
-
// 创建 webview 路径
|
|
19
14
|
const styleUri = context.createExtensionDir(join(__dirname, '../', 'dist', 'assets', 'index.css'));
|
|
20
15
|
const scriptUri = context.createExtensionDir(join(__dirname, '../', 'dist', 'assets', 'index.js'));
|
|
21
|
-
// 确保路径存在
|
|
22
16
|
const html = readFileSync(dir, 'utf-8')
|
|
23
17
|
.replace(iconReg, '')
|
|
24
18
|
.replace(scriptReg, `<script type="module" crossorigin src="${scriptUri}"></script>`)
|
|
25
19
|
.replace(styleReg, `<link rel="stylesheet" crossorigin href="${styleUri}">`);
|
|
26
|
-
// 立即渲染 webview
|
|
27
20
|
webView.loadWebView(html);
|
|
28
21
|
});
|
|
29
|
-
// 监听 webview 的消息。
|
|
30
22
|
webView.onMessage(data => {
|
|
31
23
|
try {
|
|
32
24
|
if (data.type === 'qq-bot.form.save') {
|
|
@@ -35,7 +27,6 @@ const activate = context => {
|
|
|
35
27
|
const value = config.value ?? {};
|
|
36
28
|
value['qq-bot'] = {
|
|
37
29
|
...qqBot,
|
|
38
|
-
// master_key 12121,1313,1313,13 转为数组
|
|
39
30
|
master_key: qqBot.master_key.split(',')
|
|
40
31
|
};
|
|
41
32
|
config.saveValue(value);
|
|
@@ -46,7 +37,6 @@ const activate = context => {
|
|
|
46
37
|
if (!config) {
|
|
47
38
|
config = {};
|
|
48
39
|
}
|
|
49
|
-
// 发送消息
|
|
50
40
|
webView.postMessage({
|
|
51
41
|
type: 'qq-bot.init',
|
|
52
42
|
data: config['qq-bot'] ?? {}
|
package/lib/hook.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { EventKeys, Events } from 'alemonjs';
|
|
2
|
-
import { GROUP_AT_MESSAGE_CREATE_TYPE } from './message/group/GROUP_AT_MESSAGE_CREATE
|
|
3
|
-
import { QQBotAPI } from './sdk/api
|
|
4
|
-
import { AT_MESSAGE_CREATE_TYPE } from './message/AT_MESSAGE_CREATE
|
|
5
|
-
import { INTERACTION_CREATE_TYPE } from './message/INTERACTION_CREATE
|
|
6
|
-
import { DIRECT_MESSAGE_CREATE_TYPE } from './message/DIRECT_MESSAGE_CREATE
|
|
7
|
-
import { C2C_MESSAGE_CREATE_TYPE } from './message/group/C2C_MESSAGE_CREATE
|
|
8
|
-
|
|
2
|
+
import { GROUP_AT_MESSAGE_CREATE_TYPE } from './message/group/GROUP_AT_MESSAGE_CREATE';
|
|
3
|
+
import { QQBotAPI as API } from './sdk/api';
|
|
4
|
+
import { AT_MESSAGE_CREATE_TYPE } from './message/AT_MESSAGE_CREATE';
|
|
5
|
+
import { INTERACTION_CREATE_TYPE } from './message/INTERACTION_CREATE';
|
|
6
|
+
import { DIRECT_MESSAGE_CREATE_TYPE } from './message/DIRECT_MESSAGE_CREATE';
|
|
7
|
+
import { C2C_MESSAGE_CREATE_TYPE } from './message/group/C2C_MESSAGE_CREATE';
|
|
9
8
|
type MAP = {
|
|
10
9
|
'message.create': GROUP_AT_MESSAGE_CREATE_TYPE | AT_MESSAGE_CREATE_TYPE;
|
|
11
10
|
'private.message.create': DIRECT_MESSAGE_CREATE_TYPE | C2C_MESSAGE_CREATE_TYPE;
|
|
@@ -15,8 +14,8 @@ type MAP = {
|
|
|
15
14
|
'message.delete': undefined;
|
|
16
15
|
'message.reaction.add': undefined;
|
|
17
16
|
'message.reaction.remove': undefined;
|
|
18
|
-
'
|
|
19
|
-
'
|
|
17
|
+
'channel.create': undefined;
|
|
18
|
+
'channel.delete': undefined;
|
|
20
19
|
'guild.join': undefined;
|
|
21
20
|
'guild.exit': undefined;
|
|
22
21
|
'member.add': undefined;
|
|
@@ -26,23 +25,7 @@ type MAP = {
|
|
|
26
25
|
'private.friend.add': undefined;
|
|
27
26
|
'private.guild.add': undefined;
|
|
28
27
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
*/
|
|
34
|
-
declare const useValue: <T extends EventKeys>(event: Events[T]) => readonly [MAP[T]];
|
|
35
|
-
/**
|
|
36
|
-
*
|
|
37
|
-
* @param event
|
|
38
|
-
* @returns
|
|
39
|
-
*/
|
|
40
|
-
declare const useClient: <T extends EventKeys>(event: Events[T]) => readonly [QQBotAPI, MAP[T]];
|
|
41
|
-
/**
|
|
42
|
-
* 判断当前模式
|
|
43
|
-
* @param event
|
|
44
|
-
* @returns
|
|
45
|
-
*/
|
|
46
|
-
declare const useMode: <T extends EventKeys>(event: Events[T]) => (mode: "guild" | "group") => boolean;
|
|
47
|
-
|
|
48
|
-
export { useClient, useMode, useValue };
|
|
28
|
+
export declare const useValue: <T extends EventKeys>(event: Events[T]) => readonly [MAP[T]];
|
|
29
|
+
export declare const useClient: <T extends EventKeys>(event: Events[T]) => readonly [API, MAP[T]];
|
|
30
|
+
export declare const useMode: <T extends EventKeys>(event: Events[T]) => (mode: "guild" | "group") => boolean;
|
|
31
|
+
export {};
|
package/lib/hook.js
CHANGED
|
@@ -1,50 +1,30 @@
|
|
|
1
1
|
import { createEventValue, useClient as useClient$1 } from 'alemonjs';
|
|
2
2
|
import { QQBotAPI } from './sdk/api.js';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* @param event
|
|
7
|
-
* @returns
|
|
8
|
-
*/
|
|
9
4
|
const useValue = (event) => {
|
|
10
5
|
const value = createEventValue(event);
|
|
11
6
|
return [value];
|
|
12
7
|
};
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @param event
|
|
16
|
-
* @returns
|
|
17
|
-
*/
|
|
18
8
|
const useClient = (event) => {
|
|
19
9
|
const [client] = useClient$1(event, QQBotAPI);
|
|
20
10
|
const value = createEventValue(event);
|
|
21
11
|
return [client, value];
|
|
22
12
|
};
|
|
23
|
-
/**
|
|
24
|
-
* 判断当前模式
|
|
25
|
-
* @param event
|
|
26
|
-
* @returns
|
|
27
|
-
*/
|
|
28
13
|
const useMode = (event) => {
|
|
29
14
|
const tag = event.tag;
|
|
30
15
|
let currentMode = 'group';
|
|
31
|
-
// 群at
|
|
32
16
|
if (tag === 'GROUP_AT_MESSAGE_CREATE') {
|
|
33
17
|
currentMode = 'group';
|
|
34
18
|
}
|
|
35
|
-
// 私聊
|
|
36
19
|
if (tag === 'C2C_MESSAGE_CREATE') {
|
|
37
20
|
currentMode = 'group';
|
|
38
21
|
}
|
|
39
|
-
// 频道私聊
|
|
40
22
|
if (tag === 'DIRECT_MESSAGE_CREATE') {
|
|
41
23
|
currentMode = 'guild';
|
|
42
24
|
}
|
|
43
|
-
// 频道at
|
|
44
25
|
if (tag === 'AT_MESSAGE_CREATE') {
|
|
45
26
|
currentMode = 'guild';
|
|
46
27
|
}
|
|
47
|
-
// 频道消息
|
|
48
28
|
if (tag === 'MESSAGE_CREATE') {
|
|
49
29
|
currentMode = 'guild';
|
|
50
30
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export { platform } from './config
|
|
2
|
-
export
|
|
3
|
-
export { QQBotAPI as API } from './sdk/api
|
|
4
|
-
|
|
1
|
+
export { platform } from './config';
|
|
2
|
+
export * from './hook';
|
|
3
|
+
export { QQBotAPI as API } from './sdk/api';
|
|
5
4
|
declare const main: () => void;
|
|
6
|
-
|
|
7
|
-
export { main as default };
|
|
5
|
+
export default main;
|
package/lib/index.js
CHANGED
|
@@ -5,7 +5,6 @@ import { platform } from './config.js';
|
|
|
5
5
|
export { useClient, useMode, useValue } from './hook.js';
|
|
6
6
|
export { QQBotAPI as API } from './sdk/api.js';
|
|
7
7
|
|
|
8
|
-
// main
|
|
9
8
|
const main = () => {
|
|
10
9
|
let value = getConfigValue();
|
|
11
10
|
if (!value) {
|
|
@@ -22,14 +21,13 @@ const main = () => {
|
|
|
22
21
|
const mainProcess = () => {
|
|
23
22
|
['SIGINT', 'SIGTERM', 'SIGQUIT', 'disconnect'].forEach(sig => {
|
|
24
23
|
process?.on?.(sig, () => {
|
|
25
|
-
logger
|
|
24
|
+
logger.info?.(`[@alemonjs/qq-bot][${sig}] 收到信号,正在关闭...`);
|
|
26
25
|
setImmediate(() => process.exit(0));
|
|
27
26
|
});
|
|
28
27
|
});
|
|
29
28
|
process?.on?.('exit', code => {
|
|
30
|
-
logger
|
|
29
|
+
logger.info?.(`[@alemonjs/qq-bot][exit] 进程退出,code=${code}`);
|
|
31
30
|
});
|
|
32
|
-
// 监听主进程消息
|
|
33
31
|
process.on('message', msg => {
|
|
34
32
|
try {
|
|
35
33
|
const data = typeof msg === 'string' ? JSON.parse(msg) : msg;
|
|
@@ -42,7 +40,6 @@ const mainProcess = () => {
|
|
|
42
40
|
}
|
|
43
41
|
catch { }
|
|
44
42
|
});
|
|
45
|
-
// 主动发送 ready 消息
|
|
46
43
|
if (process.send) {
|
|
47
44
|
process.send(JSON.stringify({ type: 'ready' }));
|
|
48
45
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const start: () => void;
|
package/lib/index.webhook.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const start: () => void;
|
package/lib/index.websoket.js
CHANGED
|
@@ -5,15 +5,15 @@ import { getQQBotConfig } from './config.js';
|
|
|
5
5
|
const start = () => {
|
|
6
6
|
const config = getQQBotConfig();
|
|
7
7
|
const notPrivateIntents = [
|
|
8
|
-
'GUILDS',
|
|
9
|
-
'GUILD_MEMBERS',
|
|
8
|
+
'GUILDS',
|
|
9
|
+
'GUILD_MEMBERS',
|
|
10
10
|
'GUILD_MESSAGE_REACTIONS',
|
|
11
11
|
'DIRECT_MESSAGE',
|
|
12
12
|
'PUBLIC_GUILD_MESSAGES'
|
|
13
13
|
];
|
|
14
14
|
const isPrivateIntents = [
|
|
15
|
-
'GUILDS',
|
|
16
|
-
'GUILD_MEMBERS',
|
|
15
|
+
'GUILDS',
|
|
16
|
+
'GUILD_MEMBERS',
|
|
17
17
|
'GUILD_MESSAGES',
|
|
18
18
|
'GUILD_MESSAGE_REACTIONS',
|
|
19
19
|
'DIRECT_MESSAGE',
|
|
@@ -49,7 +49,6 @@ const start = () => {
|
|
|
49
49
|
shard: config?.shard ?? [0, 1],
|
|
50
50
|
mode: config?.mode ?? 'group'
|
|
51
51
|
});
|
|
52
|
-
// 连接
|
|
53
52
|
void client.connect(config?.gatewayURL);
|
|
54
53
|
register(client);
|
|
55
54
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type AT_MESSAGE_CREATE_TYPE = {
|
|
1
|
+
export type AT_MESSAGE_CREATE_TYPE = {
|
|
2
2
|
attachments?: {
|
|
3
3
|
id: string;
|
|
4
4
|
url: string;
|
|
@@ -33,5 +33,3 @@ type AT_MESSAGE_CREATE_TYPE = {
|
|
|
33
33
|
seq_in_channel: string;
|
|
34
34
|
timestamp: string;
|
|
35
35
|
};
|
|
36
|
-
|
|
37
|
-
export type { AT_MESSAGE_CREATE_TYPE };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type CHANNEL_CREATE_TYPE = {
|
|
2
|
+
application_id?: string;
|
|
3
|
+
guild_id: string;
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
op_user_id: string;
|
|
7
|
+
owner_id: string;
|
|
8
|
+
parent_id?: string;
|
|
9
|
+
permissions?: string;
|
|
10
|
+
position?: number;
|
|
11
|
+
private_type: number;
|
|
12
|
+
speak_permission: number;
|
|
13
|
+
sub_type: number;
|
|
14
|
+
type: number;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type CHANNEL_DELETE_TYPE = {
|
|
2
|
+
application_id?: string;
|
|
3
|
+
guild_id: string;
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
op_user_id: string;
|
|
7
|
+
owner_id: string;
|
|
8
|
+
parent_id?: string;
|
|
9
|
+
permissions?: string;
|
|
10
|
+
position?: number;
|
|
11
|
+
private_type: number;
|
|
12
|
+
speak_permission: number;
|
|
13
|
+
sub_type: number;
|
|
14
|
+
type: number;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type CHANNEL_UPDATE_TYPE = {
|
|
2
|
+
application_id?: string;
|
|
3
|
+
guild_id: string;
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
op_user_id: string;
|
|
7
|
+
owner_id: string;
|
|
8
|
+
parent_id?: string;
|
|
9
|
+
permissions?: string;
|
|
10
|
+
position?: number;
|
|
11
|
+
private_type: number;
|
|
12
|
+
speak_permission: number;
|
|
13
|
+
sub_type: number;
|
|
14
|
+
type: number;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* 私信
|
|
3
|
-
* @param event
|
|
4
|
-
* @returns
|
|
5
|
-
*/
|
|
6
|
-
type DIRECT_MESSAGE_CREATE_TYPE = {
|
|
1
|
+
export type DIRECT_MESSAGE_CREATE_TYPE = {
|
|
7
2
|
attachments?: {
|
|
8
3
|
content_type: string;
|
|
9
4
|
filename: string;
|
|
@@ -32,5 +27,3 @@ type DIRECT_MESSAGE_CREATE_TYPE = {
|
|
|
32
27
|
src_guild_id: string;
|
|
33
28
|
timestamp: string;
|
|
34
29
|
};
|
|
35
|
-
|
|
36
|
-
export type { DIRECT_MESSAGE_CREATE_TYPE };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type DIRECT_MESSAGE_DELETE_TYPE = {
|
|
2
|
+
message: {
|
|
3
|
+
author: {
|
|
4
|
+
bot: boolean;
|
|
5
|
+
id: string;
|
|
6
|
+
username: string;
|
|
7
|
+
};
|
|
8
|
+
channel_id: string;
|
|
9
|
+
direct_message: boolean;
|
|
10
|
+
guild_id: string;
|
|
11
|
+
id: string;
|
|
12
|
+
src_guild_id: string;
|
|
13
|
+
};
|
|
14
|
+
op_user: {
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ERROR_TYPE = any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type GUILD_CREATE_TYPE = {
|
|
2
|
+
description: string;
|
|
3
|
+
icon: string;
|
|
4
|
+
id: string;
|
|
5
|
+
joined_at: string;
|
|
6
|
+
max_members: number;
|
|
7
|
+
member_count: number;
|
|
8
|
+
name: string;
|
|
9
|
+
op_user_id: string;
|
|
10
|
+
owner: boolean;
|
|
11
|
+
owner_id: string;
|
|
12
|
+
union_appid: string;
|
|
13
|
+
union_org_id: string;
|
|
14
|
+
union_world_id: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type GUILD_DELETE_TYPE = {
|
|
2
|
+
description: string;
|
|
3
|
+
icon: string;
|
|
4
|
+
id: string;
|
|
5
|
+
joined_at: string;
|
|
6
|
+
max_members: number;
|
|
7
|
+
member_count: number;
|
|
8
|
+
name: string;
|
|
9
|
+
op_user_id: string;
|
|
10
|
+
owner: boolean;
|
|
11
|
+
owner_id: string;
|
|
12
|
+
union_appid: string;
|
|
13
|
+
union_org_id: string;
|
|
14
|
+
union_world_id: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type GUILD_MEMBER_REMOVE_TYPE = {
|
|
2
|
+
guild_id: string;
|
|
3
|
+
joined_at: string;
|
|
4
|
+
nick: string;
|
|
5
|
+
op_user_id: string;
|
|
6
|
+
roles: string[];
|
|
7
|
+
source_type?: string;
|
|
8
|
+
user: {
|
|
9
|
+
avatar: string;
|
|
10
|
+
bot: number;
|
|
11
|
+
id: string;
|
|
12
|
+
username: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type GUILD_MEMBER_UPDATE_TYPE = {
|
|
2
|
+
guild_id: string;
|
|
3
|
+
joined_at: string;
|
|
4
|
+
nick: string;
|
|
5
|
+
op_user_id: string;
|
|
6
|
+
roles: string[];
|
|
7
|
+
source_type?: string;
|
|
8
|
+
user: {
|
|
9
|
+
avatar: string;
|
|
10
|
+
bot: number;
|
|
11
|
+
id: string;
|
|
12
|
+
username: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type GUILD_UPDATE_TYPE = {
|
|
2
|
+
description: string;
|
|
3
|
+
icon: string;
|
|
4
|
+
id: string;
|
|
5
|
+
joined_at: string;
|
|
6
|
+
max_members: number;
|
|
7
|
+
member_count: number;
|
|
8
|
+
name: string;
|
|
9
|
+
op_user_id: string;
|
|
10
|
+
owner: boolean;
|
|
11
|
+
owner_id: string;
|
|
12
|
+
union_appid: string;
|
|
13
|
+
union_org_id: string;
|
|
14
|
+
union_world_id: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* 交互消息事件 | 按钮消息
|
|
3
|
-
* @param event
|
|
4
|
-
* @returns
|
|
5
|
-
*/
|
|
6
|
-
type INTERACTION_CREATE_TYPE = {
|
|
1
|
+
export type INTERACTION_CREATE_TYPE = {
|
|
7
2
|
application_id: string;
|
|
8
3
|
chat_type: 1;
|
|
9
4
|
data: {
|
|
@@ -56,5 +51,3 @@ type INTERACTION_CREATE_TYPE = {
|
|
|
56
51
|
channel_id: string;
|
|
57
52
|
version: number;
|
|
58
53
|
};
|
|
59
|
-
|
|
60
|
-
export type { INTERACTION_CREATE_TYPE };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type MESSAGE_CREATE_TYPE = any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type MESSAGE_DELETE_TYPE = any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|