Skip to content

Commit 6e0736e

Browse files
support multiple pages
1 parent 2366e6e commit 6e0736e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/minecraft.mts

+4-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ bot.on('spawn', async () => {
8383
const firstPage = JSON.parse(pages[0]).text as string;
8484
const idx = firstPage.indexOf('\n');
8585
const version = firstPage.substring(0, idx).trim();
86-
const source = firstPage.substring(idx).trim();
86+
const source = pages.slice(1).reduce((s, page) => {
87+
s += '\n' + (JSON.parse(page).text as string).trim();
88+
return s;
89+
}, firstPage.substring(idx).trim());
8790

8891
const pkg = {
8992
name: book.title.value,

0 commit comments

Comments
 (0)