@alemonjs/qq-bot 0.0.11 → 0.0.13

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 (53) hide show
  1. package/README.md +19 -8
  2. package/dist/assets/index.css +1 -1
  3. package/dist/assets/index.js +1 -1
  4. package/lib/api.d.ts +971 -843
  5. package/lib/api.js +1172 -1156
  6. package/lib/client.d.ts +22 -22
  7. package/lib/client.js +201 -217
  8. package/lib/config.js +2 -2
  9. package/lib/desktop.js +4 -2
  10. package/lib/from.js +27 -34
  11. package/lib/index.d.ts +3 -3
  12. package/lib/index.group.js +238 -0
  13. package/lib/index.guild.js +338 -0
  14. package/lib/index.js +43 -2
  15. package/lib/message/AT_MESSAGE_CREATE.d.ts +35 -35
  16. package/lib/message/C2C_MESSAGE_CREATE.d.ts +9 -9
  17. package/lib/message/CHANNEL_CREATE.d.ts +15 -15
  18. package/lib/message/CHANNEL_DELETE.d.ts +15 -15
  19. package/lib/message/CHANNEL_UPDATE.d.ts +15 -15
  20. package/lib/message/DIRECT_MESSAGE_CREATE.d.ts +29 -29
  21. package/lib/message/DIRECT_MESSAGE_DELETE.d.ts +17 -17
  22. package/lib/message/ERROR.d.ts +2 -2
  23. package/lib/message/GROUP_AT_MESSAGE_CREATE.d.ts +10 -10
  24. package/lib/message/GUILD_CREATE.d.ts +15 -15
  25. package/lib/message/GUILD_DELETE.d.ts +15 -15
  26. package/lib/message/GUILD_MEMBER_ADD.d.ts +14 -14
  27. package/lib/message/GUILD_MEMBER_REMOVE.d.ts +14 -14
  28. package/lib/message/GUILD_MEMBER_UPDATE.d.ts +14 -14
  29. package/lib/message/GUILD_UPDATE.d.ts +15 -15
  30. package/lib/message/INTERACTION_CREATE.d.ts +2 -2
  31. package/lib/message/MESSAGE_CREATE.d.ts +2 -2
  32. package/lib/message/MESSAGE_DELETE.d.ts +2 -2
  33. package/lib/message/MESSAGE_REACTION_ADD.d.ts +13 -13
  34. package/lib/message/MESSAGE_REACTION_REMOVE.d.ts +13 -13
  35. package/lib/message/PUBLIC_MESSAGE_DELETE.d.ts +15 -15
  36. package/lib/message/READY.d.ts +6 -6
  37. package/lib/message.d.ts +46 -46
  38. package/lib/sdk/api.d.ts +847 -0
  39. package/lib/sdk/api.js +1183 -0
  40. package/lib/sdk/client.js +228 -0
  41. package/lib/sdk/config.js +3 -0
  42. package/lib/sdk/counter.js +19 -0
  43. package/lib/sdk/from.js +44 -0
  44. package/lib/sdk/intents.js +102 -0
  45. package/lib/sdk/typing.d.ts +56 -0
  46. package/lib/sdk/webhook.secret.js +53 -0
  47. package/lib/sdk/websoket.group.js +221 -0
  48. package/lib/sdk/websoket.guild.js +203 -0
  49. package/lib/send/index.js +87 -21
  50. package/lib/typing.d.ts +62 -54
  51. package/lib/utils.js +14 -0
  52. package/lib/webhook.js +46 -48
  53. package/package.json +1 -7
@@ -1,37 +1,37 @@
1
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
- };
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
36
 
37
- export type { AT_MESSAGE_CREATE_TYPE };
37
+ export type { AT_MESSAGE_CREATE_TYPE }
@@ -1,11 +1,11 @@
1
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
- };
2
+ author: {
3
+ id: string
4
+ user_openid: string
5
+ }
6
+ content: string
7
+ id: string
8
+ timestamp: string
9
+ }
10
10
 
11
- export type { C2C_MESSAGE_CREATE_TYPE };
11
+ export type { C2C_MESSAGE_CREATE_TYPE }
@@ -1,17 +1,17 @@
1
1
  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
- };
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
+ }
16
16
 
17
- export type { CHANNEL_CREATE_TYPE };
17
+ export type { CHANNEL_CREATE_TYPE }
@@ -4,19 +4,19 @@
4
4
  * @returns
5
5
  */
6
6
  type CHANNEL_DELETE_TYPE = {
7
- application_id?: string;
8
- guild_id: string;
9
- id: string;
10
- name: string;
11
- op_user_id: string;
12
- owner_id: string;
13
- parent_id?: string;
14
- permissions?: string;
15
- position?: number;
16
- private_type: number;
17
- speak_permission: number;
18
- sub_type: number;
19
- type: number;
20
- };
7
+ application_id?: string
8
+ guild_id: string
9
+ id: string
10
+ name: string
11
+ op_user_id: string
12
+ owner_id: string
13
+ parent_id?: string
14
+ permissions?: string
15
+ position?: number
16
+ private_type: number
17
+ speak_permission: number
18
+ sub_type: number
19
+ type: number
20
+ }
21
21
 
22
- export type { CHANNEL_DELETE_TYPE };
22
+ export type { CHANNEL_DELETE_TYPE }
@@ -4,19 +4,19 @@
4
4
  * @returns
5
5
  */
6
6
  type CHANNEL_UPDATE_TYPE = {
7
- application_id?: string;
8
- guild_id: string;
9
- id: string;
10
- name: string;
11
- op_user_id: string;
12
- owner_id: string;
13
- parent_id?: string;
14
- permissions?: string;
15
- position?: number;
16
- private_type: number;
17
- speak_permission: number;
18
- sub_type: number;
19
- type: number;
20
- };
7
+ application_id?: string
8
+ guild_id: string
9
+ id: string
10
+ name: string
11
+ op_user_id: string
12
+ owner_id: string
13
+ parent_id?: string
14
+ permissions?: string
15
+ position?: number
16
+ private_type: number
17
+ speak_permission: number
18
+ sub_type: number
19
+ type: number
20
+ }
21
21
 
22
- export type { CHANNEL_UPDATE_TYPE };
22
+ export type { CHANNEL_UPDATE_TYPE }
@@ -4,33 +4,33 @@
4
4
  * @returns
5
5
  */
6
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
- };
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
35
 
36
- export type { DIRECT_MESSAGE_CREATE_TYPE };
36
+ export type { DIRECT_MESSAGE_CREATE_TYPE }
@@ -4,21 +4,21 @@
4
4
  * *
5
5
  */
6
6
  type DIRECT_MESSAGE_DELETE_TYPE = {
7
- message: {
8
- author: {
9
- bot: boolean;
10
- id: string;
11
- username: string;
12
- };
13
- channel_id: string;
14
- direct_message: boolean;
15
- guild_id: string;
16
- id: string;
17
- src_guild_id: string;
18
- };
19
- op_user: {
20
- id: string;
21
- };
22
- };
7
+ message: {
8
+ author: {
9
+ bot: boolean
10
+ id: string
11
+ username: string
12
+ }
13
+ channel_id: string
14
+ direct_message: boolean
15
+ guild_id: string
16
+ id: string
17
+ src_guild_id: string
18
+ }
19
+ op_user: {
20
+ id: string
21
+ }
22
+ }
23
23
 
24
- export type { DIRECT_MESSAGE_DELETE_TYPE };
24
+ export type { DIRECT_MESSAGE_DELETE_TYPE }
@@ -1,3 +1,3 @@
1
- type ERROR_TYPE = any;
1
+ type ERROR_TYPE = any
2
2
 
3
- export type { ERROR_TYPE };
3
+ export type { ERROR_TYPE }
@@ -2,15 +2,15 @@
2
2
  * 群消息事件 AT 事件
