@alemonjs/qq-bot 2.1.0-alpha.11 → 2.1.0-alpha.12

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/hook.d.ts CHANGED
@@ -1,11 +1,15 @@
1
1
  import { EventKeys, Events } from 'alemonjs';
2
2
  import { GROUP_AT_MESSAGE_CREATE_TYPE } from './message/group/GROUP_AT_MESSAGE_CREATE.js';
3
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';
4
8
 
5
9
  type MAP = {
6
- 'message.create': GROUP_AT_MESSAGE_CREATE_TYPE;
7
- 'private.message.create': undefined;
8
- 'interaction.create': undefined;
10
+ 'message.create': GROUP_AT_MESSAGE_CREATE_TYPE | AT_MESSAGE_CREATE_TYPE;
11
+ 'private.message.create': DIRECT_MESSAGE_CREATE_TYPE | C2C_MESSAGE_CREATE_TYPE;
12
+ 'interaction.create': INTERACTION_CREATE_TYPE;
9
13
  'private.interaction.create': undefined;
10
14
  'message.update': undefined;
11
15
  'message.delete': undefined;
@@ -0,0 +1,37 @@
1
+ type AT_MESSAGE_CREATE_TYPE = {
2
+ attachments?: {
3
+ id: string;
4
+ url: string;
5
+ content_type: string;
6
+ filename: string;
7
+ size: number;
8
+ height: number;
9
+ width: number;
10
+ }[];
11
+ author: {
12
+ avatar: string;
13
+ bot: boolean;
14
+ id: string;
15
+ username: string;
16
+ };
17
+ channel_id: string;
18
+ content: string;
19
+ guild_id: string;
20
+ id: string;
21
+ member: {
22
+ joined_at: string;
23
+ nick: string;
24
+ roles: string[];
25
+ };
26
+ mentions: {
27
+ avatar: string;
28
+ bot: boolean;
29
+ id: string;
30
+ username: string;
31
+ }[];
32
+ seq: number;
33
+ seq_in_channel: string;
34
+ timestamp: string;
35
+ };
36
+
37
+ export type { AT_MESSAGE_CREATE_TYPE };
@@ -0,0 +1,36 @@
1
+ /**
2
+ * 私信
3
+ * @param event
4
+ * @returns
5
+ */
6
+ type DIRECT_MESSAGE_CREATE_TYPE = {
7
+ attachments?: {
8
+ content_type: string;
9
+ filename: string;
10
+ height: number;
11
+ id: string;
12
+ size: number;
13
+ url: string;
14
+ width: number;
15
+ }[];
16
+ author: {
17
+ avatar: string;
18
+ bot: boolean;
19
+ id: string;
20
+ username: string;
21
+ };
22
+ channel_id: string;
23
+ content: string;
24
+ direct_message: boolean;
25
+ guild_id: string;
26
+ id: string;
27
+ member: {
28
+ joined_at: string;
29
+ };
30
+ seq: number;
31
+ seq_in_channel: string;
32
+ src_guild_id: string;
33
+ timestamp: string;
34
+ };
35
+
36
+ export type { DIRECT_MESSAGE_CREATE_TYPE };
@@ -0,0 +1,60 @@
1
+ /**
2
+ * 交互消息事件 | 按钮消息
3
+ * @param event
4
+ * @returns
5
+ */
6
+ type INTERACTION_CREATE_TYPE = {
7
+ application_id: string;
8
+ chat_type: 1;
9
+ data: {
10
+ resolved: {
11
+ button_data: string;
12
+ button_id: number;
13
+ };
14
+ type: number;
15
+ };
16
+ group_member_openid: string;
17
+ group_openid: string;
18
+ id: string;
19
+ scene: 'group';
20
+ timestamp: string;
21
+ type: number;
22
+ version: number;
23
+ } | {
24
+ application_id: string;
25
+ chat_type: 2;
26
+ data: {
27
+ resolved: {
28
+ button_data: string;
29
+ button_id: number;
30
+ };
31
+ type: number;
32
+ };
33
+ id: string;
34
+ scene: 'c2c';
35
+ timestamp: string;
36
+ type: number;
37
+ user_openid: string;
38
+ version: number;
39
+ } | {
40
+ application_id: string;
41
+ chat_type: 0;
42
+ data: {
43
+ resolved: {
44
+ message_id: string;
45
+ button_data: string;
46
+ button_id: number;
47
+ user_id: string;
48
+ };
49
+ type: number;
50
+ };
51
+ id: string;
52
+ scene: 'guild';
53
+ timestamp: string;
54
+ type: number;
55
+ guild_id: string;
56
+ channel_id: string;
57
+ version: number;
58
+ };
59
+
60
+ export type { INTERACTION_CREATE_TYPE };
@@ -0,0 +1,11 @@
1
+ type C2C_MESSAGE_CREATE_TYPE = {
2
+ author: {
3
+ id: string;
4
+ user_openid: string;
5
+ };
6
+ content: string;
7
+ id: string;
8
+ timestamp: string;
9
+ };
10
+
11
+ export type { C2C_MESSAGE_CREATE_TYPE };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alemonjs/qq-bot",
3
- "version": "2.1.0-alpha.11",
3
+ "version": "2.1.0-alpha.12",
4
4
  "description": "阿柠檬qqbot平台连接",
5
5
  "author": "lemonade",
6
6
  "license": "MIT",