Swap from request to got

This commit is contained in:
Michael Morrison 2020-07-04 23:28:03 -05:00
parent 67563c0f1e
commit 487b17dd73
9 changed files with 215 additions and 340 deletions

View file

@ -2,11 +2,11 @@ const Core = require('./core');
class Kspdmp extends Core {
async run(state) {
const body = await this.request({
uri: 'http://'+this.options.address+':'+this.options.port
const json = await this.request({
url: 'http://'+this.options.address+':'+this.options.port,
responseType: 'json'
});
const json = JSON.parse(body);
for (const one of json.players) {
state.players.push({name:one.nickname,team:one.team});
}