Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TeamSpeak

Hierarchy

  • EventEmitter
    • TeamSpeak

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Private channelgroups

channelgroups: Record<string, TeamSpeakChannelGroup>

Private channels

channels: Record<string, TeamSpeakChannel>

Private clients

clients: Record<string, TeamSpeakClient>

config

Private query

Private servergroups

servergroups: Record<string, TeamSpeakServerGroup>

Private servers

servers: Record<string, TeamSpeakServer>

Static defaultMaxListeners

defaultMaxListeners: number

Methods

addListener

  • addListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

ban

  • ban(__namedParameters: object): Promise<BanAdd>
  • Adds a new ban rule on the selected virtual server. All parameters are optional but at least one of the following must be set: ip, name, uid or mytsid.

    Parameters

    • __namedParameters: object
      • banreason: string
      • ip: undefined | string
      • mytsid: undefined | string
      • name: undefined | string
      • time: undefined | number
      • uid: undefined | string

    Returns Promise<BanAdd>

banDel

  • Removes one or all bans from the server

    Parameters

    • Optional banid: undefined | number

      the banid to remove, if not provided it will remove all bans

    Returns Promise<QueryResponseTypes[]>

banList

  • banList(start?: undefined | number, duration?: undefined | number): Promise<BanList[]>
  • Displays a list of active bans on the selected virtual server.

    Parameters

    • Optional start: undefined | number

      optional start from where clients should be listed

    • Optional duration: undefined | number

      optional duration on how much ban entries should be retrieved

    Returns Promise<BanList[]>

bindingList

  • returns a list of IP addresses used by the server instance on multi-homed machines.

    Returns Promise<BindingList[]>

channelCreate

  • Creates a new channel using the given properties. Note that this command accepts multiple properties which means that you're able to specifiy all settings of the new channel at once.

    Parameters

    • name: string

      the name of the channel

    • Default value properties: ChannelEdit = {}

      properties of the channel

    Returns Promise<TeamSpeakChannel>

channelDelPerm

  • Removes a set of specified permissions from a channel. Multiple permissions can be removed at once. A permission can be specified by permid or permsid.

    Parameters

    • cid: number

      the channel id

    • perm: string | number

      the permid or permsid

    Returns Promise<QueryResponseTypes[]>

channelDelete

  • Deletes an existing channel by ID. If force is set to 1, the channel will be deleted even if there are clients within. The clients will be kicked to the default channel with an appropriate reason message.

    Parameters

    • cid: number

      the channel id

    • Default value force: number = 0

      if set to 1 the channel will be deleted even when client are in it

    Returns Promise<QueryResponseTypes[]>

channelEdit

  • Changes a channels configuration using given properties. Note that this command accepts multiple properties which means that you're able to change all settings of the channel specified with cid at once.

    Parameters

    • cid: number

      the channel id

    • Default value properties: ChannelEdit = {}

      the properties of the channel which should get changed

    Returns Promise<QueryResponseTypes[]>

channelGroupAddPerm

  • channelGroupAddPerm(cgid: number, perm: string | number, value: number, skip?: number, negate?: number): Promise<QueryResponseTypes[]>
  • Adds a specified permissions to the channel group. A permission can be specified by permid or permsid.

    Parameters

    • cgid: number

      the channelgroup id

    • perm: string | number

      the permid or permsid

    • value: number

      value of the permission

    • Default value skip: number = 0

      whether the skip flag should be set

    • Default value negate: number = 0

      whether the negate flag should be set

    Returns Promise<QueryResponseTypes[]>

channelGroupClientList

  • Displays the IDs of all clients currently residing in the channel group.

    Parameters

    • cgid: number

      the channelgroup id

    • Optional cid: undefined | number

      the channel id

    Returns Promise<ChannelGroupClientList[]>

channelGroupCopy

  • channelGroupCopy(scgid: number, tcgid?: number, type?: number, name?: string): Promise<ChannelGroupCopy>
  • Creates a copy of the channel group. If tcgid is set to 0, the server will create a new group. To overwrite an existing group, simply set tcgid to the ID of a designated target group. If a target group is set, the name parameter will be ignored.

    Parameters

    • scgid: number

      the source channelgroup

    • Default value tcgid: number = 0

      the target channelgroup (0 to create a new group)

    • Default value type: number = 1

      the type of the group (0 = Template Group | 1 = Normal Group)

    • Default value name: string = "foo"

      name of the goup

    Returns Promise<ChannelGroupCopy>

channelGroupCreate

  • Creates a new channel group using a given name. The optional type parameter can be used to create ServerQuery groups and template groups.

    Parameters

    • name: string

      the name of the channelgroup

    • Default value type: number = 1

      type of the channelgroup

    Returns Promise<TeamSpeakChannelGroup>

channelGroupDelPerm

  • Removes a set of specified permissions from the channel group. A permission can be specified by permid or permsid.

    Parameters

    • cgid: number

      the channelgroup id

    • perm: string | number

      the permid or permsid

    Returns Promise<QueryResponseTypes[]>

channelGroupList

