Skip to content

A simple mumble client for managing mumble servers

License

Notifications You must be signed in to change notification settings

tf2pickup-org/mumble-client

Repository files navigation

mumble-client

A simple mumble client for managing mumble servers

Latest release Test status MIT license

Installation

$ npm i @tf2pickup-org/mumble-client

Examples

Connect to a mumble server

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}`);
}

List all channels

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);