3
3
  */
4
4
  interface GROUP_AT_MESSAGE_CREATE_TYPE {
5
- author: {
6
- id: string;
7
- member_openid: string;
8
- };
9
- content: string;
10
- group_openid: string;
11
- group_id: string;
12
- id: string;
13
- timestamp: string;
5
+ author: {
6
+ id: string
7
+ member_openid: string
8
+ }
9
+ content: string
10
+ group_openid: string
11
+ group_id: string
12
+ id: string
13
+ timestamp: string
14
14
  }
15
15
 
16
- export type { GROUP_AT_MESSAGE_CREATE_TYPE };
16
+ export type { GROUP_AT_MESSAGE_CREATE_TYPE }
@@ -4,19 +4,19 @@
4
4
  * @returns
5
5
  */
6
6
  type GUILD_CREATE_TYPE = {
7
- description: string;
8
- icon: string;
9
- id: string;
10
- joined_at: string;
11
- max_members: number;
12
- member_count: number;
13
- name: string;
14
- op_user_id: string;
15
- owner: boolean;
16
- owner_id: string;
17
- union_appid: string;
18
- union_org_id: string;
19
- union_world_id: string;
20
- };
7
+ description: string
8
+ icon: string
9
+ id: string
10
+ joined_at: string
11
+ max_members: number
12
+ member_count: number
13
+ name: string
14
+ op_user_id: string
15
+ owner: boolean
16
+ owner_id: string
17
+ union_appid: string
18
+ union_org_id: string
19
+ union_world_id: string
20
+ }
21
21
 
22
- export type { GUILD_CREATE_TYPE };
22
+ export type { GUILD_CREATE_TYPE }
@@ -4,19 +4,19 @@
4
4
  * @returns
5
5
  */
6
6
  type GUILD_DELETE_TYPE = {
7
- description: string;
8
- icon: string;
9
- id: string;
10
- joined_at: string;
11
- max_members: number;
12
- member_count: number;
13
- name: string;
14
- op_user_id: string;
15
- owner: boolean;
16
- owner_id: string;
17
- union_appid: string;
18
- union_org_id: string;
19
- union_world_id: string;
20
- };
7
+ description: string
8
+ icon: string
9
+ id: string
10
+ joined_at: string
11
+ max_members: number
12
+ member_count: number
13
+ name: string
14
+ op_user_id: string
15
+ owner: boolean
16
+ owner_id: string
17
+ union_appid: string
18
+ union_org_id: string
19
+ union_world_id: string
20
+ }
21
21
 
22
- export type { GUILD_DELETE_TYPE };
22
+ export type { GUILD_DELETE_TYPE }
@@ -4,18 +4,18 @@
4
4
  * @returns
5
5
  */
6
6
  type GUILD_MEMBER_ADD_TYPE = {
7
- guild_id: string;
8
- joined_at: string;
9
- nick: string;
10
- op_user_id: string;
11
- roles: string[];
12
- source_type?: string;
13
- user: {
14
- avatar: string;
15
- bot: number;
16
- id: string;
17
- username: string;
18
- };
19
- };
7
+ guild_id: string
8
+ joined_at: string
9
+ nick: string
10
+ op_user_id: string
11
+ roles: string[]
12
+ source_type?: string
13
+ user: {
14
+ avatar: string
15
+ bot: number
16
+ id: string
17
+ username: string
18
+ }
19
+ }
20
20
 
21
- export type { GUILD_MEMBER_ADD_TYPE };
21
+ export type { GUILD_MEMBER_ADD_TYPE }
@@ -4,18 +4,18 @@
4
4
  * @returns
5
5
  */
6
6
  type GUILD_MEMBER_REMOVE_TYPE = {
7
- guild_id: string;
8
- joined_at: string;
9
- nick: string;
10
- op_user_id: string;
11
- roles: string[];
12
- source_type?: string;
13
- user: {
14
- avatar: string;
15
- bot: number;
16
- id: string;
17
- username: string;
18
- };
19
- };
7
+ guild_id: string
8
+ joined_at: string
9
+ nick: string
10
+ op_user_id: string
11
+ roles: string[]
12
+ source_type?: string
13
+ user: {
14
+ avatar: string
15
+ bot: number
16
+ id: string
17
+ username: string
18
+ }
19
+ }
20
20
 