channelGroupPermList

  • channelGroupPermList(cgid: number, permsid?: boolean): Promise<PermList[]>
  • Displays a list of permissions assigned to the channel group specified with cgid.

    Parameters

    • cgid: number

      the channelgroup id to list

    • Default value permsid: boolean = false

      if the permsid option is set to true the output will contain the permission names.

    Returns Promise<PermList[]>

channelGroupPrivilegeKeyAdd

  • channelGroupPrivilegeKeyAdd(group: number, cid: number, description?: undefined | string, tokencustomset?: string): Promise<Token>
  • Create a new privilegekey token for a Channel Group and assigned Channel ID with the given description

    Parameters

    • group: number

      the channel group for which the token should be valid

    • cid: number

      channel id for which the token should be valid

    • Optional description: undefined | string

      token description

    • Default value tokencustomset: string = ""

      token custom set

    Returns Promise<Token>

channelGroupRename

  • Changes the name of the channel group

    Parameters

    • cgid: number

      the channelgroup id to rename

    • name: string

      new name of the ghannelgroup

    Returns Promise<QueryResponseTypes[]>

channelInfo

  • Displays detailed configuration information about a channel including ID, topic, description, etc.

    Parameters

    • cid: number

      the channel id

    Returns Promise<ChannelInfo>

channelList

channelMove

  • Moves a channel to a new parent channel with the ID cpid. If order is specified, the channel will be sorted right under the channel with the specified ID. If order is set to 0, the channel will be sorted right below the new parent.

    Parameters

    • cid: number

      the channel id

    • cpid: number

      channel parent id

    • Default value order: number = 0

      channel sort order

    Returns Promise<QueryResponseTypes[]>

channelPermList

  • channelPermList(cid: number, permsid?: boolean): Promise<PermList[]>
  • Displays a list of permissions defined for a channel.

    Parameters

    • cid: number

      the channel id

    • Default value permsid: boolean = false

      whether the permsid should be displayed aswell

    Returns Promise<PermList[]>

channelSetPerm

  • channelSetPerm(cid: number, perm: string | number, value: number): Promise<QueryResponseTypes[]>
  • Adds a set of specified permissions to a channel.

    Parameters

    • cid: number

      the channel id

    • perm: string | number

      the permid or permsid

    • value: number

      the value which should be set

    Returns Promise<QueryResponseTypes[]>

channelSetPerms

  • Adds a set of specified permissions to a channel. A permission can be specified by permid or permsid.

    example

    TeamSpeak.channelSetPerms(5, [{ permsid: "i_channel_needed_modify_power", permvalue: 75 }])

    Parameters

    • cid: number

      the channel id

    • permissions: any[]

      the permissions to assign

    Returns Promise<QueryResponseTypes[]>

clientAddPerm

  • clientAddPerm(cldbid: number, perm: string | number, value: number, skip?: number, negate?: number): Promise<QueryResponseTypes[]>
  • Adds a set of specified permissions to a client. Multiple permissions can be added by providing the three parameters of each permission. A permission can be specified by permid or permsid.

    Parameters

    • cldbid: number

      the client database id

    • perm: string | number

      the permid or permsid

    • value: number

      value of the permission

    • Default value skip: number = 0

      whether the skip flag should be set

    • Default value negate: number = 0

      whether the negate flag should be set

    Returns Promise<QueryResponseTypes[]>

clientAddServerGroup

  • clientAddServerGroup(cldbid: number, sgid: number | number[]): Promise<QueryResponseTypes[]>
  • Adds one or more servergroups to a client. Please note that a client cannot be added to default groups or template groups

    Parameters

    • cldbid: number

      one or more client database ids which should be added

    • sgid: number | number[]

      one or more servergroup ids which the client should be added to

    Returns Promise<QueryResponseTypes[]>

clientDBDelete

  • Deletes a clients properties from the database.

    Parameters

    • cldbid: number

      the client database id which should be deleted

    Returns Promise<QueryResponseTypes[]>

clientDBEdit

  • Changes a clients settings using given properties.

    Parameters

    • cldbid: number

      the client database id which should be edited

    • properties: ClientDBEdit

      the properties which should be modified

    Returns Promise<QueryResponseTypes[]>

clientDBFind

  • clientDBFind(pattern: string, isUid?: boolean): Promise<ClientDBFind[]>
  • Displays a list of client database IDs matching a given pattern. You can either search for a clients last known nickname or his unique identity by using the -uid option.

    Parameters

    • pattern: string

      the pattern which should be searched for

    • Default value isUid: boolean = false

      true when instead of the Name it should be searched for an uid

    Returns Promise<ClientDBFind[]>

clientDBInfo

  • clientDBInfo(cldbid: number | number[]): Promise<ClientDBInfo[]>
  • Returns the Clients Database Info

    Parameters

    • cldbid: number | number[]

      one or more client database ids to get

    Returns Promise<ClientDBInfo[]>

clientDBList

  • clientDBList(start?: number, duration?: number, count?: boolean): Promise<ClientDBList[]>
  • Returns the Clients Database List

    Parameters

    • Default value start: number = 0

      start offset

    • Default value duration: number = 1000

      amount of entries which should get retrieved

    • Default value count: boolean = true

      retrieve the count of entries

    Returns Promise<ClientDBList[]>

