Mike L 3 rokov pred
rodič
commit
87f1289962
2 zmenil súbory, kde vykonal 4 pridanie a 4 odobranie
  1. 2 2
      dist/command.js
  2. 2 2
      src/command.ts

+ 2 - 2
dist/command.js

@@ -33,8 +33,8 @@ function view(_chat, args, reply) {
         let query = Number(args[0] || Number(match[1]));
         if (query < 0)
             query += Number(match[1]);
-        if (args[0] === '0' || query < 0 || query > Number(match[1])) {
-            return reply(`查询取值范围有误。当前可用的取值范围:${1 - Number(match[1])}~${Number(match[1])}`);
+        if (query < 0 || query > Number(match[1])) {
+            return reply(`查询取值范围有误。当前可用的取值范围:${-Number(match[1])}~${Number(match[1])}`);
         }
         reply(`第 ${query} 话:\n` +
             koishi_1.Message.Image(`https://d2n19nac4w0gh6.cloudfront.net/resource/images/webview/comic/story/comic_${String(query).padStart(3, '0')}.jpg`));

+ 2 - 2
src/command.ts

@@ -35,8 +35,8 @@ function view(_chat: IChat, args: string[], reply: (msg: string) => any): void {
       if (!match) throw Error();
       let query = Number(args[0] || Number(match[1]));
       if (query < 0) query += Number(match[1]);
-      if (args[0] === '0' || query < 0 || query > Number(match[1])) {
-        return reply(`查询取值范围有误。当前可用的取值范围:${1 - Number(match[1])}~${Number(match[1])}`);
+      if (query < 0 || query > Number(match[1])) {
+        return reply(`查询取值范围有误。当前可用的取值范围:${- Number(match[1])}~${Number(match[1])}`);
       }
       reply(`第 ${query} 话:\n` +
         Message.Image(`https://d2n19nac4w0gh6.cloudfront.net/resource/images/webview/comic/story/comic_${