@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.
Files changed (101) hide show
  1. package/lib/config.d.ts +8 -3
  2. package/lib/desktop.d.ts +1 -3
  3. package/lib/desktop.js +0 -10
  4. package/lib/hook.d.ts +12 -29
  5. package/lib/hook.js +0 -20
  6. package/lib/index.d.ts +4 -6
  7. package/lib/index.js +2 -5
  8. package/lib/index.webhook.d.ts +1 -0
  9. package/lib/index.webhook.js +0 -1
  10. package/lib/index.websoket.d.ts +1 -0
  11. package/lib/index.websoket.js +4 -5
  12. package/lib/message/AT_MESSAGE_CREATE.d.ts +1 -3
  13. package/lib/message/AT_MESSAGE_CREATE.js +1 -0
  14. package/lib/message/CHANNEL_CREATE.d.ts +15 -0
  15. package/lib/message/CHANNEL_CREATE.js +1 -0
  16. package/lib/message/CHANNEL_DELETE.d.ts +15 -0
  17. package/lib/message/CHANNEL_DELETE.js +1 -0
  18. package/lib/message/CHANNEL_UPDATE.d.ts +15 -0
  19. package/lib/message/CHANNEL_UPDATE.js +1 -0
  20. package/lib/message/DIRECT_MESSAGE_CREATE.d.ts +1 -8
  21. package/lib/message/DIRECT_MESSAGE_CREATE.js +1 -0
  22. package/lib/message/DIRECT_MESSAGE_DELETE.d.ts +17 -0
  23. package/lib/message/DIRECT_MESSAGE_DELETE.js +1 -0
  24. package/lib/message/ERROR.d.ts +1 -0
  25. package/lib/message/ERROR.js +1 -0
  26. package/lib/message/GUILD_CREATE.d.ts +15 -0
  27. package/lib/message/GUILD_CREATE.js +1 -0
  28. package/lib/message/GUILD_DELETE.d.ts +15 -0
  29. package/lib/message/GUILD_DELETE.js +1 -0
  30. package/lib/message/GUILD_MEMBER_ADD.d.ts +14 -0
  31. package/lib/message/GUILD_MEMBER_ADD.js +1 -0
  32. package/lib/message/GUILD_MEMBER_REMOVE.d.ts +14 -0
  33. package/lib/message/GUILD_MEMBER_REMOVE.js +1 -0
  34. package/lib/message/GUILD_MEMBER_UPDATE.d.ts +14 -0
  35. package/lib/message/GUILD_MEMBER_UPDATE.js +1 -0
  36. package/lib/message/GUILD_UPDATE.d.ts +15 -0
  37. package/lib/message/GUILD_UPDATE.js +1 -0
  38. package/lib/message/INTERACTION_CREATE.d.ts +1 -8
  39. package/lib/message/INTERACTION_CREATE.js +1 -0
  40. package/lib/message/MESSAGE_CREATE.d.ts +1 -0
  41. package/lib/message/MESSAGE_CREATE.js +1 -0
  42. package/lib/message/MESSAGE_DELETE.d.ts +1 -0
  43. package/lib/message/MESSAGE_DELETE.js +1 -0
  44. package/lib/message/MESSAGE_REACTION_ADD.d.ts +13 -0
  45. package/lib/message/MESSAGE_REACTION_ADD.js +1 -0
  46. package/lib/message/MESSAGE_REACTION_REMOVE.d.ts +13 -0
  47. package/lib/message/MESSAGE_REACTION_REMOVE.js +1 -0
  48. package/lib/message/PUBLIC_MESSAGE_DELETE.d.ts +15 -0
  49. package/lib/message/PUBLIC_MESSAGE_DELETE.js +1 -0
  50. package/lib/message/READY.d.ts +6 -0
  51. package/lib/message/READY.js +1 -0
  52. package/lib/message/group/C2C_MESSAGE_CREATE.d.ts +1 -3
  53. package/lib/message/group/C2C_MESSAGE_CREATE.js +1 -0
  54. package/lib/message/group/C2C_MSG_RECEIVE.d.ts +4 -0
  55. package/lib/message/group/C2C_MSG_RECEIVE.js +1 -0
  56. package/lib/message/group/C2C_MSG_REJECT.d.ts +4 -0
  57. package/lib/message/group/C2C_MSG_REJECT.js +1 -0
  58. package/lib/message/group/FRIEND_ADD.d.ts +4 -0
  59. package/lib/message/group/FRIEND_ADD.js +1 -0
  60. package/lib/message/group/FRIEND_DEL.d.ts +4 -0
  61. package/lib/message/group/FRIEND_DEL.js +1 -0
  62. package/lib/message/group/GROUP_ADD_ROBOT.d.ts +5 -0
  63. package/lib/message/group/GROUP_ADD_ROBOT.js +1 -0
  64. package/lib/message/group/GROUP_AT_MESSAGE_CREATE.d.ts +1 -6
  65. package/lib/message/group/GROUP_AT_MESSAGE_CREATE.js +1 -0
  66. package/lib/message/group/GROUP_DEL_ROBOT.d.ts +5 -0
  67. package/lib/message/group/GROUP_DEL_ROBOT.js +1 -0
  68. package/lib/message/group/GROUP_MSG_RECEIVE.d.ts +5 -0
  69. package/lib/message/group/GROUP_MSG_RECEIVE.js +1 -0
  70. package/lib/message/group/GROUP_MSG_REJECT.d.ts +5 -0
  71. package/lib/message/group/GROUP_MSG_REJECT.js +1 -0
  72. package/lib/register.d.ts +2 -0
  73. package/lib/register.js +0 -97
  74. package/lib/sdk/api.d.ts +6 -529
  75. package/lib/sdk/api.js +0 -526
  76. package/lib/sdk/client.webhook.d.ts +9 -0
  77. package/lib/sdk/client.webhook.js +0 -39
  78. package/lib/sdk/client.websoket.d.ts +9 -0
  79. package/lib/sdk/client.websoket.js +4 -57
  80. package/lib/sdk/config.d.ts +1 -0
  81. package/lib/sdk/instance.d.ts +3 -0
  82. package/lib/sdk/instance.js +3 -19
  83. package/lib/sdk/intents.d.ts +3 -0
  84. package/lib/sdk/intents.js +25 -90
  85. package/lib/sdk/message.d.ts +4 -0
  86. package/lib/sdk/message.group.d.ts +24 -0
  87. package/lib/sdk/message.group.js +1 -0
  88. package/lib/sdk/message.guild.d.ts +38 -0
  89. package/lib/sdk/message.guild.js +1 -0
  90. package/lib/sdk/message.js +1 -0
  91. package/lib/sdk/message.public.d.ts +6 -0
  92. package/lib/sdk/message.public.js +1 -0
  93. package/lib/sdk/typing.d.ts +21 -11
  94. package/lib/sdk/typing.js +1 -0
  95. package/lib/sdk/webhook.secret.d.ts +14 -0
  96. package/lib/sdk/webhook.secret.js +2 -19
  97. package/lib/sends.d.ts +29 -0
  98. package/lib/sends.js +19 -107
  99. package/lib/utils.d.ts +1 -0
  100. package/lib/utils.js +8 -0
  101. package/package.json +4 -4