clientDelPerm

  • Removes a set of specified permissions from a client. Multiple permissions can be removed at once. A permission can be specified by permid or permsid

    Parameters

    • cldbid: number

      the client database id

    • perm: string | number

      the permid or permsid

    Returns Promise<QueryResponseTypes[]>

clientDelServerGroup

  • clientDelServerGroup(cldbid: number, sgid: number | number[]): Promise<QueryResponseTypes[]>
  • Removes one or more servergroups from the client.

    Parameters

    • cldbid: number

      one or more client database ids which should be added

    • sgid: number | number[]

      one or more servergroup ids which the client should be removed from

    Returns Promise<QueryResponseTypes[]>

clientInfo

  • clientInfo(clid: number | number[]): Promise<ClientInfo[]>
  • Returns General Info of the Client, requires the Client to be online

    Parameters

    • clid: number | number[]

      one or more client ids to get

    Returns Promise<ClientInfo[]>

clientKick

  • Kicks the Client from the Server

    Parameters

    • clid: number

      the client id

    • reasonid: ReasonIdentifier

      the reasonid

    • reasonmsg: string

      the message the client should receive when getting kicked

    Returns Promise<QueryResponseTypes[]>

clientList

clientMove

  • clientMove(clid: number, cid: number, cpw?: undefined | string): Promise<QueryResponseTypes[]>
  • Moves the Client to a different Channel

    Parameters

    • clid: number

      the client id

    • cid: number

      channel id in which the client should get moved

    • Optional cpw: undefined | string

      the channel password

    Returns Promise<QueryResponseTypes[]>

clientPermList

  • clientPermList(cldbid: number, permsid?: boolean): Promise<PermList[]>
  • Displays a list of permissions defined for a client

    Parameters

    • cldbid: number

      the client database id

    • Default value permsid: boolean = false

      if the permsid option is set to true the output will contain the permission names

    Returns Promise<PermList[]>

clientPoke

  • Pokes the Client with a certain message

    Parameters

    • clid: number

      the client id

    • msg: string

      the message the client should receive

    Returns Promise<QueryResponseTypes[]>

clientUpdate

complainAdd

  • Submits a complaint about the client with database ID dbid to the server.

    Parameters

    • cldbid: number

      filter only for certain client with the given database id

    • Default value message: string = ""

      the Message which should be added

    Returns Promise<QueryResponseTypes[]>

complainDel

  • Deletes the complaint about the client with ID tcldbid submitted by the client with ID fdbid from the server. If fcldbid will be left empty all complaints for the tcldbid will be deleted

    Parameters

    • tcldbid: number

      the target client database id

    • Default value fcldbid: number = 0

      the client database id which filed the report

    Returns Promise<QueryResponseTypes[]>

complainList

  • complainList(cldbid?: undefined | number): Promise<ComplainList[]>
  • Displays a list of complaints on the selected virtual server. If dbid is specified, only complaints about the targeted client will be shown.

    Parameters

    • Optional cldbid: undefined | number

      filter only for certain client with the given database id

    Returns Promise<ComplainList[]>

connectionInfo

customDelete

  • Removes a custom property from a client specified by the cldbid. This requires TeamSpeak Server Version 3.2.0 or newer.

    Parameters

    • cldbid: number

      the client Database ID which should be changed

    • ident: string

      the key which should be deleted

    Returns Promise<QueryResponseTypes[]>

customInfo

  • customInfo(cldbid: number): Promise<CustomInfo[]>
  • returns a list of custom properties for the client specified with cldbid.

    Parameters

    • cldbid: number

      the Client Database ID which should be retrieved

    Returns Promise<CustomInfo[]>

customSearch

  • customSearch(ident: string, pattern: string): Promise<CustomSearch>
  • Searches for custom client properties specified by ident and value. The value parameter can include regular characters and SQL wildcard characters (e.g. %).

    Parameters

    • ident: string

      the key to search for

    • pattern: string

      the search pattern to use

    Returns Promise<CustomSearch>

customSet

  • Creates or updates a custom property for client specified by the cldbid. Ident and value can be any value, and are the key value pair of the custom property. This requires TeamSpeak Server Version 3.2.0 or newer.

    Parameters

    • cldbid: number

      the client database id which should be changed

    • ident: string

      the key which should be set

    • value: string

      the value which should be set

    Returns Promise<QueryResponseTypes[]>

deleteChannelGroup

  • Deletes the channel group. If force is set to 1, the channel group will be deleted even if there are clients within.

    Parameters

    • cgid: number

      the channelgroup id

    • Default value force: number = 0

      if set to 1 the channelgroup will be deleted even when clients are in it

    Returns Promise<QueryResponseTypes[]>

downloadFile

  • downloadFile(path: string, cid?: number, cpw?: string): Promise<Buffer>
  • Returns the file in the channel with the given path

    Parameters

    • path: string

      the path whith the filename where the file should be uploaded to

    • Default value cid: number = 0

      channel id to download from

    • Default value cpw: string = ""

      channel password of the channel which will be uploaded to

    Returns Promise<Buffer>

