@alemonjs/qq-bot 0.0.8 → 0.0.10

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 (41) hide show
  1. package/README.md +2 -1
  2. package/dist/assets/index.css +476 -0
  3. package/dist/assets/index.js +11032 -0
  4. package/dist/index.html +15 -0
  5. package/lib/api.d.ts +975 -0
  6. package/lib/api.js +1172 -1156
  7. package/lib/client.d.ts +26 -0
  8. package/lib/client.js +201 -217
  9. package/lib/config.js +2 -2
  10. package/lib/desktop.d.ts +3 -0
  11. package/lib/desktop.js +66 -0
  12. package/lib/from.js +27 -34
  13. package/lib/index.d.ts +4 -1
  14. package/lib/index.js +406 -405
  15. package/lib/message/AT_MESSAGE_CREATE.d.ts +37 -0
  16. package/lib/message/C2C_MESSAGE_CREATE.d.ts +11 -0
  17. package/lib/message/CHANNEL_CREATE.d.ts +17 -0
  18. package/lib/message/CHANNEL_DELETE.d.ts +22 -0
  19. package/lib/message/CHANNEL_UPDATE.d.ts +22 -0
  20. package/lib/message/DIRECT_MESSAGE_CREATE.d.ts +36 -0
  21. package/lib/message/DIRECT_MESSAGE_DELETE.d.ts +24 -0
  22. package/lib/message/ERROR.d.ts +3 -0
  23. package/lib/message/GROUP_AT_MESSAGE_CREATE.d.ts +16 -0
  24. package/lib/message/GUILD_CREATE.d.ts +22 -0
  25. package/lib/message/GUILD_DELETE.d.ts +22 -0
  26. package/lib/message/GUILD_MEMBER_ADD.d.ts +21 -0
  27. package/lib/message/GUILD_MEMBER_REMOVE.d.ts +21 -0
  28. package/lib/message/GUILD_MEMBER_UPDATE.d.ts +21 -0
  29. package/lib/message/GUILD_UPDATE.d.ts +22 -0
  30. package/lib/message/INTERACTION_CREATE.d.ts +8 -0
  31. package/lib/message/MESSAGE_CREATE.d.ts +11 -0
  32. package/lib/message/MESSAGE_DELETE.d.ts +11 -0
  33. package/lib/message/MESSAGE_REACTION_ADD.d.ts +15 -0
  34. package/lib/message/MESSAGE_REACTION_REMOVE.d.ts +15 -0
  35. package/lib/message/PUBLIC_MESSAGE_DELETE.d.ts +21 -0
  36. package/lib/message/READY.d.ts +11 -0
  37. package/lib/message.d.ts +49 -0
  38. package/lib/send/index.js +230 -192
  39. package/lib/typing.d.ts +73 -0
  40. package/lib/webhook.js +46 -48
  41. package/package.json +24 -2
@@ -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,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 }
@@ -0,0 +1,17 @@
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
+ }
16
+
17
+ export type { CHANNEL_CREATE_TYPE }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * 子频道删除
3
+ * @param event
4
+ * @returns
5
+ */
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
+ }
21
+
22
+ export type { CHANNEL_DELETE_TYPE }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * 子频道更新
3
+ * @param event
4
+ * @returns
5
+ */
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
+ }
21
+
22
+ export type { CHANNEL_UPDATE_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,24 @@
1
+ /**
2
+ * *
3
+ * 私信
4
+ * *
5
+ */
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
+ }
23
+
24
+ export type { DIRECT_MESSAGE_DELETE_TYPE }
@@ -0,0 +1,3 @@
1
+ type ERROR_TYPE = any
2
+
3
+ export type { ERROR_TYPE }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * 群消息事件 AT 事件
3
+ */
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
14
+ }
15
+
16
+ export type { GROUP_AT_MESSAGE_CREATE_TYPE }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * 机器人加入
3
+ * @param event
4
+ * @returns
5
+ */
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
+ }
21
+
22
+ export type { GUILD_CREATE_TYPE }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * 机器人退出频道
3
+ * @param event
4
+ * @returns
5
+ */
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
+ }
21
+
22
+ export type { GUILD_DELETE_TYPE }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * 当成员加入时
3
+ * @param event
4
+ * @returns
5
+ */
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
+ }
20
+
21
+ export type { GUILD_MEMBER_ADD_TYPE }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * 当成员被移除时
3
+ * @param event
4
+ * @returns
5
+ */
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
+ }
20
+
21
+ export type { GUILD_MEMBER_REMOVE_TYPE }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * 当成员资料变更时
3
+ * @param event
4
+ * @returns
5
+ */
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
+ }
20
+
21
+ export type { GUILD_MEMBER_UPDATE_TYPE }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * 信息更新
3
+ * @param event
4
+ * @returns
5
+ */
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
+ }
21
+
22
+ export type { GUILD_UPDATE_TYPE }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 交互消息事件 | 按钮消息
3
+ * @param event
4
+ * @returns
5
+ */
6
+ type INTERACTION_CREATE_TYPE = any
7
+
8
+ export type { INTERACTION_CREATE_TYPE }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * *私域*
3
+ */
4
+ /**
5
+ * 频道内的全部消息
6
+ * @param event
7
+ * @returns
8
+ */
9
+ type MESSAGE_CREATE_TYPE = any
10
+
11
+ export type { MESSAGE_CREATE_TYPE }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * *私域*
3
+ */
4
+ /**
5
+ * 删除(撤回)消息事件
6
+ * @param event
7
+ * @returns
8
+ */
9
+ type MESSAGE_DELETE_TYPE = any
10
+
11
+ export type { MESSAGE_DELETE_TYPE }
@@ -0,0 +1,15 @@
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
+ }
14
+
15
+ export type { MESSAGE_REACTION_ADD_TYPE }
@@ -0,0 +1,15 @@
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
+ }
14
+
15
+ export type { MESSAGE_REACTION_REMOVE_TYPE }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * 公域
3
+ * @param event
4
+ */
5
+ type PUBLIC_MESSAGE_DELETE_TYPE = {
6
+ message: {
7
+ author: {
8
+ bot: false
9
+ id: string
10
+ username: string
11
+ }
12
+ channel_id: string
13
+ guild_id: string
14
+ id: string
15
+ }
16
+ op_user: {
17
+ id: string
18
+ }
19
+ }
20
+
21
+ export type { PUBLIC_MESSAGE_DELETE_TYPE }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 登录
3
+ */
4
+ type READY_TYPE = {
5
+ user: {
6
+ id: string
7
+ name: string
8
+ }
9
+ }
10
+
11
+ export type { READY_TYPE }
@@ -0,0 +1,49 @@
1
+ import { C2C_MESSAGE_CREATE_TYPE } from './message/C2C_MESSAGE_CREATE.js'
2
+ import { GROUP_AT_MESSAGE_CREATE_TYPE } from './message/GROUP_AT_MESSAGE_CREATE.js'
3
+ import { AT_MESSAGE_CREATE_TYPE } from './message/AT_MESSAGE_CREATE.js'
4
+ import { CHANNEL_CREATE_TYPE } from './message/CHANNEL_CREATE.js'
5
+ import { CHANNEL_DELETE_TYPE } from './message/CHANNEL_DELETE.js'
6
+ import { CHANNEL_UPDATE_TYPE } from './message/CHANNEL_UPDATE.js'
7
+ import { DIRECT_MESSAGE_CREATE_TYPE } from './message/DIRECT_MESSAGE_CREATE.js'
8
+ import { DIRECT_MESSAGE_DELETE_TYPE } from './message/DIRECT_MESSAGE_DELETE.js'
9
+ import { GUILD_CREATE_TYPE } from './message/GUILD_CREATE.js'
10
+ import { GUILD_DELETE_TYPE } from './message/GUILD_DELETE.js'
11
+ import { GUILD_MEMBER_ADD_TYPE } from './message/GUILD_MEMBER_ADD.js'
12
+ import { GUILD_MEMBER_REMOVE_TYPE } from './message/GUILD_MEMBER_REMOVE.js'
13
+ import { GUILD_MEMBER_UPDATE_TYPE } from './message/GUILD_MEMBER_UPDATE.js'
14
+ import { GUILD_UPDATE_TYPE } from './message/GUILD_UPDATE.js'
15
+ import { INTERACTION_CREATE_TYPE } from './message/INTERACTION_CREATE.js'
16
+ import { MESSAGE_CREATE_TYPE } from './message/MESSAGE_CREATE.js'
17
+ import { MESSAGE_DELETE_TYPE } from './message/MESSAGE_DELETE.js'
18
+ import { MESSAGE_REACTION_ADD_TYPE } from './message/MESSAGE_REACTION_ADD.js'
19
+ import { MESSAGE_REACTION_REMOVE_TYPE } from './message/MESSAGE_REACTION_REMOVE.js'
20
+ import { PUBLIC_MESSAGE_DELETE_TYPE } from './message/PUBLIC_MESSAGE_DELETE.js'
21
+ import { READY_TYPE } from './message/READY.js'
22
+ import { ERROR_TYPE } from './message/ERROR.js'
23
+
24
+ type QQBotEventMap = {
25
+ AT_MESSAGE_CREATE: AT_MESSAGE_CREATE_TYPE
26
+ CHANNEL_CREATE: CHANNEL_CREATE_TYPE
27
+ CHANNEL_DELETE: CHANNEL_DELETE_TYPE
28
+ CHANNEL_UPDATE: CHANNEL_UPDATE_TYPE
29
+ DIRECT_MESSAGE_CREATE: DIRECT_MESSAGE_CREATE_TYPE
30
+ DIRECT_MESSAGE_DELETE: DIRECT_MESSAGE_DELETE_TYPE
31
+ GUILD_CREATE: GUILD_CREATE_TYPE
32
+ GUILD_DELETE: GUILD_DELETE_TYPE
33
+ GUILD_MEMBER_ADD: GUILD_MEMBER_ADD_TYPE
34
+ GUILD_MEMBER_REMOVE: GUILD_MEMBER_REMOVE_TYPE
35
+ GUILD_MEMBER_UPDATE: GUILD_MEMBER_UPDATE_TYPE
36
+ GUILD_UPDATE: GUILD_UPDATE_TYPE
37
+ INTERACTION_CREATE: INTERACTION_CREATE_TYPE
38
+ MESSAGE_CREATE: MESSAGE_CREATE_TYPE
39
+ MESSAGE_DELETE: MESSAGE_DELETE_TYPE
40
+ MESSAGE_REACTION_ADD: MESSAGE_REACTION_ADD_TYPE
41
+ MESSAGE_REACTION_REMOVE: MESSAGE_REACTION_REMOVE_TYPE
42
+ PUBLIC_MESSAGE_DELETE: PUBLIC_MESSAGE_DELETE_TYPE
43
+ READY: READY_TYPE
44
+ C2C_MESSAGE_CREATE: C2C_MESSAGE_CREATE_TYPE
45
+ GROUP_AT_MESSAGE_CREATE: GROUP_AT_MESSAGE_CREATE_TYPE
46
+ ERROR: ERROR_TYPE
47
+ }
48
+
49
+ export type { QQBotEventMap }