-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
24 lines (17 loc) · 868 Bytes
/
test.js
File metadata and controls
24 lines (17 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const { PaperMC } = require('../')
const paper = new PaperMC()
; (async () => {
console.log('Base URL:', paper.BASE_URL)
console.log('Projects:', await paper.getProjects())
console.log('Versions of paper:', (await paper.getProjectInfo('paper')).versions)
console.log('Fetching last 10 build messages of mc 1.16.x...')
const info = await paper.getVersionGroupBuilds('paper', '1.16')
for (let c = 1; c < 11; c++) {
const current = info.builds[info.builds.length - c]
console.log('ㄴ', current.build, ':', current.changes[0]?.summary || '<empty>')
}
console.log('Downloading last build of mc 1.16.x...')
const lastBuild = info.builds[info.builds.length - 1]
const blob = await paper.download('paper', lastBuild.version, lastBuild.build, lastBuild.downloads.application.name)
console.log('ㄴ done. (', blob.size, 'bytes )')
})()