downloadIcon

  • downloadIcon(name: string): Promise<Buffer>
  • Returns an Icon with the given Name

    Parameters

    • name: string

      the name of the icon to retrieve eg "icon_262672952"

    Returns Promise<Buffer>

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

Private evchannelcreated

Private evchanneldeleted

Private evchanneledited

Private evchannelmoved

Private evcliententerview

  • Gets called when a client connects to the TeamSpeak Server

    Parameters

    Returns void

Private evclientleftview

  • Gets called when a client discconnects from the TeamSpeak Server

    Parameters

    Returns void

Private evclientmoved

  • Gets called when a client moves to a different channel

    Parameters

    Returns void

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

Private evserveredited

  • Gets called when the server has been edited

    Parameters

    Returns Promise<void>

Private evtextmessage

Private evtokenused

  • Gets called when a client uses a privilege key

    Parameters

    Returns void

execute

  • Sends a raw command to the TeamSpeak Server.

    example

    ts3.execute("clientlist", ["-ip"]) ts3.execute("use", [9987], { client_nickname: "test" })

    Parameters

    • cmd: string
    • Rest ...args: any[]

      the command which should get executed on the teamspeak server

    Returns Promise<QueryResponseTypes[]>

forceQuit

  • forceQuit(): void

ftCreateDir

  • ftCreateDir(cid: number, dirname: string, cpw?: undefined | string): Promise<QueryResponseTypes[]>
  • Creates new directory in a channels file repository

    Parameters

    • cid: number

      the channel id to check for

    • dirname: string

      path to the directory

    • Optional cpw: undefined | string

      the channel password

    Returns Promise<QueryResponseTypes[]>

ftDeleteFile

  • ftDeleteFile(cid: number, name: string, cpw?: undefined | string): Promise<QueryResponseTypes[]>
  • Deletes one or more files stored in a channels file repository

    Parameters

    • cid: number

      the channel id to check for

    • name: string

      path to the file to delete

    • Optional cpw: undefined | string

      the channel password

    Returns Promise<QueryResponseTypes[]>

ftGetFileInfo

  • ftGetFileInfo(cid: number, name: string, cpw?: string): Promise<FTGetFileInfo>
  • Displays detailed information about one or more specified files stored in a channels file repository.

    Parameters

    • cid: number

      the channel id to check for

    • name: string

      the filepath to receive

    • Default value cpw: string = ""

      the channel password

    Returns Promise<FTGetFileInfo>

ftGetFileList

  • ftGetFileList(cid: number, path?: string, cpw?: undefined | string): Promise<FTGetFileList[]>
  • Displays a list of files and directories stored in the specified channels file repository.

    Parameters

    • cid: number

      the channel id to check for

    • Default value path: string = "/"

      the path to list

    • Optional cpw: undefined | string

      the channel password

    Returns Promise<FTGetFileList[]>

ftInitDownload

  • Initializes a file transfer download. clientftfid is an arbitrary ID to identify the file transfer on client-side. On success, the server generates a new ftkey which is required to start downloading the file through TeamSpeak 3's file transfer interface.

    Parameters

    Returns Promise<FTInitDownload>

ftInitUpload

  • Initializes a file transfer upload. clientftfid is an arbitrary ID to identify the file transfer on client-side. On success, the server generates a new ftkey which is required to start uploading the file through TeamSpeak 3's file transfer interface.

    Parameters

    Returns Promise<FTInitUpload>

ftRenameFile

  • ftRenameFile(cid: number, oldname: string, newname: string, tcid?: undefined | number, cpw?: undefined | string, tcpw?: undefined | string): Promise<QueryResponseTypes[]>
  • Renames a file in a channels file repository. If the two parameters tcid and tcpw are specified, the file will be moved into another channels file repository

    Parameters

    • cid: number

      the channel id to check for

    • oldname: string

      the path to the file which should be renamed

    • newname: string

      the path to the file with the new name

    • Optional tcid: undefined | number

      target channel id if the file should be moved to a different channel

    • Optional cpw: undefined | string

      the channel password from where the file gets renamed

    • Optional tcpw: undefined | string

      the channel password from where the file will get transferred to

    Returns Promise<QueryResponseTypes[]>

ftStop

  • Stops the running file transfer with server-side ID serverftfid.

    Parameters

    • serverftfid: number

      server file transfer id

    • Default value del: number = 1

    Returns Promise<QueryResponseTypes[]>

getChannelByID

  • Retrieves a Single Channel by the given Channel ID

    Parameters

    • cid: number

      the channel id

    Returns Promise<TeamSpeakChannel | undefined>

getChannelByName

  • Retrieves a Single Channel by the given Channel Name

    Parameters

    • channel_name: string

      the name of the channel

    Returns Promise<TeamSpeakChannel | undefined>

getChannelGroupByID

getChannelGroupByName

  • Retrieves a single ChannelGroup by the given ChannelGroup Name

    Parameters

    • name: string

      the channelGroup name

    Returns Promise<TeamSpeakChannelGroup | undefined>