21
- export type { GUILD_MEMBER_REMOVE_TYPE };
21
+ export type { GUILD_MEMBER_REMOVE_TYPE }
@@ -4,18 +4,18 @@
4
4
  * @returns
5
5
  */
6
6
  type GUILD_MEMBER_UPDATE_TYPE = {
7
- guild_id: string;
8
- joined_at: string;
9
- nick: string;
10
- op_user_id: string;
11
- roles: string[];
12
- source_type?: string;
13
- user: {
14
- avatar: string;
15
- bot: number;
16
- id: string;
17
- username: string;
18
- };
19
- };
7
+ guild_id: string
8
+ joined_at: string
9
+ nick: string
10
+ op_user_id: string
11
+ roles: string[]
12
+ source_type?: string
13
+ user: {
14
+ avatar: string
15
+ bot: number
16
+ id: string
17
+ username: string
18
+ }
19
+ }
20
20
 
21
- export type { GUILD_MEMBER_UPDATE_TYPE };
21
+ export type { GUILD_MEMBER_UPDATE_TYPE }
@@ -4,19 +4,19 @@
4
4
  * @returns
5
5
  */
6
6
  type GUILD_UPDATE_TYPE = {
7
- description: string;
8
- icon: string;
9
- id: string;
10
- joined_at: string;
11
- max_members: number;
12
- member_count: number;
13
- name: string;
14
- op_user_id: string;
15
- owner: boolean;
16
- owner_id: string;
17
- union_appid: string;
18
- union_org_id: string;
19
- union_world_id: string;
20
- };
7
+ description: string
8
+ icon: string
9
+ id: string
10
+ joined_at: string
11
+ max_members: number
12
+ member_count: number
13
+ name: string
14
+ op_user_id: string
15
+ owner: boolean
16
+ owner_id: string
17
+ union_appid: string
18
+ union_org_id: string
19
+ union_world_id: string
20
+ }
21
21
 
22
- export type { GUILD_UPDATE_TYPE };
22
+ export type { GUILD_UPDATE_TYPE }
@@ -3,6 +3,6 @@
3
3
  * @param event
4
4
  * @returns
5
5
  */
6
- type INTERACTION_CREATE_TYPE = any;
6
+ type INTERACTION_CREATE_TYPE = any
7
7
 
8
- export type { INTERACTION_CREATE_TYPE };
8
+ export type { INTERACTION_CREATE_TYPE }
@@ -6,6 +6,6 @@
6
6
  * @param event
7
7
  * @returns
8
8
  */
9
- type MESSAGE_CREATE_TYPE = any;
9
+ type MESSAGE_CREATE_TYPE = any
10
10
 
11
- export type { MESSAGE_CREATE_TYPE };
11
+ export type { MESSAGE_CREATE_TYPE }
@@ -6,6 +6,6 @@
6
6
  * @param event
7
7
  * @returns
8
8
  */
9
- type MESSAGE_DELETE_TYPE = any;
9
+ type MESSAGE_DELETE_TYPE = any
10
10
 
11
- export type { MESSAGE_DELETE_TYPE };
11
+ export type { MESSAGE_DELETE_TYPE }
@@ -1,15 +1,15 @@
1
1
  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
- };
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
+ }
14
14
 
15
- export type { MESSAGE_REACTION_ADD_TYPE };
15
+ export type { MESSAGE_REACTION_ADD_TYPE }
@@ -1,15 +1,15 @@
1
1
  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
- };
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
+ }
14
14
 
15
- export type { MESSAGE_REACTION_REMOVE_TYPE };
15
+ export type { MESSAGE_REACTION_REMOVE_TYPE }