User - Rantanen/node-mumble GitHub Wiki

User(data, client)

Params

  • data Object - User data.
  • client MumbleClient - Mumble client that owns this user.

Single user on the server.

user.ban([reason])

Attempts to ban the user.

Params

  • [reason] string - The reason to ban the user for.

user.canHear()

Checks whether the user can hear other people.

Returns: Boolean - True if the user can hear.

user.canTalk()

Checks whether the user can talk or not.

Returns: Boolean - True if the user can talk.

user.inputStream()

Returns an input stream for sending audio to the user.

Returns: MumbleInputStream - Input stream.

user.isRegistered()

true when the user is registered on the server.

Returns: Boolean - true if the user is registered.

user.kick([reason])

Attempts to kick the user.

Params

  • [reason] string - The reason to kick the user for.

user.moveToChannel(channel)

Moves the user to a channel

Params

  • channel Channel | string - Channel name or a channel object

user.outputStream([noEmptyFrames])

Returns an output stream for listening to the user audio.

Params

  • [noEmptyFrames] Boolean - True to cut the output stream during silence. If the output stream isn't cut it will keep emitting zero-values when the user isn't talking.

Returns: MumbleOutputStream - Output stream.

user.sendMessage(message)

Sends a message to the user.

Params

  • message string - The message to send.

user.setComment(comment)

Set the user's comment. Displayed when user's name is hovered over in client.

Params

  • comment String - The new comment

user.setSelfDeaf(isSelfDeaf)

Change a user's self deafened state. (Obviously) only works on yourself.

Params

  • isSelfDeaf Boolean - The new self deafened state

user.setSelfMute(isSelfMute)

Change a user's self muted state. (Obviously) only works on yourself.

Params

  • isSelfMute Boolean - The new self muted state

user.channel

User's current channel.

user.deaf

true when the user is deafened by an admin.

user.hash

The hash of the user certificate

user.id

User ID

See: User#session

User ID is specified only for users who are registered on the server. The user ID won't change when the user reconnects.

user.mute

true when the user is muted by an admin.

user.name

User name

user.prioritySpeaker

true when the user is a priority speaker.

user.recording

true when the user is recording the conversation.

user.selfDeaf

true when the user has deafened themselves.

user.selfMute

true when the user has muted themselves.

user.session

Session ID

See: User#id

Session ID is present for all users. The ID specifies the current user session and will change when the user reconnects.

user.suppress

true when the user is suppressed due to lack of permissions.

The user will be suppressed by the server if they don't have permissions to speak on the current channel.

Event: 'disconnect'

Emitted when the user disconnects

Also available through the client user-disconnect event.

Event: 'move'

Emitted when the user moves between channels.

Params

  • oldChannel Channel - The channel where the user was moved from.
  • newChannel Channel - The channel where the user was moved to.
  • actor User - The user who moved the channel or undefined for server.

Event: 'mute'

Emitted when the user is muted or unmuted by the server.

Params

  • status Boolean - True when the user is muted, false when unmuted.

Also available through the client user-mute event.

Event: 'priority-speaker'

Emitted when the user gains or loses priority speaker status.

Params

  • status Boolean - True when the user gains priority speaker status. False when they lose it.

Also available through the client user-priority-speaker event.

Event: 'recording'

Emitted when the user starts or stops recording.

Params

  • status Boolean - True when the user starts recording. False when they stop.

Also available through the client user-recording event.

Event: 'self-deaf'

Emitted when the user deafens or undeafens themselves.

Params

  • status Boolean - True when the user deafens themselves. False when undeafening.

Also available through the client user-self-deaf event.

Event: 'self-mute'

Emitted when the user mutes or unmutes themselves.

Params

  • status Boolean - True when the user mutes themselves. False when unmuting.

Also available through the client user-self-mute event.

Event: 'suppress'

Emitted when the user is suppressed or unsuppressed.

Params

  • status Boolean - True when the user is suppressed. False when unsuppressed.

Also available through the client user-suppress event.

⚠️ **GitHub.com Fallback** ⚠️