getClientByDBID

  • getClientByDBID(client_database_id: number): Promise<TeamSpeakClient | undefined>
  • Retrieves a Single Client by the given Client Database ID

    Parameters

    • client_database_id: number

      the client database Id

    Returns Promise<TeamSpeakClient | undefined>

getClientByID

  • Retrieves a Single Client by the given Client ID

    Parameters

    • clid: number

      the client id

    Returns Promise<TeamSpeakClient | undefined>

getClientByName

  • getClientByName(client_nickname: string): Promise<TeamSpeakClient | undefined>
  • Retrieves a Single Client by the given Client Unique Identifier

    Parameters

    • client_nickname: string

      the nickname of the client

    Returns Promise<TeamSpeakClient | undefined>

getClientByUID

  • getClientByUID(client_unique_identifier: string): Promise<TeamSpeakClient | undefined>
  • Retrieves a Single Client by the given Client Unique Identifier

    Parameters

    • client_unique_identifier: string

      the client unique identifier

    Returns Promise<TeamSpeakClient | undefined>

getIconName

  • getIconName(permlist: Promise<PermList[]>): Promise<string>
  • Gets the Icon Name of a resolveable Perm List

    Parameters

    • permlist: Promise<PermList[]>

      expects a promise which resolves to a permission list

    Returns Promise<string>

getMaxListeners

  • getMaxListeners(): number
  • Returns number

getServerGroupByID

getServerGroupByName

  • Retrieves a single ServerGroup by the given ServerGroup Name

    Parameters

    • name: string

      the servergroup name

    Returns Promise<TeamSpeakServerGroup | undefined>

gm

  • Sends a text message to all clients on all virtual servers in the TeamSpeak 3 Server instance.

    Parameters

    • msg: string

      message which will be sent to all instances

    Returns Promise<QueryResponseTypes[]>

Private handleCache

  • Parses the whole Cache by given Objects

    Parameters

    • cache: Record<string, NodeType>

      the cache object

    • list: QueryResponse[]

      the list to check against the cache

    • key: keyof QueryResponse

      the key used to identify the object inside the cache

    • node: NodeConstructable<NodeType>

      the class which should be used

    Returns object[]

Private handleReady

  • handleReady(): void
  • handle after successfully connecting to a TeamSpeak Server

    Returns void

hostInfo

  • Displays detailed connection information about the server instance including uptime, number of virtual servers online, traffic information, etc.

    Returns Promise<HostInfo>

instanceEdit

instanceInfo

  • Displays the server instance configuration including database revision number, the file transfer port, default group IDs, etc.

    Returns Promise<InstanceInfo>

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

logAdd

  • Writes a custom entry into the servers log. Depending on your permissions, you'll be able to add entries into the server instance log and/or your virtual servers log. The loglevel parameter specifies the type of the entry

    Parameters

    • loglevel: LogLevel

      level 1 to 4

    • logmsg: string

      message to log

    Returns Promise<QueryResponseTypes[]>

logView

  • logView(lines?: number, reverse?: number, instance?: number, begin_pos?: number): Promise<LogView[]>
  • Displays a specified number of entries from the servers log. If instance is set to 1, the server will return lines from the master logfile (ts3server_0.log) instead of the selected virtual server logfile.

    Parameters

    • Default value lines: number = 1000

      amount of lines to receive

    • Default value reverse: number = 0

      invert output (like Array.reverse)

    • Default value instance: number = 0

      instance or virtualserver log

    • Default value begin_pos: number = 0

      begin at position

    Returns Promise<LogView[]>

login

  • Authenticates with the TeamSpeak 3 Server instance using given ServerQuery login credentials.

    Parameters

    • username: string

      the username which you want to login with

    • password: string

      the password you want to login with

    Returns Promise<QueryResponseTypes[]>

logout

messageAdd

  • messageAdd(cluid: string, subject: string, message: string): Promise<QueryResponseTypes[]>
  • Sends an offline message to the client specified by uid.

    Parameters

    • cluid: string

      client unique identifier

    • subject: string

      subject of the message

    • message: string

      message text

    Returns Promise<QueryResponseTypes[]>

messageDel

  • Sends an offline message to the client specified by uid.

    Parameters

    • msgid: number

      the message id which should be deleted

    Returns Promise<QueryResponseTypes[]>

messageGet

  • Displays an existing offline message with the given id from the inbox.

    Parameters

    • msgid: number

      the message id

    Returns Promise<MessageGet>

messageList

  • Displays a list of offline messages you've received. The output contains the senders unique identifier, the messages subject, etc.

    Returns Promise<MessageList[]>

messageUpdate

  • Displays an existing offline message with the given id from the inbox.

    Parameters

    • msgid: number

      the message id

    • Default value flag: number = 1

      if flag is set to 1 the message will be marked as read

    Returns Promise<QueryResponseTypes[]>

