diff --git a/index.ts b/index.ts index ab341d8..67af0a1 100644 --- a/index.ts +++ b/index.ts @@ -44,7 +44,7 @@ export async function apply(ctx: Context) { if (moment(quota.expireTime).diff(moment(), 'days') <= 3) { MessageModel.sendNotification(['Hydro & 洛谷开放平台提醒:', info, '点数有效期已不足3天,请及时联系Hydro开发组或洛谷官方进行充值或续费。'].join('\n')); } - if (quota.availablePoints < 1000) { + if (quota.availablePoints > 0 && quota.availablePoints < 1000) { MessageModel.sendNotification(['Hydro & 洛谷开放平台提醒:', info, '点数已不足1000,请及时联系Hydro开发组或洛谷官方进行充值或续费。'].join('\n')); } }); diff --git a/provider.ts b/provider.ts index cbd1d9e..604ec1a 100644 --- a/provider.ts +++ b/provider.ts @@ -205,7 +205,7 @@ export default class LuoguProvider extends BasicFetcher implements IBasicProvide const { body } = await this.get('/judge/quotaAvailable'); this.quota = { orgName: body.quotas[0].org.name, - availablePoints: body.quotas[0].availablePoints, + availablePoints: body.quotas[0].availablePoints ?? -1, createTime: body.quotas[0].createTime * 1000, expireTime: body.quotas[0].expireTime * 1000, updateAt: Date.now(),