From 1bfe62a62102849b50f6d997fa47a042431f3e55 Mon Sep 17 00:00:00 2001 From: Hex Date: Sat, 6 May 2023 23:36:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=87=8D=E8=AF=95=E6=9C=BA?= =?UTF-8?q?=E5=88=B6&=E5=B0=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot.js | 15 ++++++++++++++- smzdm_checkin.js | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/bot.js b/bot.js index ef83a33..b5ab388 100644 --- a/bot.js +++ b/bot.js @@ -76,7 +76,20 @@ const requestApi = async (url, inputOptions = {}) => { const gotOptions = { method: options.method.toUpperCase(), - headers: options.headers + headers: options.headers, + retry: { + limit: 2, + methods: [ + 'GET', + 'POST' + ], + statusCodes: [ + ], + errorCodes: [ + 'ECONNRESET', + 'EAI_AGAIN' + ] + } }; if (options.method === 'get') { diff --git a/smzdm_checkin.js b/smzdm_checkin.js index 1454270..83dd6fa 100644 --- a/smzdm_checkin.js +++ b/smzdm_checkin.js @@ -93,7 +93,7 @@ class SmzdmCheckinBot extends SmzdmBot { msg2 = `${data.data.normal_reward.gift.title}: ${data.data.normal_reward.gift.content_str}`; } else { - msg2 = `${data.data.normal_reward.gift.content_str}: ${data.data.normal_reward.gift.sub_content}`; + msg2 = `${data.data.normal_reward.gift.sub_content}`; } $.log(`${msg1}\n${msg2}\n`);