mirai-js 2.5.0 → 2.7.0-beta.1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.github/FUNDING.yml +1 -1
- package/README.md +5 -0
- package/dist/browser/mirai-js.js +1 -1
- package/dist/node/BaseType.d.ts +16 -0
- package/dist/node/Bot.d.ts +2 -2
- package/dist/node/ForwardNode.d.ts +15 -0
- package/dist/node/ForwardNode.js +70 -0
- package/dist/node/Message.d.ts +20 -1
- package/dist/node/Message.js +51 -0
- package/dist/node/core/anno/deleteAnno.js +1 -1
- package/dist/node/core/anno/getAnno.js +1 -1
- package/dist/node/core/anno/publishAnno.js +1 -1
- package/dist/node/core/auth.js +1 -1
- package/dist/node/core/fs/deleteGroupFile.js +1 -1
- package/dist/node/core/fs/getGroupFileInfo.js +1 -1
- package/dist/node/core/fs/getGroupFileList.js +1 -1
- package/dist/node/core/fs/makeGroupDir.js +1 -1
- package/dist/node/core/fs/moveGroupFile.js +1 -1
- package/dist/node/core/fs/renameGroupFile.js +1 -1
- package/dist/node/core/fs/uploadGroupFIle.js +1 -1
- package/dist/node/core/getFriendList.js +1 -1
- package/dist/node/core/getGroupConfig.js +1 -1
- package/dist/node/core/getGroupList.js +1 -1
- package/dist/node/core/getMemberInfo.js +1 -1
- package/dist/node/core/getMemberList.js +1 -1
- package/dist/node/core/getSessionConfig.js +1 -1
- package/dist/node/core/getUserProfile.js +1 -1
- package/dist/node/core/mute.js +1 -1
- package/dist/node/core/muteAll.js +1 -1
- package/dist/node/core/quitGroup.js +1 -1
- package/dist/node/core/recall.js +1 -1
- package/dist/node/core/releaseSession.js +1 -1
- package/dist/node/core/removeFriend.js +1 -1
- package/dist/node/core/removeMember.js +1 -1
- package/dist/node/core/responseBotInvitedJoinGroupRequest.js +1 -1
- package/dist/node/core/responseFirendRequest.js +1 -1
- package/dist/node/core/responseMemberJoinRequest.js +1 -1
- package/dist/node/core/sendCommand.js +1 -1
- package/dist/node/core/sendFriendMessage.js +1 -1
- package/dist/node/core/sendGroupMessage.js +1 -1
- package/dist/node/core/sendNudge.js +1 -1
- package/dist/node/core/sendTempMessage.js +1 -1
- package/dist/node/core/setEssence.js +1 -1
- package/dist/node/core/setGroupConfig.js +1 -1
- package/dist/node/core/setMemberAdmin.js +1 -1
- package/dist/node/core/setMemberInfo.js +1 -1
- package/dist/node/core/setSessionConfig.js +1 -1
- package/dist/node/core/startListeningBrowser.js +1 -1
- package/dist/node/core/startListeningNode.js +1 -1
- package/dist/node/core/stopListeningBrowser.js +1 -1
- package/dist/node/core/stopListeningNode.js +1 -1
- package/dist/node/core/unmute.js +1 -1
- package/dist/node/core/unmuteAll.js +1 -1
- package/dist/node/core/uploadImage.js +1 -1
- package/dist/node/core/uploadVoice.js +1 -1
- package/dist/node/core/verify.js +1 -1
- package/dist/node/index.d.ts +8 -3
- package/dist/node/index.js +12 -9
- package/dist/node/polyfill/URL.js +1 -1
- package/dist/node/polyfill/wsListener.js +2 -2
- package/package.json +2 -2
- package/src/BaseType.d.ts +16 -0
- package/src/Bot.d.ts +2 -2
- package/src/Message.d.ts +20 -1
- package/src/Message.js +39 -0
- package/src/core/anno/deleteAnno.js +1 -1
- package/src/core/anno/getAnno.js +1 -1
- package/src/core/anno/publishAnno.js +1 -1
- package/src/core/auth.js +1 -1
- package/src/core/fs/deleteGroupFile.js +1 -1
- package/src/core/fs/getGroupFileInfo.js +1 -1
- package/src/core/fs/getGroupFileList.js +1 -1
- package/src/core/fs/makeGroupDir.js +1 -1
- package/src/core/fs/moveGroupFile.js +1 -1
- package/src/core/fs/renameGroupFile.js +1 -1
- package/src/core/fs/uploadGroupFIle.js +1 -1
- package/src/core/getFriendList.js +1 -1
- package/src/core/getGroupConfig.js +1 -1
- package/src/core/getGroupList.js +1 -1
- package/src/core/getMemberInfo.js +1 -1
- package/src/core/getMemberList.js +1 -1
- package/src/core/getSessionConfig.js +1 -1
- package/src/core/getUserProfile.js +1 -1
- package/src/core/mute.js +1 -1
- package/src/core/muteAll.js +1 -1
- package/src/core/quitGroup.js +1 -1
- package/src/core/recall.js +1 -1
- package/src/core/releaseSession.js +1 -1
- package/src/core/removeFriend.js +1 -1
- package/src/core/removeMember.js +1 -1
- package/src/core/responseBotInvitedJoinGroupRequest.js +1 -1
- package/src/core/responseFirendRequest.js +1 -1
- package/src/core/responseMemberJoinRequest.js +1 -1
- package/src/core/sendCommand.js +1 -1
- package/src/core/sendFriendMessage.js +1 -1
- package/src/core/sendGroupMessage.js +1 -1
- package/src/core/sendNudge.js +1 -1
- package/src/core/sendTempMessage.js +1 -1
- package/src/core/setEssence.js +1 -1
- package/src/core/setGroupConfig.js +1 -1
- package/src/core/setMemberAdmin.js +1 -1
- package/src/core/setMemberInfo.js +1 -1
- package/src/core/setSessionConfig.js +1 -1
- package/src/core/startListeningBrowser.js +1 -1
- package/src/core/startListeningNode.js +1 -1
- package/src/core/stopListeningBrowser.js +1 -1
- package/src/core/stopListeningNode.js +1 -1
- package/src/core/unmute.js +1 -1
- package/src/core/unmuteAll.js +1 -1
- package/src/core/uploadImage.js +1 -1
- package/src/core/uploadVoice.js +1 -1
- package/src/core/verify.js +1 -1
- package/src/index.d.ts +8 -3
- package/src/index.js +13 -9
- package/src/polyfill/URL.js +1 -1
- package/src/polyfill/wsListener.js +2 -2
- package/.github/dependabot.yml +0 -14
package/dist/node/Message.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
// Message 通过实现 MessageChaingetable 与 Bot.sendMessage 通信
|
2
2
|
// 消息链元素类型和图片 id 类型
|
3
|
-
import { MessageChainGetable, MessageType, ImageId, FaceType } from './BaseType';
|
3
|
+
import { MessageChainGetable, MessageType, ImageId, FaceType, MessageId, ForwardNode, } from './BaseType';
|
4
4
|
|
5
5
|
// Bot.sendMessage 的 message 参数是一个 Message 类型的实例
|
6
6
|
// 方法内部通过 getMessageChainable 接口的 getMessageChain 方法拿到消息链
|
@@ -44,4 +44,23 @@ export class Message implements MessageChainGetable {
|
|
44
44
|
|
45
45
|
// implements MessageChainGetable
|
46
46
|
getMessageChain(): MessageType[];
|
47
|
+
|
48
|
+
// factory
|
49
|
+
static createForwardMessage(): ForwardMessage;
|
47
50
|
}
|
51
|
+
|
52
|
+
export class ForwardMessage implements MessageChainGetable {
|
53
|
+
constructor(nodeList: ForwardNode[]);
|
54
|
+
private messageChain: MessageType[];
|
55
|
+
|
56
|
+
addForwardNode({
|
57
|
+
senderId,
|
58
|
+
time,
|
59
|
+
senderName,
|
60
|
+
messageChain
|
61
|
+
}: ForwardNode): Message;
|
62
|
+
addForwardNode(messageId: MessageId): ForwardMessage;
|
63
|
+
|
64
|
+
// implements MessageChainGetable
|
65
|
+
getMessageChain(): MessageType[];
|
66
|
+
}
|
package/dist/node/Message.js
CHANGED
@@ -156,6 +156,18 @@ class App extends MessageType {
|
|
156
156
|
|
157
157
|
}
|
158
158
|
|
159
|
+
class ForwardNodeList extends MessageType {
|
160
|
+
constructor({
|
161
|
+
nodeList
|
162
|
+
}) {
|
163
|
+
super({
|
164
|
+
type: 'Forward'
|
165
|
+
});
|
166
|
+
this.nodeList = nodeList;
|
167
|
+
}
|
168
|
+
|
169
|
+
}
|
170
|
+
|
159
171
|
const faceMap = new Map([['惊讶', 0], ['撇嘴', 1], ['色', 2], ['发呆', 3], ['得意', 4], ['流泪', 5], ['害羞', 6], ['闭嘴', 7], ['睡', 8], ['大哭', 9], ['尴尬', 10], ['发怒', 11], ['调皮', 12], ['呲牙', 13], ['微笑', 14], ['难过', 15], ['酷', 16], ['抓狂', 18], ['吐', 19], ['偷笑', 20], ['可爱', 21], ['白眼', 22], ['傲慢', 23], ['饥饿', 24], ['困', 25], ['惊恐', 26], ['流汗', 27], ['憨笑', 28], ['悠闲', 29], ['奋斗', 30], ['咒骂', 31], ['疑问', 32], ['嘘', 33], ['晕', 34], ['折磨', 35], ['衰', 36], ['骷髅', 37], ['敲打', 38], ['再见', 39], ['发抖', 41], ['爱情', 42], ['跳跳', 43], ['猪头', 46], ['拥抱', 49], ['蛋糕', 53], ['闪电', 54], ['炸弹', 55], ['刀', 56], ['足球', 57], ['便便', 59], ['咖啡', 60], ['饭', 61], ['玫瑰', 63], ['凋谢', 64], ['爱心', 66], ['心碎', 67], ['礼物', 69], ['太阳', 74], ['月亮', 75], ['赞', 76], ['踩', 77], ['握手', 78], ['胜利', 79], ['飞吻', 85], ['怄火', 86], ['西瓜', 89], ['冷汗', 96], ['擦汗', 97], ['抠鼻', 98], ['鼓掌', 99], ['糗大了', 100], ['坏笑', 101], ['左哼哼', 102], ['右哼哼', 103], ['哈欠', 104], ['鄙视', 105], ['委屈', 106], ['快哭了', 107], ['阴险', 108], ['左亲亲', 109], ['吓', 110], ['可怜', 111], ['菜刀', 112], ['啤酒', 113], ['篮球', 114], ['乒乓', 115], ['示爱', 116], ['瓢虫', 117], ['抱拳', 118], ['勾引', 119], ['拳头', 120], ['差劲', 121], ['爱你', 122], ['不', 123], ['好', 124], ['转圈', 125], ['磕头', 126], ['回头', 127], ['跳绳', 128], ['挥手', 129], ['激动', 130], ['街舞', 131], ['献吻', 132], ['左太极', 133], ['右太极', 134], ['双喜', 136], ['鞭炮', 137], ['灯笼', 138], ['K歌', 140], ['喝彩', 144], ['祈祷', 145], ['爆筋', 146], ['棒棒糖', 147], ['喝奶', 148], ['飞机', 151], ['钞票', 158], ['药', 168], ['手枪', 169], ['茶', 171], ['眨眼睛', 172], ['泪奔', 173], ['无奈', 174], ['卖萌', 175], ['小纠结', 176], ['喷血', 177], ['斜眼笑', 178], ['doge', 179], ['惊喜', 180], ['骚扰', 181], ['笑哭', 182], ['我最美', 183], ['河蟹', 184], ['羊驼', 185], ['幽灵', 187], ['蛋', 188], ['菊花', 190], ['红包', 192], ['大笑', 193], ['不开心', 194], ['冷漠', 197], ['呃', 198], ['好棒', 199], ['拜托', 200], ['点赞', 201], ['无聊', 202], ['托脸', 203], ['吃', 204], ['送花', 205], ['害怕', 206], ['花痴', 207], ['小样儿', 208], ['飙泪', 210], ['我不看', 211], ['托腮', 212], ['啵啵', 214], ['糊脸', 215], ['拍头', 216], ['扯一扯', 217], ['舔一舔', 218], ['蹭一蹭', 219], ['拽炸天', 220], ['顶呱呱', 221], ['抱抱', 222], ['暴击', 223], ['开枪', 224], ['撩一撩', 225], ['拍桌', 226], ['拍手', 227], ['恭喜', 228], ['干杯', 229], ['嘲讽', 230], ['哼', 231], ['佛系', 232], ['掐一掐', 233], ['惊呆', 234], ['颤抖', 235], ['啃头', 236], ['偷看', 237], ['扇脸', 238], ['原谅', 239], ['喷脸', 240], ['生日快乐', 241], ['头撞击', 242], ['甩头', 243], ['扔狗', 244], ['加油必胜', 245], ['加油抱抱', 246], ['口罩护体', 247], ['搬砖中', 260], ['忙到飞起', 261], ['脑阔疼', 262], ['沧桑', 263], ['捂脸', 264], ['辣眼睛', 265], ['哦哟', 266], ['头秃', 267], ['问号脸', 268], ['暗中观察', 269], ['emm', 270], ['吃瓜', 271], ['呵呵哒', 272], ['我酸了', 273], ['太南了', 274], ['辣椒酱', 276], ['汪汪', 277], ['汗', 278], ['打脸', 279], ['击掌', 280], ['无眼笑', 281], ['敬礼', 282], ['狂笑', 283], ['面无表情', 284], ['摸鱼', 285], ['魔鬼笑', 286], ['哦', 287], ['请', 288], ['睁眼', 289], ['敲开心', 290], ['震惊', 291], ['让我康康', 292], ['摸锦鲤', 293], ['期待', 294], ['拿到红包', 295], ['真好', 296], ['拜谢', 297], ['元宝', 298], ['牛啊', 299], ['胖三斤', 300], ['好闪', 301], ['左拜年', 302], ['右拜年', 303], ['红包包', 304], ['右亲亲', 305], ['牛气冲天', 306], ['喵喵', 307], ['求红包', 308], ['谢红包', 309], ['新年烟花', 310], ['打call', 311], ['变形', 312], ['嗑到了', 313], ['仔细分析', 314], ['加油', 315], ['我没事', 316], ['菜狗', 317], ['崇拜', 318], ['比心', 319], ['庆祝', 320], ['老色痞', 321], ['拒绝', 322], ['嫌弃', 323], ['吃糖', 324]]);
|
160
172
|
|
161
173
|
class Face extends MessageType {
|
@@ -319,6 +331,45 @@ class Message extends MessageChainGetable {
|
|
319
331
|
return this.messageChain;
|
320
332
|
}
|
321
333
|
|
334
|
+
static createForwardMessage() {
|
335
|
+
return new ForwardMessage();
|
336
|
+
}
|
337
|
+
|
338
|
+
}
|
339
|
+
|
340
|
+
class ForwardMessage extends MessageChainGetable {
|
341
|
+
constructor() {
|
342
|
+
super();
|
343
|
+
this.messageChain = [];
|
344
|
+
this.nodeList = [];
|
345
|
+
}
|
346
|
+
|
347
|
+
addForwardNode(nodeOrId) {
|
348
|
+
if (typeof nodeOrId === 'number') {
|
349
|
+
this.nodeList.push({
|
350
|
+
messageId: nodeOrId
|
351
|
+
});
|
352
|
+
} else if (typeof nodeOrId == 'object') {
|
353
|
+
if (nodeOrId.messageChain instanceof MessageChainGetable) {
|
354
|
+
nodeOrId.messageChain = nodeOrId.messageChain.getMessageChain();
|
355
|
+
}
|
356
|
+
|
357
|
+
this.nodeList.push(nodeOrId);
|
358
|
+
}
|
359
|
+
/* else ignore */
|
360
|
+
|
361
|
+
|
362
|
+
return this;
|
363
|
+
} // implements MessageChainGetable
|
364
|
+
|
365
|
+
|
366
|
+
getMessageChain() {
|
367
|
+
this.messageChain.push(new ForwardNodeList({
|
368
|
+
nodeList: this.nodeList
|
369
|
+
}));
|
370
|
+
return this.messageChain;
|
371
|
+
}
|
372
|
+
|
322
373
|
}
|
323
374
|
|
324
375
|
module.exports = {
|
@@ -14,7 +14,7 @@ const errorHandler = require('../../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 删除群公告
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 获取群公告
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 发布群公告
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
package/dist/node/core/auth.js
CHANGED
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
*
|
20
20
|
* @description 认证 verifyKey,创建回话,返回一个 sessionKey
|
@@ -14,7 +14,7 @@ const errorHandler = require('../../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 删除群文件
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 获取群文件详细信息
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 获取群文件列表
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 新建群文件夹
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 移动群文件
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 重命名群文件
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
|
19
19
|
const FormData = require('form-data');
|
20
20
|
/**
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 获取好友列表
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 获取群配置
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 获取群列表
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 获取群成员信息
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 获取指定群的成员列表
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 获取指定 session 的 config
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 获取用户信息
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
package/dist/node/core/mute.js
CHANGED
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 禁言群成员
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的主机地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 全员禁言
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的主机地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 退出群聊
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
package/dist/node/core/recall.js
CHANGED
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 撤回由 messageId 确定的消息
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的主机地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 关闭一个会话
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的主机地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 删除好友
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 移除群成员
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* ! 自动同意时,不会触发该事件
|
20
20
|
* @description 响应机器人被邀请入群请求
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 响应好友请求
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* FIXME: mirai-core 的问题,有时候收不到 MemberJoinRequestEvent 事件
|
20
20
|
* 该功能未经测试
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 向 mirai-console 发送指令
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 向 qq 好友发送消息
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 向 qq 群发送消息
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 发送戳一戳消息
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 向临时对象发送消息
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 设置群精华消息
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 设置群配置
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 设置群成员权限
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 设置群成员信息
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 设置指定 session 的 config
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -10,7 +10,7 @@ const errorHandler = require('../util/errorHandler');
|
|
10
10
|
|
11
11
|
const path = require('path');
|
12
12
|
|
13
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
13
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
14
14
|
/**
|
15
15
|
* @description 开始侦听事件
|
16
16
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -10,7 +10,7 @@ const errorHandler = require('../util/errorHandler');
|
|
10
10
|
|
11
11
|
const path = require('path');
|
12
12
|
|
13
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
13
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
14
14
|
/**
|
15
15
|
* @description 开始侦听事件
|
16
16
|
* @param {string} baseUrl mirai-api-http server 的地址
|
@@ -4,7 +4,7 @@ const errorHandler = require('../util/errorHandler');
|
|
4
4
|
|
5
5
|
const path = require('path');
|
6
6
|
|
7
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
7
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
8
8
|
/**
|
9
9
|
* @description 停止侦听事件
|
10
10
|
* @param {WebSocket} 建立连接的 WebSocket 实例
|
@@ -4,7 +4,7 @@ const errorHandler = require('../util/errorHandler');
|
|
4
4
|
|
5
5
|
const path = require('path');
|
6
6
|
|
7
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
7
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
8
8
|
/**
|
9
9
|
* @description 停止侦听事件
|
10
10
|
* @param {WebSocket} 建立连接的 WebSocket 实例
|
package/dist/node/core/unmute.js
CHANGED
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 解除禁言
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的主机地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 解除全员禁言
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的主机地址
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
|
19
19
|
const FormData = require('form-data');
|
20
20
|
/**
|
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
|
19
19
|
const FormData = require('form-data');
|
20
20
|
/**
|
package/dist/node/core/verify.js
CHANGED
@@ -14,7 +14,7 @@ const errorHandler = require('../util/errorHandler');
|
|
14
14
|
|
15
15
|
const path = require('path');
|
16
16
|
|
17
|
-
const locationStr = `core.${path.basename(__filename, path.extname(__filename))}
|
17
|
+
const locationStr = window === undefined ? `core.${path.basename(__filename, path.extname(__filename))}` : 'borwser';
|
18
18
|
/**
|
19
19
|
* @description 校验 sessionKey,将一个 session 绑定到指定的 qq 上
|
20
20
|
* @param {string} baseUrl mirai-api-http server 的地址
|
package/dist/node/index.d.ts
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
import { Bot as BotType } from './Bot';
|
2
|
+
import { Message as MessageType } from './Message';
|
3
|
+
import { Middleware as MiddlewareType } from './Middleware';
|
4
|
+
declare module 'mirai-js' {
|
5
|
+
export const Bot: typeof BotType;
|
6
|
+
export const Message: typeof MessageType;
|
7
|
+
export const Middleware: typeof MiddlewareType;
|
8
|
+
}
|