|
@@ -24,6 +24,8 @@ function parseCmd(message) {
|
|
}
|
|
}
|
|
exports.parseCmd = parseCmd;
|
|
exports.parseCmd = parseCmd;
|
|
function view(_chat, args, reply) {
|
|
function view(_chat, args, reply) {
|
|
|
|
+ if (!Number.isInteger(Number(args[0])))
|
|
|
|
+ return reply('查询格式有误。格式:/nanatsuu_view〈整数〉');
|
|
twitter_1.queryByRegExp('t7s_staff', /今週の『それゆけ!ナナスタ☆通信』第(\d+)話はこちら!/, 3600 * 24 * 6)
|
|
twitter_1.queryByRegExp('t7s_staff', /今週の『それゆけ!ナナスタ☆通信』第(\d+)話はこちら!/, 3600 * 24 * 6)
|
|
.then(match => {
|
|
.then(match => {
|
|
if (!match)
|
|
if (!match)
|
|
@@ -32,7 +34,7 @@ function view(_chat, args, reply) {
|
|
if (query < 0)
|
|
if (query < 0)
|
|
query += Number(match[1]);
|
|
query += Number(match[1]);
|
|
if (args[0] === '0' || query < 0 || query > Number(match[1])) {
|
|
if (args[0] === '0' || query < 0 || query > Number(match[1])) {
|
|
- return reply(`查询取值范围有误。当前可用的取值范围:1~${Number(match[1])}`);
|
|
|
|
|
|
+ return reply(`查询取值范围有误。当前可用的取值范围:${1 - Number(match[1])}~${Number(match[1])}`);
|
|
}
|
|
}
|
|
reply(`第 ${query} 话:\n` +
|
|
reply(`第 ${query} 话:\n` +
|
|
koishi_1.Message.Image(`https://d2n19nac4w0gh6.cloudfront.net/resource/images/webview/comic/story/comic_${String(query).padStart(3, '0')}.jpg`));
|
|
koishi_1.Message.Image(`https://d2n19nac4w0gh6.cloudfront.net/resource/images/webview/comic/story/comic_${String(query).padStart(3, '0')}.jpg`));
|