|
@@ -182,7 +182,7 @@ function view(chat: IChat, args: string[], reply: (msg: string) => any): void {
|
|
|
return reply('找不到要查看的链接或表达式。');
|
|
|
}
|
|
|
const match =
|
|
|
- /^(last(?:|-\d+)@[^\/?#]+)$/.exec(args[0]) ||
|
|
|
+ /^(last(?:|-(\d+))@[^\/?#]+)$/.exec(args[0]) ||
|
|
|
/^(?:.*twitter.com\/[^\/?#]+\/status\/)?(\d+)/.exec(args[0]);
|
|
|
if (!match) {
|
|
|
return reply(`链接或表达式格式有误。
|
|
@@ -193,6 +193,9 @@ last@TomoyoKurosawa
|
|
|
last-2@sunflower930316,noreps=off,norts=on
|
|
|
(表达式筛选参数详见 /help twitter_query)`);
|
|
|
}
|
|
|
+ if (Math.abs(Number(match[2])) > 50) {
|
|
|
+ return reply('表达式中指定的回溯数量超出取值范围。');
|
|
|
+ }
|
|
|
let forceRefresh: boolean;
|
|
|
for (const arg of args.slice(1)) {
|
|
|
const optMatch = /^(force|refresh)=(.*)/.exec(arg);
|