@onebots/adapter-icqq 1.0.0

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/bot.d.ts ADDED
@@ -0,0 +1,178 @@
1
+ /**
2
+ * ICQQ Bot 封装
3
+ * 基于 @icqqjs/icqq 库封装的机器人客户端
4
+ */
5
+ import { EventEmitter } from 'events';
6
+ import { Client, segment as Segment } from '@icqqjs/icqq';
7
+ import type { ICQQConfig, ICQQUser, ICQQFriend, ICQQGroup, ICQQGroupMember } from './types.js';
8
+ export declare class ICQQBot extends EventEmitter {
9
+ private config;
10
+ private client;
11
+ private ready;
12
+ private loginInfo;
13
+ constructor(config: ICQQConfig);
14
+ /**
15
+ * 获取 ICQQ 客户端实例
16
+ */
17
+ getClient(): Client | null;
18
+ /**
19
+ * 是否已就绪
20
+ */
21
+ isReady(): boolean;
22
+ /**
23
+ * 获取登录信息
24
+ */
25
+ getLoginInfo(): ICQQUser | null;
26
+ /**
27
+ * 启动 Bot
28
+ */
29
+ start(): Promise<void>;
30
+ /**
31
+ * 停止 Bot
32
+ */
33
+ stop(): Promise<void>;
34
+ /**
35
+ * 设置事件监听器
36
+ */
37
+ private setupEventListeners;
38
+ /**
39
+ * 转换私聊消息
40
+ */
41
+ private convertPrivateMessage;
42
+ /**
43
+ * 转换群消息
44
+ */
45
+ private convertGroupMessage;
46
+ /**
47
+ * 转换消息段
48
+ */
49
+ private convertMessage;
50
+ /**
51
+ * 发送私聊消息
52
+ */
53
+ sendPrivateMessage(userId: number, message: string | any[]): Promise<any>;
54
+ /**
55
+ * 发送群消息
56
+ */
57
+ sendGroupMessage(groupId: number, message: string | any[]): Promise<any>;
58
+ /**
59
+ * 撤回消息
60
+ */
61
+ recallMessage(messageId: string): Promise<boolean>;
62
+ /**
63
+ * 获取消息
64
+ */
65
+ getMessage(messageId: string): Promise<any>;
66
+ /**
67
+ * 获取好友列表
68
+ */
69
+ getFriendList(): Promise<ICQQFriend[]>;
70
+ /**
71
+ * 获取陌生人信息
72
+ */
73
+ getStrangerInfo(userId: number): Promise<ICQQUser>;
74
+ /**
75
+ * 处理好友申请
76
+ */
77
+ handleFriendRequest(flag: string, approve: boolean, remark?: string): Promise<boolean>;
78
+ /**
79
+ * 删除好友
80
+ */
81
+ deleteFriend(userId: number): Promise<boolean>;
82
+ /**
83
+ * 获取群列表
84
+ */
85
+ getGroupList(): Promise<ICQQGroup[]>;
86
+ /**
87
+ * 获取群信息
88
+ */
89
+ getGroupInfo(groupId: number): Promise<ICQQGroup | undefined>;
90
+ /**
91
+ * 获取群成员列表
92
+ */
93
+ getGroupMemberList(groupId: number): Promise<ICQQGroupMember[]>;
94
+ /**
95
+ * 获取群成员信息
96
+ */
97
+ getGroupMemberInfo(groupId: number, userId: number): Promise<ICQQGroupMember | undefined>;
98
+ /**
99
+ * 处理群申请/邀请
100
+ */
101
+ handleGroupRequest(flag: string, approve: boolean, reason?: string): Promise<boolean>;
102
+ /**
103
+ * 设置群名片
104
+ */
105
+ setGroupCard(groupId: number, userId: number, card: string): Promise<boolean>;
106
+ /**
107
+ * 踢出群成员
108
+ */
109
+ kickGroupMember(groupId: number, userId: number, rejectAddRequest?: boolean): Promise<boolean>;
110
+ /**
111
+ * 禁言群成员
112
+ */
113
+ muteGroupMember(groupId: number, userId: number, duration: number): Promise<boolean>;
114
+ /**
115
+ * 全员禁言
116
+ */
117
+ muteGroupAll(groupId: number, enable: boolean): Promise<boolean>;
118
+ /**
119
+ * 设置群管理员
120
+ */
121
+ setGroupAdmin(groupId: number, userId: number, enable: boolean): Promise<boolean>;
122
+ /**
123
+ * 退出群
124
+ */
125
+ leaveGroup(groupId: number, dismiss?: boolean): Promise<boolean>;
126
+ /**
127
+ * 设置群名
128
+ */
129
+ setGroupName(groupId: number, name: string): Promise<boolean>;
130
+ /**
131
+ * 设置群头像
132
+ */
133
+ setGroupAvatar(groupId: number, file: string): Promise<void>;
134
+ /**
135
+ * 提交滑块 ticket
136
+ */
137
+ submitSlider(ticket: string): void;
138
+ /**
139
+ * 提交短信验证码
140
+ */
141
+ submitSmsCode(code: string): void;
142
+ /**
143
+ * 扫码登录
144
+ */
145
+ qrcodeLogin(): void;
146
+ /**
147
+ * 获取消息段构造器
148
+ */
149
+ static get segment(): {
150
+ long_msg(resid: string): import("@icqqjs/icqq/lib/message/elements.js").LongMsgElem;
151
+ text(text: string): import("@icqqjs/icqq").TextElem;
152
+ face(id: number, big?: boolean): import("@icqqjs/icqq").FaceElem;
153
+ sface(id: number, text?: string): import("@icqqjs/icqq").FaceElem;
154
+ bface(file: string, text: string): import("@icqqjs/icqq").BfaceElem;
155
+ rps(id?: number): import("@icqqjs/icqq").MfaceElem;
156
+ dice(id?: number): import("@icqqjs/icqq").MfaceElem;
157
+ at(qq: number | "all" | string, text?: string, dummy?: boolean): import("@icqqjs/icqq").AtElem;
158
+ image(file: import("@icqqjs/icqq").ImageElem["file"], cache?: boolean, timeout?: number, headers?: import("http").OutgoingHttpHeaders): import("@icqqjs/icqq").ImageElem;
159
+ flash(file: import("@icqqjs/icqq").ImageElem["file"], cache?: boolean, timeout?: number, headers?: import("http").OutgoingHttpHeaders): import("@icqqjs/icqq").FlashElem;
160
+ record(file: string | Buffer, data?: Partial<Omit<import("@icqqjs/icqq").PttElem, "type" | "file">>): import("@icqqjs/icqq").PttElem;
161
+ video(file: string | Buffer, data?: Partial<Omit<import("@icqqjs/icqq").VideoElem, "type" | "file">>): import("@icqqjs/icqq").VideoElem;
162
+ bubble(file: string | Buffer, data?: Partial<Omit<import("@icqqjs/icqq/lib/message/elements.js").BubbleElem, "type" | "file">>): import("@icqqjs/icqq/lib/message/elements.js").BubbleElem;
163
+ json(data: any): import("@icqqjs/icqq").JsonElem;
164
+ xml(data: string, id?: number): import("@icqqjs/icqq").XmlElem;
165
+ markdown(content: string, config?: import("@icqqjs/icqq/lib/message/elements.js").MarkdownElem["config"]): import("@icqqjs/icqq/lib/message/elements.js").MarkdownElem;
166
+ button(content: import("@icqqjs/icqq/lib/message/elements.js").ButtonElem["content"]): import("@icqqjs/icqq/lib/message/elements.js").ButtonElem;
167
+ mirai(data: string): import("@icqqjs/icqq").MiraiElem;
168
+ fake(user_id: number, message: import("@icqqjs/icqq").Sendable, nickname?: string, time?: number): import("@icqqjs/icqq").ForwardNodeElem;
169
+ share(url: string, title: string, image?: string, content?: string, audio?: string): import("@icqqjs/icqq").ShareElem;
170
+ location(lat: number, lng: number, address: string, id?: string): import("@icqqjs/icqq").LocationElem;
171
+ poke(id: number): import("@icqqjs/icqq").PokeElem;
172
+ node(user_id: number, message: import("@icqqjs/icqq").Sendable, nickname?: string, time?: number, seq?: number, rand?: number, preview?: string): import("@icqqjs/icqq").ForwardNodeElem;
173
+ multimsg(resid: string, filename: string, preview?: string[] | string, title?: string, content?: string, prompt?: string): import("@icqqjs/icqq/lib/message/elements.js").MultiMsgElem;
174
+ fromCqcode(str: string): import("@icqqjs/icqq").MessageElem[];
175
+ };
176
+ }
177
+ export { Segment as segment };
178
+ //# sourceMappingURL=bot.d.ts.map