mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 13:17:32 +00:00
🐛 日历
This commit is contained in:
parent
92bb7993b4
commit
0f8a85fa62
2 changed files with 39 additions and 9 deletions
|
|
@ -20,21 +20,26 @@ export class Note extends ZZZPlugin {
|
|||
});
|
||||
}
|
||||
async calendar() {
|
||||
const activityList = await request.get(
|
||||
'https://announcement-api.mihoyo.com/common/nap_cn/announcement/api/getAnnList?game=nap&game_biz=nap_cn&lang=zh-cn&bundle_id=nap_cn&channel_id=1&level=70&platform=pc®ion=prod_gf_cn&uid=12345678'
|
||||
);
|
||||
const activityList = await request
|
||||
.get(
|
||||
'https://announcement-api.mihoyo.com/common/nap_cn/announcement/api/getAnnList?game=nap&game_biz=nap_cn&lang=zh-cn&bundle_id=nap_cn&channel_id=1&level=70&platform=pc®ion=prod_gf_cn&uid=12345678'
|
||||
)
|
||||
.then(res => res.json());
|
||||
if (!activityList?.data) {
|
||||
await this.reply('获取活动列表失败');
|
||||
return false;
|
||||
}
|
||||
const t = activityList?.data?.t || new Date().getTime().toString();
|
||||
const activityContent = await request.get(
|
||||
`https://announcement-static.mihoyo.com/common/nap_cn/announcement/api/getAnnContent?game=nap&game_biz=nap_cn&lang=zh-cn&bundle_id=nap_cn&platform=pc®ion=prod_gf_cn&t=${t}&level=70&channel_id=1`
|
||||
);
|
||||
const activityContent = await request
|
||||
.get(
|
||||
`https://announcement-static.mihoyo.com/common/nap_cn/announcement/api/getAnnContent?game=nap&game_biz=nap_cn&lang=zh-cn&bundle_id=nap_cn&platform=pc®ion=prod_gf_cn&t=${t}&level=70&channel_id=1`
|
||||
)
|
||||
.then(res => res.json());
|
||||
const contentList = activityContent?.data?.list || [];
|
||||
const calendarContent = contentList.find(
|
||||
item => item.title.includes('日历') && item.subtitle.includes('活动日历')
|
||||
);
|
||||
|
||||
const htmlContent = calendarContent?.content || '';
|
||||
if (!htmlContent) {
|
||||
await this.reply('未找到活动日历');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue