Class TeamSpeak

Hierarchy

  • EventEmitter
    • TeamSpeak

Constructors

Properties

Methods

apiKeyAdd apiKeyDel apiKeyList ban banClient banDel banList bindingList channelClientPermList channelCreate channelDelPerm channelDelete channelEdit channelFind channelGroupAddPerm channelGroupClientList channelGroupCopy channelGroupCreate channelGroupDelPerm channelGroupList channelGroupPermList channelGroupPrivilegeKeyAdd channelGroupRename channelInfo channelList channelMove channelPermList channelSetPerm channelSetPerms clientAddPerm clientAddServerGroup clientDbDelete clientDbEdit clientDbFind clientDbInfo clientDbList clientDelPerm clientDelServerGroup clientEdit clientFind clientGetDbidFromUid clientGetIds clientGetNameFromDbid clientGetNameFromUid clientGetUidFromClid clientInfo clientKick clientList clientMove clientPermList clientPoke clientSetServerQueryLogin clientUpdate complainAdd complainDel complainList connect connectionInfo createChannelGroupPermBuilder createChannelPermBuilder createClientPermBuilder createServerGroupPermBuilder createSnapshot customDelete customInfo customSearch customSet deleteChannelGroup deploySnapshot downloadFile downloadIcon evchannelcreated evchanneldeleted evchanneledited evchannelmoved evcliententerview evclientleftview evclientmoved evserveredited evtextmessage evtokenused execute forceQuit ftCreateDir ftDeleteFile ftGetFileInfo ftGetFileList ftInitDownload ftInitUpload ftList ftRenameFile ftStop getChannelById getChannelByName getChannelGroupById getChannelGroupByName getClientByDbid getClientById getClientByName getClientByUid getIconId getPermBuilder getServerGroupById getServerGroupByName gm handleCache handleNewListener handleReady hostInfo ignoreQueryClient instanceEdit instanceInfo isSubscribedToEvent logAdd logQueryTiming logView login logout messageAdd messageDel messageGet messageList messageUpdate on permFind permGet permIdGetByName permIdsGetByName permOverview permReset permissionList priorize privilegeKeyAdd privilegeKeyDelete privilegeKeyList privilegeKeyUse queryLoginAdd queryLoginDel queryLoginList quit reconnect registerEvent self sendChannelMessage sendTextMessage serverCreate serverDelete serverEdit serverGroupAddClient serverGroupAddPerm serverGroupClientList serverGroupCopy serverGroupCreate serverGroupDel serverGroupDelClient serverGroupDelPerm serverGroupList serverGroupPermList serverGroupPrivilegeKeyAdd serverGroupRename serverGroupsByClientId serverIdGetByPort serverInfo serverList serverProcessStop serverStart serverStop serverTempPasswordAdd serverTempPasswordDel serverTempPasswordList setClientChannelGroup unregisterEvent updateContext updateContextReject updateContextResolve uploadFile uploadIcon useByPort useBySid version whoami connect filter singleResponse toArray wait

Constructors

Properties

channelgroups: Record<string, TeamSpeakChannelGroup> = {}
channels: Record<string, TeamSpeakChannel> = {}
clients: Record<string, TeamSpeakClient> = {}
context: Context = ...
priorizeNextCommand: boolean = false
query: TeamSpeakQuery
serverVersion: undefined | Version
servergroups: Record<string, TeamSpeakServerGroup> = {}
servers: Record<string, TeamSpeakServer> = {}

Methods

  • Parameters

    • props: ApiKeyAdd

    Returns Promise<ApiKeyAdd>

  • Deletes an apikey. Any apikey owned by the current user, can always be deleted Deleting apikeys from other requires bVirtualserverApikeyManage

    Parameters

    • id: string

      the key id to delete

    Returns Promise<[]>

  • Lists all apikeys owned by the user, or of all users using cldbid=*. Usage of cldbid=... requires bVirtualserverApikeyManage.

    Parameters

    • props: ApiKeyList = {}

    Returns Promise<ApiKeyEntry[]>

  • 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

    • properties: BanAdd

    Returns Promise<BanAdd>

  • Bans the client specified with ID clid from the server. Please note that this will create two separate ban rules for the targeted clients IP address and his unique identifier.

    Parameters

    • properties: BanClient

    Returns Promise<BanAdd>

  • Removes one or all bans from the server

    Parameters

    • Optional banid: string

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

    Returns Promise<[]>

  • Displays a list of active bans on the selected virtual server.

    Parameters

    • Optional start: number

      optional start from where clients should be listed

    • Optional duration: number

      optional duration on how much ban entries should be retrieved

    Returns Promise<BanEntry[]>

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

    Returns Promise<BindingEntry[]>

  • displays a list of permissions defined for a client in a specific channel

    Parameters

    • channel: ChannelType

      the channel to search from

    • client: TeamSpeakClient.ClientType

      the client database id to get permissions from

    • Optional permsid: false

      wether to retrieve permission names instead of ids

    Returns Promise<ChannelClientPermIdList>

  • Parameters

    Returns Promise<ChannelClientPermSidList>

  • 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

    • properties: ChannelEdit = {}

      properties of the channel

    Returns Promise<TeamSpeakChannel>

  • 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

    • channel: ChannelType

      the channel id

    • perm: string | number

      the permid or permsid

    Returns Promise<[]>

  • 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

    • channel: ChannelType

      the channel id

    • force: boolean = false

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

    Returns Promise<[]>

  • 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

    • channel: ChannelType

      the channel id

    • properties: ChannelEdit = {}

      the properties of the channel which should get changed

    Returns Promise<[]>

  • displays a list of channels matching a given name pattern

    Parameters

    • pattern: string

      the channel name pattern to search for

    Returns Promise<ChannelFind[]>

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

    Parameters

    Returns Permission<any>

  • Parameters

    Returns Promise<[]>

  • 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

    Returns Promise<ChannelGroupCopy>

  • 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

    • type: number = 1

      type of the channelgroup

    Returns Promise<TeamSpeakChannelGroup>

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

    Parameters

    Returns Promise<[]>

  • Displays a list of channel groups available. Depending on your permissions, the output may also contain template groups.

    Parameters

    • filter: Partial<ChannelGroupEntry> = {}

    Returns Promise<TeamSpeakChannelGroup[]>

  • Displays a list of permissions assigned to the channel group specified with cgid.

    Parameters

    • group: TeamSpeakChannelGroup.GroupType

      the channelgroup id to list

    • permsid: boolean = false

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

    Returns Promise<Permission<{
        cgid: string;
    }>[]>

  • Create a new privilegekey token for a Channel Group and assigned Channel ID with the given description

    Parameters

    Returns Promise<Token>

  • Changes the name of the channel group

    Parameters

    Returns Promise<[]>

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

    Parameters

    Returns Promise<ChannelInfo>

  • 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

    • channel: ChannelType

      the channel id

    • parent: ChannelType

      channel parent id

    • order: number = 0

      channel sort order

    Returns Promise<[]>

  • Displays a list of permissions defined for a channel.

    Parameters

    • channel: ChannelType

      the channel id

    • permsid: boolean = false

      whether the permsid should be displayed aswell

    Returns Promise<Permission<{
        cid: string;
    }>[]>

  • Adds a set of specified permissions to a channel.

    Parameters

    • channel: ChannelType

      the channel id

    • perm: undefined

      the permission object

    Returns Permission<any>

  • Parameters

    Returns Promise<[]>

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

    Parameters

    • channel: ChannelType

      the channel id

    • permissions: {
          permid?: number;
          permsid?: string;
          permvalue: number;
      }[]

      the permissions to assign

    Returns Promise<[]>

    Example

    TeamSpeak.channelSetPerms(5, [{ permsid: "i_channel_needed_modify_power", permvalue: 75 }])
    
  • 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

    Returns Permission<any>

  • Parameters

    Returns Promise<[]>

  • Adds one or more servergroups to a client. Please note that a client cannot be added to default groups or template groups

    Parameters

    Returns Promise<[]>

  • Deletes a clients properties from the database.

    Parameters

    Returns Promise<[]>

  • Changes a clients settings using given properties.

    Parameters

    • client: TeamSpeakClient.ClientType

      the client database id which should be edited

    • properties: ClientDBEdit

      the properties which should be modified

    Returns Promise<[]>

  • 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

    • isUid: boolean = false

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

    Returns Promise<ClientDBFind[]>

  • Returns the Clients Database Info

    Parameters

    Returns Promise<ClientDBInfo[]>

  • Returns the Clients Database List

    Parameters

    • start: number = 0

      start offset

    • duration: number = 1000

      amount of entries which should get retrieved

    • count: boolean = true

      retrieve the count of entries

    Returns Promise<ClientDBEntry[]>

  • 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

    Returns Promise<[]>

  • edits a specific client

    Parameters

    Returns Promise<[]>

  • displays a list of clients matching a given name pattern

    Parameters

    • pattern: string

      the pattern to search clients

    Returns Promise<ClientFind[]>

  • displays the database ID matching the unique identifier specified by cluid

    Parameters

    • cluid: string

      the unique id to search for

    Returns Promise<ClientGetDbidFromUid>

  • displays all client IDs matching the unique identifier specified by cluid

    Parameters

    • cluid: string

      the unique id to search for

    Returns Promise<ClientGetIdEntry[]>

  • displays the unique identifier and nickname matching the database ID specified by cldbid

    Parameters

    • cldbid: string

      client database it to search from

    Returns Promise<ClientGetNameFromDbid>

  • displays the database ID and nickname matching the unique identifier specified by cluid

    Parameters

    • cluid: string

      the unique id to search for

    Returns Promise<ClientGetNameFromUid>

  • displays the database ID and nickname matching the unique identifier specified by cluid

    Parameters

    • clid: string

      the client id to search from

    Returns Promise<ClientGetUidFromClid>

  • Returns General Info of the Client, requires the Client to be online

    Parameters

    Returns Promise<ClientInfo[]>

  • Kicks the Client from the Server

    Parameters

    • client: TeamSpeakClient.ClientType

      the client id

    • reasonid: ReasonIdentifier

      the reasonid

    • reasonmsg: string

      the message the client should receive when getting kicked

    • continueOnError: boolean = false

      ignore errors

    Returns Promise<[]>

  • Moves the Client to a different Channel

    Parameters

    • client: TeamSpeakClient.ClientType

      the client id

    • channel: ChannelType

      channel id in which the client should get moved

    • Optional cpw: string

      the channel password

    • continueOnError: boolean = false

      ignore errors

    Returns Promise<[]>

  • Displays a list of permissions defined for a client

    Parameters

    • client: TeamSpeakClient.ClientType

      the client database id

    • permsid: boolean = false

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

    Returns Promise<Permission<{
        cldbid: string;
    }>[]>

  • Pokes the Client with a certain message

    Parameters

    Returns Promise<[]>

  • Updates your own ServerQuery login credentials using a specified username. The password will be auto-generated.

    Parameters

    • name: string

    Returns Promise<ClientSetServerQueryLogin>

  • Change your ServerQuery clients settings using given properties.

    Parameters

    • props: ClientUpdate

      the properties which should be changed

    Returns Promise<[]>

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

    Parameters

    • client: TeamSpeakClient.ClientType

      filter only for certain client with the given database id

    • message: string = ""

      the Message which should be added

    Returns Promise<[]>

  • 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

    Returns Promise<[]>

  • Displays a list of complaints on the selected virtual server. If dbid is specified, only complaints about the targeted client will be shown.

    Parameters

    Returns Promise<ComplainEntry[]>

  • returns detailed connection information about the selected virtual server including uptime, traffic information, etc.

    Returns Promise<ServerRequestConnectionInfo>

  • creates a channel group perm builder for the specified channel group id

    Parameters

    • cgid: string

    Returns Permission<{
        cgid: string;
    }>

  • creates a channel perm builder for the specified channel id

    Parameters

    • cid: string

    Returns Permission<{
        cid: string;
    }>

  • creates a client perm builder for the specified client database id

    Parameters

    • cldbid: string

    Returns Permission<{
        cldbid: string;
    }>

  • creates a servergroup perm builder for the specified server group id

    Parameters

    • sgid: string

    Returns Permission<{
        sgid: string;
    }>

  • displays a snapshot of the selected virtual server containing all settings, groups and known client identities. The data from a server snapshot can be used to restore a virtual servers configuration, channels and permissions using the serversnapshotdeploy command. only supports version 2 (from server 3.10.0)

    Parameters

    • Optional password: string

      the optional password to encrypt the snapshot

    Returns Promise<SnapshotCreate>

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

    Parameters

    • client: TeamSpeakClient.ClientType

      the client Database ID which should be changed

    • ident: string

      the key which should be deleted

    Returns Promise<[]>

  • returns a list of custom properties for the client specified with cldbid.

    Parameters

    Returns Promise<CustomInfo>

  • 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>

  • 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

    • client: TeamSpeakClient.ClientType

      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<[]>

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

    Parameters

    • group: TeamSpeakChannelGroup.GroupType

      the channelgroup id

    • force: boolean = false

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

    Returns Promise<[]>

  • displays a snapshot of the selected virtual server containing all settings, groups and known client identities. The data from a server snapshot can be used to restore a virtual servers configuration, channels and permissions using the serversnapshotdeploy command. only supports version 2 (from server 3.10.0)

    Parameters

    • data: string
    • Optional salt: string

      if a password has been set provide the salt from the response

    • Optional password: string

      the password which has been set while saving

    • keepfiles: boolean = true

      wether it should keep the file mapping

    • Optional version: string

      of the snapshot with 0 the version of the current teamspeak server is being used

    Returns Promise<[]>

  • 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

    • channel: ChannelType = "0"

      channel id to download from (0 = server)

    • cpw: string = ""

      channel password of the channel which will be uploaded to

    Returns Promise<Buffer>

  • returns an icon with the given id

    Parameters

    • id: number

      the id of the icon to retrieve eg 262672952

    Returns Promise<Buffer>

  • Gets called when a channel gets edited

    Parameters

    • event: ResponseEntry

      the raw teamspeak event

    Returns void

  • Gets called when a channel gets deleted

    Parameters

    • event: ResponseEntry

      the raw teamspeak event

    Returns Promise<void>

  • Gets called when a channel gets edited

    Parameters

    • event: ResponseEntry

      the raw teamspeak event

    Returns void

  • Gets called when a channel gets moved

    Parameters

    • event: ResponseEntry

      the raw teamspeak event

    Returns void

  • Gets called when a client connects to the TeamSpeak Server

    Parameters

    • event: ResponseEntry

      the raw teamspeak event

    Returns void

  • Gets called when a client discconnects from the TeamSpeak Server

    Parameters

    • event: ResponseEntry

      the raw teamspeak event

    Returns void

  • Gets called when a client moves to a different channel

    Parameters

    • event: ResponseEntry

      the raw teamspeak event

    Returns void

  • Gets called when the server has been edited

    Parameters

    • event: ResponseEntry

      the raw teamspeak event

    Returns Promise<void>

  • Gets called when a chat message gets received

    Parameters

    • event: ResponseEntry

      the raw teamspeak event

    Returns void

  • Gets called when a client uses a privilege key

    Parameters

    • event: ResponseEntry

      the raw teamspeak event

    Returns void

  • Sends a raw command to the TeamSpeak Server.

    Type Parameters

    • T extends ResponseEntry | Response = []

    Parameters

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

      the command which should get executed on the teamspeak server

    Returns Promise<T>

    Example

    ts3.execute("clientlist", ["-ip"])
    ts3.execute("use", [9987], { clientnickname: "test" })
  • forcefully closes the socket connection

    Returns void

  • Creates new directory in a channels file repository

    Parameters

    • channel: ChannelType

      the channel id to check for

    • dirname: string

      path to the directory

    • cpw: string = ""

      the channel password

    Returns Promise<[]>

  • Deletes one or more files stored in a channels file repository

    Parameters

    • channel: ChannelType

      the channel id to check for

    • name: string

      path to the file to delete

    • cpw: string = ""

      the channel password

    Returns Promise<[]>

  • Displays detailed information about one or more specified files stored in a channels file repository.

    Parameters

    • channel: ChannelType

      the channel id to check for

    • name: string

      the filepath to receive

    • cpw: string = ""

      the channel password

    Returns Promise<FTGetFileInfo>

  • Displays a list of files and directories stored in the specified channels file repository.

    Parameters

    • channel: ChannelType

      the channel id to check for

    • path: string = "/"

      the path to list

    • cpw: string = ""

      the channel password

    Returns Promise<FTGetFileEntry[]>

  • 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

    • transfer: TransferDownload

    Returns Promise<FTInitDownload>

  • 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

    • transfer: TransferUpload

    Returns Promise<FTInitUpload>

  • Lists currently active file transfers

    Returns Promise<FileTransferEntry[]>

  • 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

    • channel: ChannelType

      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: string

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

    • cpw: string = ""

      the channel password from where the file gets renamed

    • tcpw: string = ""

      the channel password from where the file will get transferred to

    Returns Promise<[]>

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

    Parameters

    • serverftfid: number

      server file transfer id

    • del: number = 1

    Returns Promise<[]>

  • Retrieves a Single Channel by the given Channel Name

    Parameters

    • channelName: string

      the name of the channel

    Returns Promise<undefined | TeamSpeakChannel>

  • Retrieves a Single Client by the given Client Unique Identifier

    Parameters

    • clientNickname: string

      the nickname of the client

    Returns Promise<undefined | TeamSpeakClient>

  • gets the icon id of a resolveable Perm List

    Parameters

    • permlist: Promise<Permission<any>[]>

      expects a promise which resolves to a permission list

    Returns Promise<number>

  • retrieves an instance of the Permission

    Type Parameters

    • T extends {} = {}

    Parameters

    • init: Omit<IConfig<T>, "teamspeak">

    Returns Permission<T>

  • 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<[]>

  • parses the whole cache by given objects

    Type Parameters

    • T extends Response

    Parameters

    • cache: Record<string, NodeType>

      the cache object

    • list: T

      the list to check against the cache

    • key: string | number

      the key used to identify the object inside the cache

    • node: NodeConstructable<NodeType>

      the class which should be used

    Returns T

  • subscribes to some query events if necessary

    Parameters

    • event: string

    Returns void

  • handles initial commands after successfully connecting to a TeamSpeak Server

    Returns Promise<boolean>

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

    Returns Promise<HostInfo>

  • wether the query client should get handled or not

    Parameters

    Returns boolean

  • Changes the server instance configuration using given properties.

    Parameters

    • properties: InstanceEdit

      the props you want to change

    Returns Promise<[]>

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

    Returns Promise<InstanceInfo>

  • checks if the server is subscribed to a specific event

    Parameters

    • event: string

      event name which was subscribed to

    • Optional id: string

      context to check

    Returns boolean

  • 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<[]>

  • 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

    • lines: number = 1000

      amount of lines to receive

    • reverse: number = 0

      invert output (like Array.reverse)

    • instance: number = 0

      instance or virtualserver log

    • beginPos: number = 0

      begin at position

    Returns Promise<LogView[]>

  • 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<[]>

  • Deselects the active virtual server and logs out from the server instance.

    Returns Promise<[]>

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

    Parameters

    • client: TeamSpeakClient.ClientType

      client unique identifier

    • subject: string

      subject of the message

    • message: string

      message text

    Returns Promise<[]>

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

    Parameters

    • msgid: string

      the message id which should be deleted

    Returns Promise<[]>

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

    Parameters

    • msgid: string

      the message id

    Returns Promise<MessageGet>

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

    Returns Promise<MessageEntry[]>

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

    Parameters

    • msgid: string

      the message id

    • flag: boolean = true

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

    Returns Promise<[]>

  • 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: string | number

      perm id or name to retrieve

    Returns Promise<PermFind[]>

  • 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: string | number

      perm id or name which should be checked

    Returns Promise<PermGet>

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

    Parameters

    • permsid: string

      single permission name

    Returns Promise<PermIdGetByName>

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

    Parameters

    • permsid: string[]

      multiple permission names

    Returns Promise<PermIdGetByName[]>

  • 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

    Returns Promise<PermOverviewEntry[]>

  • 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>

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

    Returns Promise<PermissionEntry[]>

  • 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: ChannelGroup

      token type

    • group: TeamSpeakChannelGroup.GroupType

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

    • channel: ChannelType

      depends on the type given, add a valid channel id

    • Optional description: string

      token description

    • Optional customset: string

      token custom set

    Returns any

  • Parameters

    Returns any

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

    Parameters

    • token: string

      the token which should be deleted

    Returns Promise<[]>

  • Retrieves a list of privilege keys available including their type and group IDs.

    Returns Promise<PrivilegeKeyEntry[]>

  • 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<[]>

  • 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

    • clientLoginName: string

      the login name

    • Optional client: TeamSpeakClient.ClientType

      optional database id or teamspeak client

    Returns Promise<QueryLoginAdd>

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

    Parameters

    Returns Promise<[]>

  • 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: string

      the pattern to filter for client login names

    • Optional start: number

      the offset from where clients should be listed

    • Optional duration: number

      how many clients should be listed

    Returns Promise<QueryLoginEntry[]>

  • closes the ServerQuery connection to the TeamSpeak server instance.

    Returns Promise<[]>

  • attempts a reconnect to the teamspeak server with full context features

    Parameters

    • attempts: number = 1

      the amount of times it should try to reconnect (-1 = try forever)

    • timeout: number = 2000

      time in ms to wait inbetween reconnect

    Returns Promise<TeamSpeak>

  • Subscribes to an Event

    Parameters

    • event: string

      the event on which should be subscribed

    • Optional id: string

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

    Returns Promise<[]>

  • sends a message to a teamspeak channel, if the client is not in this channel he will move into the channel, send the message and move back after

    Parameters

    • target: ChannelType

      the target channel to send the message

    • msg: string

      the message which should be sent

    Returns Promise<void>

  • 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: "0"

      target client id or channel id which should receive the message

    • targetmode: SERVER

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

    • msg: string

      the message the client should receive

    Returns any

  • Parameters

    Returns any

  • Parameters

    Returns any

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

    Parameters

    • properties: ServerEdit

      the server properties

    Returns Promise<ServerCreate>

  • deletes the teamspeak server

    Parameters

    Returns Promise<[]>

  • 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

    • properties: ServerEdit

    Returns Promise<[]>

  • 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

    Returns Promise<[]>

  • Adds a specified permissions to the server group. A permission can be specified by permid or permsid.

    Parameters

    Returns Permission<any>

  • Parameters

    Returns Promise<[]>

  • returns the IDs of all clients currently residing in the server group.

    Parameters

    Returns Promise<ServerGroupClientEntry[]>

  • 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

    Returns Promise<ServerGroupCopy>

  • 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

    • type: number = 1

      type of the servergroup

    Returns Promise<TeamSpeakServerGroup>

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

    Parameters

    • group: TeamSpeakServerGroup.GroupType

      the servergroup id

    • force: boolean = false

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

    Returns Promise<[]>

  • Removes one or more clients from the server group specified with sgid.

    Parameters

    Returns Promise<[]>

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

    Parameters

    Returns Promise<[]>

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

    Parameters

    • filter: Partial<ServerGroupEntry> = {}

    Returns Promise<TeamSpeakServerGroup[]>

  • Displays a list of permissions assigned to the server group specified with sgid.

    Parameters

    • group: TeamSpeakServerGroup.GroupType
    • permsid: boolean = false

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

    Returns Promise<Permission<{
        sgid: string;
    }>[]>

  • Create a new privilegekey token for a ServerGroup with the given description

    Parameters

    • group: TeamSpeakServerGroup.GroupType

      servergroup which should be generated the token for

    • Optional description: string

      token description

    • Optional customset: string

    Returns Promise<Token>

  • Changes the name of the server group

    Parameters

    Returns Promise<[]>

  • displays all server groups the client specified with cldbid is currently residing in

    Parameters

    Returns Promise<ServerGroupsByClientId[]>

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

    Parameters

    • virtualserverPort: number

      the server port where data should be retrieved

    Returns Promise<ServerIdGetByPort>

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

    Returns Promise<ServerInfo>

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

    Parameters

    • filter: Partial<ServerEntry> = {}

    Returns Promise<TeamSpeakServer[]>

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

    Parameters

    • Optional reasonmsg: 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<[]>

  • 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

    Returns Promise<[]>

  • 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

    • server: ServerType

      the server id to stop

    • Optional reasonmsg: 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<[]>

  • 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

    • props: ServerTempPasswordAdd

    Returns Promise<[]>

  • Deletes the temporary server password specified with pw.

    Parameters

    • pw: string

      the password to delete

    Returns Promise<[]>

  • 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<ServerTempPasswordEntry[]>

  • Sets the channel group of a client

    Parameters

    Returns Promise<[]>

  • Subscribes to an Event.

    Returns Promise<[]>

  • updates the context with new data

    Parameters

    • data: Partial<Context>

      the data to update the context with

    Returns TeamSpeak

  • updates the context when the inner callback gets called and throws the first parameter which is an error

    Type Parameters

    • T extends Error

    Parameters

    • context: Partial<Context>

      context data to update

    Returns ((err) => never)

      • (err): never
      • Parameters

        • err: T

        Returns never

  • updates the context when the inner callback gets called and returns the first parameter

    Type Parameters

    • T

    Parameters

    • context: Partial<Context>

      context data to update

    Returns ((res) => T)

      • (res): T
      • Parameters

        • res: T

        Returns T

  • 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

    • channel: ChannelType = "0"

      channel id to upload to (0 = server)

    • cpw: string = ""

      channel password of the channel which will be uploaded to

    Returns Promise<void>

  • uploads an icon to the teamspeak server and returns its id

    Parameters

    • data: Buffer

      icon buffer to upload

    Returns Promise<number>

  • Selects the virtual server specified with the port to allow further interaction.

    Parameters

    • port: number

      the port the server runs on

    • Optional clientNickname: string

      set nickname when selecting a server

    Returns Promise<[]>

  • Selects the virtual server specified with the sid to allow further interaction.

    Parameters

    • server: ServerType

      the server id

    • Optional clientNickname: string

      set nickname when selecting a server

    Returns Promise<[]>

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

    Parameters

    • refresh: boolean = false

      if this parameter has been set it will send a command to the server otherwise will use the cached info

    Returns Promise<undefined | Version>

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

    Returns Promise<Whoami>

  • filters an array with given filter

    Type Parameters

    • T extends ResponseEntry

    Parameters

    • array: T[]

      the array which should get filtered

    • filter: Partial<T>

      filter object

    Returns T[]

  • retrieves the first element of an array

    Type Parameters

    • T

    Parameters

    • input: T | T[]

      the response input

    Returns 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[]

  • waits a set time of ms

    Parameters

    • time: number

      time in ms to wait

    Returns Promise<unknown>

Generated using TypeDoc