mioki 0.8.2 → 0.9.1
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/dist/cli.cjs +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +10 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +10 -10
- package/dist/index.mjs.map +1 -1
- package/dist/package-CbQDT4KP.mjs +6 -0
- package/dist/package-CbQDT4KP.mjs.map +1 -0
- package/dist/{package-CRcx0VP6.cjs → package-DRiVbSa9.cjs} +2 -2
- package/dist/package-DRiVbSa9.cjs.map +1 -0
- package/package.json +2 -2
- package/dist/package-CRcx0VP6.cjs.map +0 -1
- package/dist/package-DpnA9qw3.mjs +0 -6
- package/dist/package-DpnA9qw3.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __export } from "./chunk-DYZpOiH0.mjs";
|
|
2
|
-
import { t as version } from "./package-
|
|
2
|
+
import { t as version } from "./package-CbQDT4KP.mjs";
|
|
3
3
|
import fs, { default as fs$1 } from "node:fs";
|
|
4
4
|
import util from "node:util";
|
|
5
5
|
import path, { default as path$1 } from "node:path";
|
|
@@ -964,7 +964,7 @@ async function noticeGroups(bot, groupIdList, message, delay = 1e3) {
|
|
|
964
964
|
* 群发好友消息
|
|
965
965
|
*/
|
|
966
966
|
async function noticeFriends(bot, friendIdList, message, delay = 1e3) {
|
|
967
|
-
if (!bot.isOnline) {
|
|
967
|
+
if (!bot.isOnline()) {
|
|
968
968
|
logger.error("发送失败,Bot 不在线");
|
|
969
969
|
return;
|
|
970
970
|
}
|
|
@@ -1188,8 +1188,12 @@ const services = USER_SERVICE;
|
|
|
1188
1188
|
* 建议需要调用 `addService` 的插件设置 `priority` 为 `10`
|
|
1189
1189
|
*/
|
|
1190
1190
|
function addService(name, service, cover = true) {
|
|
1191
|
+
logger.debug(`添加 mioki 服务: ${name} (覆盖: ${cover ? "是" : "否"})`);
|
|
1191
1192
|
if (cover || !USER_SERVICE[name]) USER_SERVICE[name] = service;
|
|
1192
|
-
return () =>
|
|
1193
|
+
return () => {
|
|
1194
|
+
logger.debug(`移除 mioki 服务: ${name}`);
|
|
1195
|
+
USER_SERVICE[name] = void 0;
|
|
1196
|
+
};
|
|
1193
1197
|
}
|
|
1194
1198
|
|
|
1195
1199
|
//#endregion
|
|
@@ -1244,13 +1248,9 @@ async function enablePlugin(bot, plugin, type = "external") {
|
|
|
1244
1248
|
services,
|
|
1245
1249
|
clears: userClears,
|
|
1246
1250
|
addService: (name$1, service, cover) => {
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
addService(name$1, service, cover);
|
|
1251
|
-
};
|
|
1252
|
-
clears.add(removeService);
|
|
1253
|
-
return removeService;
|
|
1251
|
+
const remove = addService(name$1, service, cover);
|
|
1252
|
+
clears.add(remove);
|
|
1253
|
+
return remove;
|
|
1254
1254
|
},
|
|
1255
1255
|
handle: (eventName, handler) => {
|
|
1256
1256
|
logger$1.debug(`Registering event handler for event: ${String(eventName)}`);
|