Merge branch 'pr_140'
# Conflicts: # plugins/genshin/apps/exchange.js
This commit is contained in:
commit
9a09fb45d0
|
@ -42,7 +42,9 @@ export class exchange extends plugin {
|
|||
|
||||
/** index info */
|
||||
let index = await this.getData('index')
|
||||
if (!index || !index.data) { return true }
|
||||
if (!index || !index.data) {
|
||||
return true
|
||||
}
|
||||
if (index.data === null) {
|
||||
return await this.reply(`错误:\n${index.message}`)
|
||||
}
|
||||
|
@ -104,13 +106,19 @@ export class exchange extends plugin {
|
|||
|
||||
// 获取 "act_id"
|
||||
async getActId () {
|
||||
let ret = await this.getData('actId')
|
||||
let ret = await this.getData('actId');
|
||||
if (ret.error || ret.retcode !== 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
for (const p of ret.data.list) {
|
||||
const post = p.post.post;
|
||||
let post;
|
||||
try {
|
||||
post = p.post.post;
|
||||
} catch (e) {
|
||||
logger.error("活动数据获取异常");
|
||||
logger.error(e);
|
||||
}
|
||||
if (!post) {
|
||||
continue;
|
||||
}
|
||||
|
@ -124,6 +132,7 @@ export class exchange extends plugin {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 兑换码使用
|
||||
async useCode() {
|
||||
const cdkCode = this.e.msg.replace(/#(兑换码使用|cdk-u)/, "").trim()
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 343 KiB After Width: | Height: | Size: 457 KiB |
Loading…
Reference in New Issue