@alemonjs/qq-bot 2.1.36 → 2.1.37

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 +66 -1981
  2. package/lib/config.d.ts +2 -0
  3. package/lib/framework-actions.d.ts +75 -0
  4. package/lib/framework-actions.js +620 -0
  5. package/lib/framework-events.d.ts +10 -0
  6. package/lib/framework-events.js +182 -0
  7. package/lib/hook.d.ts +16 -12
  8. package/lib/hook.js +5 -9
  9. package/lib/index.d.ts +5 -1
  10. package/lib/index.websoket.js +6 -2
  11. package/lib/message/AUDIO_EVENT.d.ts +20 -0
  12. package/lib/message/AUDIO_EVENT.js +1 -0
  13. package/lib/message/FORUM_EVENT.d.ts +33 -0
  14. package/lib/message/FORUM_EVENT.js +1 -0
  15. package/lib/message/GUILD_AUDIT.d.ts +14 -0
  16. package/lib/message/GUILD_AUDIT.js +1 -0
  17. package/lib/message/INTERACTION_CREATE.d.ts +13 -20
  18. package/lib/message/MESSAGE_CREATE.d.ts +3 -9
  19. package/lib/message/MESSAGE_DELETE.d.ts +15 -1
  20. package/lib/message/group/C2C_MESSAGE_CREATE.d.ts +3 -13
  21. package/lib/message/group/C2C_MSG_RECEIVE.d.ts +1 -1
  22. package/lib/message/group/C2C_MSG_REJECT.d.ts +1 -1
  23. package/lib/message/group/FRIEND_ADD.d.ts +7 -1
  24. package/lib/message/group/FRIEND_DEL.d.ts +4 -1
  25. package/lib/message/group/GROUP_AT_MESSAGE_CREATE.d.ts +6 -27
  26. package/lib/message/group/GROUP_MEMBER_ADD.d.ts +4 -2
  27. package/lib/message/group/GROUP_MEMBER_REMOVE.d.ts +4 -2
  28. package/lib/message/group/GROUP_MESSAGE_CREATE.d.ts +6 -27
  29. package/lib/message/group/GROUP_MSG_RECEIVE.d.ts +1 -1
  30. package/lib/message/group/GROUP_MSG_REJECT.d.ts +1 -1
  31. package/lib/message/group/MESSAGE_AUDIT_PASS.d.ts +2 -0
  32. package/lib/message/group/MESSAGE_AUDIT_REJECT.d.ts +2 -0
  33. package/lib/message/group/SUBSCRIBE_MESSAGE_STATUS.d.ts +17 -0
  34. package/lib/message/group/SUBSCRIBE_MESSAGE_STATUS.js +1 -0
  35. package/lib/register.d.ts +1 -0
  36. package/lib/register.js +279 -115
  37. package/lib/sdk/api.d.ts +93 -14
  38. package/lib/sdk/api.js +241 -45
  39. package/lib/sdk/client.webhook.js +2 -1
  40. package/lib/sdk/client.websoket.js +2 -1
  41. package/lib/sdk/intents.d.ts +1 -0
  42. package/lib/sdk/intents.js +1 -0
  43. package/lib/sdk/message.d.ts +1 -1
  44. package/lib/sdk/message.group.d.ts +4 -2
  45. package/lib/sdk/message.guild.d.ts +19 -0
  46. package/lib/sdk/non-channel-types.d.ts +138 -0
  47. package/lib/sdk/non-channel-types.js +1 -0
  48. package/lib/sdk/registry.js +2 -2
  49. package/lib/sdk/typing.d.ts +13 -1
  50. package/lib/sends.d.ts +3 -3
  51. package/lib/sends.js +46 -10
  52. package/lib/upload.js +13 -37
  53. package/package.json +7 -4
package/lib/config.d.ts CHANGED
@@ -3,6 +3,8 @@ import { Options as Options$1 } from "./sdk/typing.js";
3
3
  declare const platform = "qq-bot";
4
4
  declare const platformFullName = "@alemonjs/qq-bot";
5
5
  type Options = {
6
+ /** 按钮/快捷菜单自动 ACK。设为 false 后由应用 useInteraction().ack() 回应。 */
7
+ autoInteractionAck?: boolean;
6
8
  /**
7
9
  * 主人-用户KEY
8
10
  */
@@ -0,0 +1,75 @@
1
+ import { QQBotAPI } from "./sdk/api.js";
2
+ import { OutgoingMessage } from "alemonjs";
3
+ //#region src/framework-actions.d.ts
4
+ declare const toQQMessage: (content: OutgoingMessage) => {
5
+ msg_type: 0 | 2 | 3 | 7;
6
+ content: string;
7
+ markdown: {
8
+ content: string;
9
+ custom_template_id: string;
10
+ template_id: number;
11
+ params: {
12
+ key: string;
13
+ values: string[];
14
+ }[];
15
+ force_verify_image_resource: boolean;
16
+ };
17
+ media: {
18
+ file_info: string;
19
+ };
20
+ ark: {
21
+ template_id: number;
22
+ kv: {
23
+ key: string;
24
+ value: string;
25
+ obj: {
26
+ obj_kv: {
27
+ key: string;
28
+ value: string;
29
+ }[];
30
+ }[];
31
+ }[];
32
+ };
33
+ keyboard: {
34
+ id: string;
35
+ content: {
36
+ rows: {
37
+ buttons: {
38
+ id: string;
39
+ group_id: string;
40
+ render_data: {
41
+ label: string;
42
+ visited_label: string;
43
+ style: number;
44
+ };
45
+ action: {
46
+ type: number;
47
+ data: string;
48
+ permission: {
49
+ type: number;
50
+ specify_user_ids: string[];
51
+ specify_role_ids: string[];
52
+ };
53
+ enter: boolean;
54
+ reply: boolean;
55
+ unsupport_tips: string;
56
+ anchor: number;
57
+ click_limit: number;
58
+ modal: {
59
+ content: string;
60
+ confirm_text: string;
61
+ cancel_text: string;
62
+ };
63
+ };
64
+ }[];
65
+ }[];
66
+ };
67
+ };
68
+ };
69
+ /** Translate semantic framework actions. Undefined means a legacy/channel action. */
70
+ declare const handleFrameworkAction: (client: QQBotAPI, data: {
71
+ action: string;
72
+ payload: any;
73
+ }, botId: string) => Promise<import("alemonjs/common").Result<any>[]>;
74
+ //#endregion
75
+ export { handleFrameworkAction, toQQMessage };