feat: V1.5.8 [!6] 适配米游社小程序

Merge pull request !6 from liangho-ng/master
This commit is contained in:
zhiyu 2024-03-16 13:16:49 +00:00 committed by Gitee
commit c528634c39
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1126,7 +1126,8 @@ export class tools extends plugin {
// 米游社
async miyoushe(e) {
let msg = /(?:https?:\/\/)?(m|www)\.miyoushe\.com\/[A-Za-z\d._?%&+\-=\/#]*/.exec(e.msg)[0];
let url = e.msg === undefined ? e.message.shift().data.replaceAll("\\", "") : e.msg.trim();
let msg = /(?:https?:\/\/)?(m|www)\.miyoushe\.com\/[A-Za-z\d._?%&+\-=\/#]*/.exec(url)?.[0];
const id = /\/(\d+)$/.exec(msg)?.[0].replace("\/", "");
fetch(MIYOUSHE_ARTICLE.replace("{}", id), {