More async

This commit is contained in:
mmorrison 2019-01-12 05:45:09 -06:00
parent 29ce0b82d0
commit e937c725bb
20 changed files with 100 additions and 86 deletions

View file

@ -2,6 +2,8 @@ const Core = require('./core');
class Teamspeak3 extends Core {
async run(state) {
const queryPort = this.options.teamspeakQueryPort || 10011;
await this.withTcp(async socket => {
{
const data = await this.sendCommand(socket, 'use port='+this.options.port, true);
@ -31,7 +33,7 @@ class Teamspeak3 extends Core {
const data = await this.sendCommand(socket, 'channellist -topic');
state.raw.channels = data;
}
});
}, queryPort);
}
async sendCommand(socket,cmd,raw) {