koishi-plugin-prism-neo 0.0.26 → 0.0.27
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 +17 -7
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -261,7 +261,7 @@ var Config = import_koishi.Schema.object({
|
|
|
261
261
|
});
|
|
262
262
|
async function getUserName(session, userId) {
|
|
263
263
|
if (userId) {
|
|
264
|
-
return
|
|
264
|
+
return (await session.bot.getUser(userId)).name + ` ( ${userId} )`;
|
|
265
265
|
} else {
|
|
266
266
|
return "匿名用户";
|
|
267
267
|
}
|
|
@@ -558,12 +558,22 @@ __name(handleWalletCmd, "handleWalletCmd");
|
|
|
558
558
|
async function handleHistoriesCmd(context, arg1, arg2) {
|
|
559
559
|
let limit = 10;
|
|
560
560
|
let userArg;
|
|
561
|
-
if (arg1
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
561
|
+
if (arg1) {
|
|
562
|
+
if (arg1.startsWith("@")) {
|
|
563
|
+
userArg = arg1.replace("@", "");
|
|
564
|
+
if (!userArg.includes(":")) {
|
|
565
|
+
userArg = `onebot:${userArg}`;
|
|
566
|
+
}
|
|
567
|
+
if (arg2 && /^\d+$/.test(String(arg2))) {
|
|
568
|
+
limit = parseInt(String(arg2));
|
|
569
|
+
}
|
|
570
|
+
} else if (/^\d+$/.test(arg1)) {
|
|
571
|
+
limit = parseInt(arg1);
|
|
572
|
+
} else {
|
|
573
|
+
userArg = arg1;
|
|
574
|
+
if (arg2 && /^\d+$/.test(String(arg2))) {
|
|
575
|
+
limit = parseInt(String(arg2));
|
|
576
|
+
}
|
|
567
577
|
}
|
|
568
578
|
}
|
|
569
579
|
const { error, userId } = await getTargetUserId(context, userArg);
|