A simple mumble client for managing mumble servers
$ npm i @tf2pickup-org/mumble-client
import { Client } from '@tf2pickup-org/mumble-client';
const client = new Client({
host: 'mumble://example.com',
port: 64738,
username: 'me',
});
await client.connect();
if (client.isConnected) {
console.log(client.welcomeText);
console.log(`logged in as ${client.self.name}`);
}
import { type Channel } from '@tf2pickup-org/mumble-client';
function printChannel(channel: Channel, level = 0) {
if (channel.name) {
console.log(channel.name.padStart(channel.name.length + level));
}
for (const subChannel of channel.subChannels) {
printChannel(subChannel, level + 1);
}
}
printChannel(client.channels.root);