koishi-plugin-cocoyyy-console 1.0.14-beta.3 → 1.0.14-beta.5
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/index.js +10 -8
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1228,8 +1228,7 @@ function registerRbqCommands(ctx, connected) {
|
|
|
1228
1228
|
if (!list || list.length === 0) {
|
|
1229
1229
|
return "当前群聊还没有设置任何rbq";
|
|
1230
1230
|
}
|
|
1231
|
-
return
|
|
1232
|
-
${list.map((item) => (0, import_koishi8.h)("at", { id: item })).join(",")}`;
|
|
1231
|
+
return "当前群聊rbq列表:\n" + list.map((item) => (0, import_koishi8.h)("at", { id: item })).join(",");
|
|
1233
1232
|
});
|
|
1234
1233
|
ctx.command("rbqadd <参数>", "添加rbq").action(async ({ session }, ...args) => {
|
|
1235
1234
|
if (!dev_mode) {
|
|
@@ -1247,7 +1246,7 @@ ${list.map((item) => (0, import_koishi8.h)("at", { id: item })).join(",")}`;
|
|
|
1247
1246
|
exec = await create_person(session.guildId, uid);
|
|
1248
1247
|
if (!exec.result)
|
|
1249
1248
|
return `添加rbq失败: ${exec.error}`;
|
|
1250
|
-
return
|
|
1249
|
+
return "已添加rbq:" + (0, import_koishi8.h)("at", { id: uid });
|
|
1251
1250
|
});
|
|
1252
1251
|
ctx.command("rbqinstead <参数>", "替换rbq").action(async ({ session }, ...args) => {
|
|
1253
1252
|
if (!dev_mode) {
|
|
@@ -1263,15 +1262,18 @@ ${list.map((item) => (0, import_koishi8.h)("at", { id: item })).join(",")}`;
|
|
|
1263
1262
|
if (!exec.result)
|
|
1264
1263
|
return `${target_uid}不在当前群聊中`;
|
|
1265
1264
|
}
|
|
1266
|
-
logger.info(`[rbqinstead] input_uid: ${session.uid}, sourceId: ${source_uid}, targetId: ${target_uid}, botId: ${session.selfId}`);
|
|
1267
|
-
if (session.selfId
|
|
1268
|
-
|
|
1269
|
-
|
|
1265
|
+
logger.info(`[rbqinstead] info: input_uid: ${session.uid}, sourceId: ${source_uid}, targetId: ${target_uid}, botId: ${session.selfId}`);
|
|
1266
|
+
if (target_uid == session.selfId) {
|
|
1267
|
+
let new_target = session.uid;
|
|
1268
|
+
exec = await instead_person(session.guildId, source_uid, new_target);
|
|
1269
|
+
if (!exec.result)
|
|
1270
|
+
return `替换rbq失败:${exec.error}`;
|
|
1271
|
+
return "还想让我变rbq?进去吧你,已替换rbq:\n" + (0, import_koishi8.h)("at", { id: source_uid }) + " -> " + (0, import_koishi8.h)("at", { id: new_target });
|
|
1270
1272
|
}
|
|
1271
1273
|
exec = await instead_person(session.guildId, source_uid, target_uid);
|
|
1272
1274
|
if (!exec.result)
|
|
1273
1275
|
return `替换rbq失败:${exec.error}`;
|
|
1274
|
-
return
|
|
1276
|
+
return (0, import_koishi8.h)("p", "已替换rbq:", (0, import_koishi8.h)("at", { id: source_uid }), " -> ", (0, import_koishi8.h)("at", { id: target_uid }));
|
|
1275
1277
|
});
|
|
1276
1278
|
ctx.command("rbqadd_txt <参数>", "添加自定义文本").action(async ({ session }, ...args) => {
|
|
1277
1279
|
if (!dev_mode) {
|