Skip to content

Commit

Permalink
fix 每日大事 大事記->大事 & ?
Browse files Browse the repository at this point in the history
  • Loading branch information
zeteticl committed Nov 16, 2023
1 parent ae6efda commit a51ef0b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions roll/1_funny.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ const rollDiceCommand = async function ({
let respond = `${month}${day}日\n\n`;
rply.text = await wiki({
headers: { 'User-Agent': identity },
apiUrl: 'https://zh.wikipedia.org/w/api.php'
apiUrl: 'https://zh.wikipedia.org/w/api.php',
setpagelanguage: "zh-hant"
}).page(`${month}${day}日`)
.then(async page => {
let temp = await page.content();
Expand All @@ -186,11 +187,11 @@ const rollDiceCommand = async function ({
})
respond += `${(answerFestival && answerFestival.title) ? `${answerFestival.title}\n` : ''}${(answerFestival && answerFestival.content) ? `${answerFestival.content}\n` : ''}\n`
let answerBig = temp.find(v => {
return v && v.title.match(/()|()/)
return v && v.title.match(/()/)
})
if (answerBig && answerBig.items) answerBig = answerBig.items;

for (let index = 0; index < answerBig.length; index++) {
for (let index = 0; index < answerBig?.length; index++) {

respond += `${answerBig[index].title}\n${answerBig[index].content}\n\n`
}
Expand Down Expand Up @@ -1312,7 +1313,7 @@ class DailyFuckUp {
}
chapter = DailyFuckUp.addParagraph(chapter);
text.push(chapter);

let result = text.join("\n\n").replace('。。', '。');
return result;
}
Expand Down

0 comments on commit a51ef0b

Please sign in to comment.