package/lib/config.d.ts CHANGED
@@ -1,3 +1,8 @@
1
- declare const platform = "qq-bot";
2
-
3
- export { platform };
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
@@ -1,3 +1 @@
1
- declare const activate: (context: any) => void;
2
-
3
- export { activate };
1
+ export declare const activate: (context: any) => void;
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.js';
3
- import { QQBotAPI } from './sdk/api.js';
4
- import { AT_MESSAGE_CREATE_TYPE } from './message/AT_MESSAGE_CREATE.js';
5
- import { INTERACTION_CREATE_TYPE } from './message/INTERACTION_CREATE.js';
6
- import { DIRECT_MESSAGE_CREATE_TYPE } from './message/DIRECT_MESSAGE_CREATE.js';
7
- import { C2C_MESSAGE_CREATE_TYPE } from './message/group/C2C_MESSAGE_CREATE.js';
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
- 'channal.create': undefined;
19
- 'channal.delete': undefined;
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
- * @param event
32
- * @returns
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.js';
2
- export { useClient, useMode, useValue } from './hook.js';
3
- export { QQBotAPI as API } from './sdk/api.js';
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?.info?.(`[@alemonjs/qq-bot][${sig}] 收到信号,正在关闭...`);
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?.info?.(`[@alemonjs/qq-bot][exit] 进程退出,code=${code}`);
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;
@@ -8,7 +8,6 @@ const start = () => {
8
8
  const client = new QQBotClient({
9
9
  ...cfgConfig
10
10
  });
11
- // 连接
12
11
  client.connect();
13
12
  register(client);
14
13
  };
