|
@@ -170,16 +170,21 @@ function view(chat, args, reply) {
|
|
if (args.length === 0 || !args[0]) {
|
|
if (args.length === 0 || !args[0]) {
|
|
return reply('找不到要查看的链接或表达式。');
|
|
return reply('找不到要查看的链接或表达式。');
|
|
}
|
|
}
|
|
- const match = /^(last(?:|-\d+)@[^\/?#]+)$/.exec(args[0]) ||
|
|
|
|
|
|
+ const match = /^(last(?:|-(\d+))@[^\/?#]+)$/.exec(args[0]) ||
|
|
/^(?:.*twitter.com\/[^\/?#]+\/status\/)?(\d+)/.exec(args[0]);
|
|
/^(?:.*twitter.com\/[^\/?#]+\/status\/)?(\d+)/.exec(args[0]);
|
|
if (!match) {
|
|
if (!match) {
|
|
return reply(`链接或表达式格式有误。
|
|
return reply(`链接或表达式格式有误。
|
|
示例:
|
|
示例:
|
|
-https://twitter.com/TomoyoKurosawa/status/1294613494860361729
|
|
|
|
|
|
+https://twitter.com/TomoyoKurosawa/status/1486136914864345092
|
|
|
|
+1486136914864345092
|
|
|
|
+(注:直接查看指定推文时并不会区分其媒体属性)
|
|
last@TomoyoKurosawa
|
|
last@TomoyoKurosawa
|
|
-last-2@sunflower930316,noreps=off,norts=on
|
|
|
|
|
|
+last-1@sunflower930316,noreps=off,norts=on
|
|
(表达式筛选参数详见 /help twitterpic_query)`);
|
|
(表达式筛选参数详见 /help twitterpic_query)`);
|
|
}
|
|
}
|
|
|
|
+ if (Math.abs(Number(match[2])) >= 50) {
|
|
|
|
+ return reply('表达式中指定的回溯数量超出取值范围。');
|
|
|
|
+ }
|
|
let forceRefresh;
|
|
let forceRefresh;
|
|
for (const arg of args.slice(1)) {
|
|
for (const arg of args.slice(1)) {
|
|
const optMatch = /^(force|refresh)=(.*)/.exec(arg);
|
|
const optMatch = /^(force|refresh)=(.*)/.exec(arg);
|