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.
Files changed (2) hide show
  1. package/lib/index.js +17 -7
  2. 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 "dummy";
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 && /^\d+$/.test(arg1)) {
562
- limit = parseInt(arg1);
563
- } else {
564
- userArg = arg1;
565
- if (arg2 && /^\d+$/.test(String(arg2))) {
566
- limit = parseInt(String(arg2));
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);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-prism-neo",
3
3
  "description": "prism koishi前端",
4
- "version": "0.0.26",
4
+ "version": "0.0.27",
5
5
  "main": "lib/index.js",
6
6
  "files": [
7
7
  "lib",