@@ -0,0 +1 @@
1
+ export declare const start: () => void;
@@ -5,15 +5,15 @@ import { getQQBotConfig } from './config.js';
5
5
  const start = () => {
6
6
  const config = getQQBotConfig();
7
7
  const notPrivateIntents = [
8
- 'GUILDS', // base
9
- 'GUILD_MEMBERS', // base
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', // base
16
- 'GUILD_MEMBERS', // base
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,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
+ 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,14 @@
1
+ export type GUILD_MEMBER_ADD_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_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,13 @@
1
+ export type MESSAGE_REACTION_ADD_TYPE = {
2
+ channel_id: string;
3
+ emoji: {
4
+ id: string;
5
+ type: number;
6
+ };
7
+ guild_id: string;
8
+ target: {
9
+ id: string;
10
+ type: string;
11
+ };
12
+ user_id: string;
13
+ };
@@ -0,0 +1,13 @@
1
+ export type MESSAGE_REACTION_REMOVE_TYPE = {
2
+ channel_id: string;
3
+ emoji: {
4
+ id: string;
5
+ type: number;
6
+ };
7
+ guild_id: string;
8
+ target: {
9
+ id: string;
10
+ type: string;
11
+ };
12
+ user_id: string;
13
+ };
@@ -0,0 +1,15 @@
1
+ export type PUBLIC_MESSAGE_DELETE_TYPE = {
2
+ message: {
3
+ author: {
4
+ bot: false;
5
+ id: string;
6
+ username: string;
7
+ };
8
+ channel_id: string;
9
+ guild_id: string;
10
+ id: string;
11
+ };
12
+ op_user: {
13
+ id: string;
14
+ };
15
+ };
@@ -0,0 +1,6 @@
1
+ export type READY_TYPE = {
2
+ user: {
3
+ id: string;
4
+ name: string;
5
+ };
6
+ };
@@ -0,0 +1 @@
1
+
@@ -1,4 +1,4 @@
1
- type C2C_MESSAGE_CREATE_TYPE = {
1
+ export type C2C_MESSAGE_CREATE_TYPE = {
2
2
  author: {
3
3
  id: string;
4
4
  user_openid: string;
@@ -7,5 +7,3 @@ type C2C_MESSAGE_CREATE_TYPE = {
7
7
  id: string;
8
8
  timestamp: string;
9
9
  };
10
-
11
- export type { C2C_MESSAGE_CREATE_TYPE };
@@ -0,0 +1,4 @@
1
+ export type C2C_MSG_RECEIVE_TYPE = {
2
+ openid: string;
3
+ timestamp: string;
4
+ };
@@ -0,0 +1,4 @@
1
+ export type C2C_MSG_REJECT_TYPE = {
2
+ openid: string;
3
+ timestamp: string;
4
+ };
@@ -0,0 +1,4 @@
1
+ export type FRIEND_ADD_TYPE = {
2
+ openid: string;
3
+ timestamp: string;
4
+ };
@@ -0,0 +1 @@
1
+