off

  • off(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(event: "error", listener: function): this
  • on(event: "ready", listener: function): this
  • on(event: "close", listener: function): this
  • on(event: "flooding", listener: function): this
  • on(event: "debug", listener: function): this
  • on(event: "clientconnect", listener: function): this
  • on(event: "clientdisconnect", listener: function): this
  • on(event: "tokenused", listener: function): this
  • on(event: "textmessage", listener: function): this
  • on(event: "clientmoved", listener: function): this
  • on(event: "serveredit", listener: function): this
  • on(event: "channeledit", listener: function): this
  • on(event: "channelcreate", listener: function): this
  • on(event: "channelmoved", listener: function): this
  • on(event: "channeldelete", listener: function): this
  • Parameters

    • event: "error"
    • listener: function
        • (error: Error): void
        • Parameters

          • error: Error

          Returns void

    Returns this

  • Parameters

    • event: "ready"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    Returns this

  • Parameters

    • event: "debug"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • event: "tokenused"
    • listener: function

    Returns this

  • Parameters

    • event: "textmessage"
    • listener: function

    Returns this

  • Parameters

    • event: "clientmoved"
    • listener: function

    Returns this

  • Parameters

    • event: "serveredit"
    • listener: function
        • (event: ServerEdit): void
        • Parameters

          • event: ServerEdit

          Returns void

    Returns this

  • Parameters

    • event: "channeledit"
    • listener: function
        • (event: ChannelEdit): void
        • Parameters

          • event: ChannelEdit

          Returns void

    Returns this

  • Parameters

    Returns this

  • Parameters

    • event: "channelmoved"
    • listener: function

    Returns this

  • Parameters

    Returns this

once

  • once(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

permFind

  • permFind(perm: number | string): Promise<PermFind[]>
  • Retrieves detailed information about all assignments of the permission. The output is similar to permoverview which includes the type and the ID of the client, channel or group associated with the permission.

    Parameters

    • perm: number | string

      perm id or name to retrieve

    Returns Promise<PermFind[]>

permGet

  • permGet(perm: number | string): Promise<PermGet>
  • Retrieves the current value of the permission for your own connection. This can be useful when you need to check your own privileges.

    Parameters

    • perm: number | string

      perm id or name which should be checked

    Returns Promise<PermGet>

permIdGetByName

  • Retrieves the database ID of one or more permissions specified by permsid.

    Parameters

    • permsid: string

      one name

    Returns Promise<PermIdGetByName>

permIdsGetByName

  • Retrieves the database ID of one or more permissions specified by permsid.

    Parameters

    • permsid: string[]

      multiple permission names

    Returns Promise<PermIdGetByName[]>

permOverview

  • permOverview(cldbid: number, cid: number, perms?: number[] | string[]): Promise<PermOverview[]>
  • Displays all permissions assigned to a client for the channel specified with cid. If permid is set to 0, all permissions will be displayed. A permission can be specified by permid or permsid.

    Parameters

    • cldbid: number

      the client database id

    • cid: number

      one or more permission names

    • Default value perms: number[] | string[] = []

    Returns Promise<PermOverview[]>

permReset

  • permReset(): Promise<Token>
  • Restores the default permission settings on the selected virtual server and creates a new initial administrator token. Please note that in case of an error during the permreset call - e.g. when the database has been modified or corrupted - the virtual server will be deleted from the database.

    Returns Promise<Token>

permissionList

  • Retrieves a list of permissions available on the server instance including ID, name and description.

    Returns Promise<PermissionList[]>

prependListener

  • prependListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

privilegeKeyAdd

  • privilegeKeyAdd(tokentype: TokenType, group: number, cid?: number, description?: string, customset?: string): Promise<Token>
  • Create a new token.+ If type is set to 0, the ID specified with tokenid will be a server group ID. Otherwise, tokenid is used as a channel group ID and you need to provide a valid channel ID using channelid.

    Parameters

    • tokentype: TokenType

      token type

    • group: number

      depends on the type given, add either a valid channelgroup or servergroup

    • Default value cid: number = 0

      depends on the type given, add a valid channel id

    • Default value description: string = ""

      token description

    • Default value customset: string = ""

      token custom set

    Returns Promise<Token>

privilegeKeyDelete

  • Deletes an existing token matching the token key specified with token.

    Parameters

    • token: string

      the token which should be deleted

    Returns Promise<QueryResponseTypes[]>

privilegeKeyList

privilegeKeyUse

  • Use a token key gain access to a server or channel group. Please note that the server will automatically delete the token after it has been used.

    Parameters

    • token: string

      the token which should be used

    Returns Promise<QueryResponseTypes[]>

queryLoginAdd

  • queryLoginAdd(client_login_name: string, cldbid?: undefined | number): Promise<QueryLoginAdd>
  • Adds a new query client login, or enables query login for existing clients. When no virtual server has been selected, the command will create global query logins. Otherwise the command enables query login for existing client, and cldbid must be specified.

    Parameters

    • client_login_name: string

      the login name

    • Optional cldbid: undefined | number

      the database id which should be used

    Returns Promise<QueryLoginAdd>

queryLoginDel

  • Deletes an existing server query login on selected server. When no virtual server has been selected, deletes global query logins instead.

    Parameters

    • cldbid: number

      deletes the querylogin of this client

    Returns Promise<QueryResponseTypes[]>

queryLoginList

  • queryLoginList(pattern?: undefined | string, start?: undefined | number, duration?: undefined | number): Promise<QueryLoginList[]>
  • List existing query client logins. The pattern parameter can include regular characters and SQL wildcard characters (e.g. %). Only displays query logins of the selected virtual server, or all query logins when no virtual server have been selected.

    Parameters

    • Optional pattern: undefined | string

      the pattern to filter for client login names

    • Optional start: undefined | number

      the offset from where clients should be listed

    • Optional duration: undefined | number

      how many clients should be listed

    Returns Promise<QueryLoginList[]>

quit

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

registerEvent

  • Subscribes to an Event

    Parameters

    • event: string

      the event on which should be subscribed

    • Optional id: undefined | number

      the channel id, only required when subscribing to the "channel" event

    Returns Promise<QueryResponseTypes[]>

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

sendTextMessage

  • Sends a text message a specified target. The type of the target is determined by targetmode while target specifies the ID of the recipient, whether it be a virtual server, a channel or a client.

    Parameters

    • target: number

      target client id which should receive the message

    • targetmode: TextMessageTargetMode

      targetmode (1: client, 2: channel, 3: server)

    • msg: string

      the message the client should receive

    Returns Promise<QueryResponseTypes[]>

serverCreate

  • Creates a new virtual server using the given properties and displays its ID, port and initial administrator privilege key. If virtualserver_port is not specified, the server will test for the first unused UDP port

    Parameters

    Returns Promise<ServerCreate>

serverDelete

serverEdit

  • Changes the selected virtual servers configuration using given properties. Note that this command accepts multiple properties which means that you're able to change all settings of the selected virtual server at once.

    Parameters

    Returns Promise<QueryResponseTypes[]>

serverGroupAddClient

  • serverGroupAddClient(cldbid: number | number[], sgid: number): Promise<QueryResponseTypes[]>
  • Adds one or more clients to a server group specified with sgid. Please note that a client cannot be added to default groups or template groups

    Parameters

    • cldbid: number | number[]

      one or more client database ids which should be added

    • sgid: number

      the servergroup id which the client(s) should be added to

    Returns Promise<QueryResponseTypes[]>

serverGroupAddPerm

  • serverGroupAddPerm(sgid: number, perm: string | number, value: number, skip?: number, negate?: number): Promise<QueryResponseTypes[]>
  • Adds a specified permissions to the server group. A permission can be specified by permid or permsid.

    Parameters

    • sgid: number

      the ServerGroup id

    • perm: string | number

      the permid or permsid

    • value: number

      value of the Permission

    • Default value skip: number = 0

      whether the skip flag should be set

    • Default value negate: number = 0

      whether the negate flag should be set

    Returns Promise<QueryResponseTypes[]>

serverGroupClientList

serverGroupCopy

  • serverGroupCopy(ssgid: number, tsgid?: number, type?: number, name?: string): Promise<ServerGroupCopy>
  • Creates a copy of the server group specified with ssgid. If tsgid is set to 0, the server will create a new group. To overwrite an existing group, simply set tsgid to the ID of a designated target group. If a target group is set, the name parameter will be ignored.

    Parameters

    • ssgid: number

      the source ServerGroup

    • Default value tsgid: number = 0

      the target ServerGroup, 0 to create a new Group

    • Default value type: number = 1

      the type of the servergroup (0 = Query Group | 1 = Normal Group)

    • Default value name: string = "foo"

      name of the group

    Returns Promise<ServerGroupCopy>

serverGroupCreate

  • Creates a new server group using the name specified with name. The optional type parameter can be used to create ServerQuery groups and template groups.

    Parameters

    • name: string

      the name of the servergroup

    • Default value type: number = 1

      type of the servergroup

    Returns Promise<TeamSpeakServerGroup>

serverGroupDel

  • Deletes the server group. If force is set to 1, the server group will be deleted even if there are clients within.

    Parameters

    • sgid: number

      the servergroup id

    • Default value force: number = 0

      if set to 1 the servergoup will be deleted even when clients stil belong to this group

    Returns Promise<QueryResponseTypes[]>

serverGroupDelClient

  • serverGroupDelClient(cldbid: number | number[], sgid: number): Promise<QueryResponseTypes[]>
  • Removes one or more clients from the server group specified with sgid.

    Parameters

    • cldbid: number | number[]

      one or more client database ids which should be added

    • sgid: number

      the servergroup id which the client(s) should be removed from

    Returns Promise<QueryResponseTypes[]>

serverGroupDelPerm

  • Removes a set of specified permissions from the server group. A permission can be specified by permid or permsid.

    Parameters

    • sgid: number

      the servergroup id

    • perm: string | number

      the permid or permsid

    Returns Promise<QueryResponseTypes[]>

serverGroupList

  • Displays a list of server groups available. Depending on your permissions, the output may also contain global ServerQuery groups and template groups.

    Parameters

    Returns Promise<TeamSpeakServerGroup[]>

serverGroupPermList

  • serverGroupPermList(sgid: number, permsid?: boolean): Promise<PermList[]>
  • Displays a list of permissions assigned to the server group specified with sgid.

    Parameters

    • sgid: number

      the servergroup id

    • Default value permsid: boolean = false

      if the permsid option is set to true the output will contain the permission names

    Returns Promise<PermList[]>

serverGroupPrivilegeKeyAdd

  • serverGroupPrivilegeKeyAdd(group: number, description?: undefined | string, tokencustomset?: string): Promise<Token>
  • Create a new privilegekey token for a ServerGroup with the given description

    Parameters

    • group: number

      servergroup which should be generated the token for

    • Optional description: undefined | string

      token description

    • Default value tokencustomset: string = ""

      token custom set

    Returns Promise<Token>

serverGroupRename

  • Changes the name of the server group

    Parameters

    • sgid: number

      the servergroup id

    • name: string

      new name of the servergroup

    Returns Promise<QueryResponseTypes[]>

serverIdGetByPort

  • Displays the database ID of the virtual server running on the UDP port

    Parameters

    • virtualserver_port: number

      the server port where data should be retrieved

    Returns Promise<ServerIdGetByPort>

serverInfo

  • Displays detailed configuration information about the selected virtual server including unique ID, number of clients online, configuration, etc.

    Returns Promise<ServerInfo>

serverList

  • Displays a list of virtual servers including their ID, status, number of clients online, etc.

    Parameters

    Returns Promise<TeamSpeakServer[]>

serverProcessStop

  • Stops the entire TeamSpeak 3 Server instance by shutting down the process.

    Parameters

    • Optional reasonmsg: undefined | string

      specifies a text message that is sent to the clients before the client disconnects (requires TeamSpeak Server 3.2.0 or newer).

    Returns Promise<QueryResponseTypes[]>

serverStart

  • Starts the virtual server. Depending on your permissions, you're able to start either your own virtual server only or all virtual servers in the server instance.

    Parameters

    • sid: number

      the server id to start

    Returns Promise<QueryResponseTypes[]>

serverStop

  • Stops the virtual server. Depending on your permissions, you're able to stop either your own virtual server only or all virtual servers in the server instance.

    Parameters

    • sid: number

      the server id to stop

    • Optional reasonmsg: undefined | string

      Specifies a text message that is sent to the clients before the client disconnects (requires TeamSpeak Server 3.2.0 or newer).

    Returns Promise<QueryResponseTypes[]>

serverTempPasswordAdd

  • Sets a new temporary server password specified with pw. The temporary password will be valid for the number of seconds specified with duration. The client connecting with this password will automatically join the channel specified with tcid. If tcid is set to 0, the client will join the default channel.

    Parameters

    Returns Promise<QueryResponseTypes[]>

serverTempPasswordDel

serverTempPasswordList

  • Returns a list of active temporary server passwords. The output contains the clear-text password, the nickname and unique identifier of the creating client.

    Returns Promise<ServerTempPasswordList[]>

setClientChannelGroup

  • setClientChannelGroup(cgid: number, cid: number, cldbid: number): Promise<QueryResponseTypes[]>
  • Sets the channel group of a client

    Parameters

    • cgid: number

      the channelgroup which the client should get assigned

    • cid: number

      the channel in which the client should be assigned the group

    • cldbid: number

      the client database id which should be added to the group

    Returns Promise<QueryResponseTypes[]>

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

unregisterEvent

uploadFile

  • uploadFile(path: string, data: string | Buffer, cid?: number, cpw?: string): Promise<void>
  • Uploads a file

    Parameters

    • path: string

      the path whith the filename where the file should be uploaded to

    • data: string | Buffer

      the data to upload

    • Default value cid: number = 0

      channel id to upload to

    • Default value cpw: string = ""

      channel password of the channel which will be uploaded to

    Returns Promise<void>

useByPort

  • useByPort(port: number, client_nickname?: undefined | string): Promise<QueryResponseTypes[]>
  • Selects the virtual server specified with the port to allow further interaction.

    Parameters

    • port: number

      the port the server runs on

    • Optional client_nickname: undefined | string

      set nickname when selecting a server

    Returns Promise<QueryResponseTypes[]>

useBySid

  • useBySid(sid: number, client_nickname?: undefined | string): Promise<QueryResponseTypes[]>
  • Selects the virtual server specified with the sid to allow further interaction.

    Parameters

    • sid: number

      the server id

    • Optional client_nickname: undefined | string

      set nickname when selecting a server

    Returns Promise<QueryResponseTypes[]>

version

  • Displays the servers version information including platform and build number.

    Returns Promise<Version>

whoami

  • returns information about your current ServerQuery connection including your loginname, etc.

    Returns Promise<Whoami>

Static connect

Static filter

  • filter<T>(array: T[], filter: T): T[]
  • filters an array with given filter

    Type parameters

    Parameters

    • array: T[]

      the array which should get filtered

    • filter: T

      filter object

    Returns T[]

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Static singleResponse

  • singleResponse<T>(input: T | T[]): T
  • retrieves the first element of an array

    Type parameters

    • T

    Parameters

    • input: T | T[]

      the response input

    Returns T

Static toArray

  • toArray<T>(input: T | T[]): T[]
  • Transforms an Input to an Array

    Type parameters

    • T

    Parameters

    • input: T | T[]

      input data which should be converted to an array

    Returns T[]

Generated using TypeDoc