teamspeak.js - v1.11.0
    Preparing search index...

    Class Query

    Represents a ServerQuery connection.

    Hierarchy

    Index

    Constructors

    • Parameters

      • options: ClientOptions

      Returns Query

    Properties

    actions: ActionManager = ...

    The Action Manager of the Query instance.

    bans: BanManager = ...

    The Ban Manager of the Query instance.

    channelGroups: ChannelGroupManager = ...

    The Channel Group Manager of the Query instance.

    channels: ChannelManager = ...

    The Channel Manager of the Query instance.

    client: QueryClient = ...

    The Query Client of the Query instance. Will be null until the client is logged in.

    clients: ClientManager = ...

    The Client Manager of the Query instance.

    commands: CommandManager = ...

    The Command Manager of the Query instance.

    instance: Instance = ...

    The Instance of the Query instance. Needs to be fetched first using fetchInstance().

    notifications: NotificationManager = ...

    The Notification Manager of the Query instance.

    permissions: PermissionManager = ...

    The Permission Manager of the Query instance.

    privilegeKeys: PrivilegeKeyManager = ...

    The Privilege Key Manager of the Query instance.

    serverGroups: ServerGroupManager = ...

    The Server Group Manager of the Query instance.

    transport: Transport
    virtualServers: VirtualServerManager = ...

    The Virtual Server Manager of the Query instance.

    Methods

    • Connect to the Host and wait until the ServerQuery welcome message is received. Resolves when the underlying transport emits 'ready'.

      Parameters

      • timeoutMs: number = 15000

      Returns Promise<void>

    • Create a new API key.

      scope: Scope of the API key (required).

      lifetime: Lifetime in days (optional, default: 14). Use 0 for no expiration.

      cldbid: Client Database ID of the client the key should be assigned to (optional). Otherwise, the invoker will be used.

      Parameters

      • __namedParameters: { cldbid?: number; lifetime?: number; scope: ApiKeyScope }

      Returns Promise<RawApiKey>

    • Create a new complain.

      Parameters

      • tcldbid: number

        The client database ID of the complained about client.

      • message: string

        The message of the complain.

      Returns Promise<void>

    • Create a new privilege key.

      tokentype: 0 = group, 1 = channel

      tokenid1: Group ID

      tokenid2: Channel ID (if tokentype is 1). Must be set to 0 if tokentype is 0.

      tokendescription: Description of the privilege key (optional)

      customset: Custom set of the privilege key (optional)

      Parameters

      • params: {
            customset?: string;
            tokendescription?: string;
            tokenid1: number;
            tokenid2: number;
            tokentype: number;
        }

        The parameters for the privilege key.

      Returns Promise<string>

      The created privilege key.

      Please use Query.privilegeKeys.create() instead.

    • Create a new query login for the current virtual server. If no virtual server is selected, the login will be created globally.

      Parameters

      • loginName: string

        The name of the query login.

      • clientDatabaseId: number

        The ID of the client to login as.

      Returns Promise<RawQueryLoginAdd>

    • Create a new server temporary password.

      Parameters

      • params: { desc: string; duration: number; pw: string; tcid?: string; tcpw?: string }

        The parameters for the server temporary password.

        pw: The password to create.

        desc: The description of the server temporary password.

        duration: The duration of the server temporary password IN SECONDS.

        tcid: The channel ID to create the server temporary password for. (optional, defaults to the default channel)

        tcpw: The channel password to create the server temporary password for. (optional)

      Returns Promise<void>

    • Delete an API key by its ID.

      Parameters

      • id: number

        The ID of the API key to delete.

      Returns Promise<void>

    • Delete a complain by its IDs.

      Parameters

      • tcldbid: number

        The client database ID of the complained about client.

      • fcldbid: number

        The client database ID of the complainee.

      Returns Promise<void>

    • Delete all complains by the complainee's ID.

      Parameters

      • tcldbid: number

        The client database ID of the complained about client.

      Returns Promise<void>

    • Delete a privilege key by its token.

      Parameters

      • token: string

        The token of the privilege key to delete.

      Returns Promise<void>

      Please use Query.privilegeKeys.delete() or Query.privilegeKeys.deleteByToken() instead.

    • Delete a query login by its client database ID.

      Parameters

      • clientDatabaseId: number

        The ID of the client to delete the login for.

      Returns Promise<void>

    • Delete a server temporary password by its password.

      Parameters

      • pw: string

        The password of the server temporary password to delete.

      Returns Promise<void>

    • Deploy a server snapshot.

      Parameters

      • version: number

        The version of the server snapshot.

      • data: string

        The data of the server snapshot.

      • __namedParameters: { _keepfiles?: true; _mapping?: true; password?: string; salt?: string } = {}

      Returns Promise<unknown>

    • Close the connection and destroy the Query instance.

      Returns void

    • Returns Promise<Instance>

    • Returns Promise<
          {
              level: string;
              message: string;
              module: string;
              timestamp: Date;
              virtualServerId: number;
          }[],
      >

    • Get a list of API keys.

      cldbid: Client Database ID or "*" to get all keys.

      start: Starting index (optional, default: 0).

      duration: Maximum number of keys to return (optional, default: 100).

      count: Include total count (optional, default: false).

      Parameters

      • __namedParameters: { cldbid: number | "*"; count?: true; duration?: number; start?: number }

      Returns Promise<RawApiKey | RawApiKey[]>

    • Get a list of bindings.

      Parameters

      • Optionalsubsystem: "query" | "voice" | "filetransfer"

        The subsystem of the binding.

      Returns Promise<RawBinding | RawBinding[]>

    • Get the raw client database ID from its unique identifier.

      Parameters

      • uniqueId: string

        The unique identifier of the client.

      Returns Promise<RawClientDbid>

    • Get a list of client database properties.

      Parameters

      • clientDatabaseId: number

        The ID of the client.

      Returns Promise<RawClientDbInfo>

    • Get the raw client name from its database ID.

      Parameters

      • dbid: number

        The database ID of the client.

      Returns Promise<RawClientName>

    • Get the raw client name from its unique identifier.

      Parameters

      • uniqueId: string

        The unique identifier of the client.

      Returns Promise<RawClientName>

    • Get a list of complains.

      Parameters

      • Optionaltcldbid: number

        The client database ID of the complained about client. (optional, otherwise all complains will be returned)

      Returns Promise<RawComplain | RawComplain[]>

    • Get a list of database clients.

      Parameters

      • options: { _count?: true; duration?: number; start?: number } = {}

      Returns Promise<RawDbClient | RawDbClient[]>

    • Get the raw ServerQuery host information.

      Returns Promise<RawHostInfo>

      Please use Query.fetchHostInfo() instead.

    • Get a list of permissions on the TeamSpeak 3 Server instance.

      Returns Promise<RawPermission[]>

      Please use Query.permissions.fetch() instead.

    • Get a list of query logins of the current virtual server. If no virtual server is selected, global logins will be returned as well.

      Parameters

      • params: { _count?: true; duration?: number; pattern?: string; start?: number } = {}

      Returns Promise<RawQueryLogin | RawQueryLogin[]>

    • Get the raw Server ID by its port.

      Parameters

      • port: number

        The virtual server port.

      Returns Promise<{ server_id: string }>

      Please use Query.virtualServers.fetchServerIdByPort(port) instead.

    • Get the raw ServerQuery version information.

      Returns Promise<RawVersion>

      Please use Query.fetchServerVersion() instead.

    • Login to the ServerQuery.

      Parameters

      • username: string

        The username to login with.

      • password: string

        The password to login with.

      Returns Promise<void>

    • Logout from the ServerQuery.

      Returns Promise<void>

    • Sends a message to the current channel.

      Parameters

      • content: string

        The message content.

      Returns Promise<void>

    • Sends a server message to virtual servers in the TeamSpeak 3 Server instance.

      Parameters

      • content: string

        The message to send.

      Returns Promise<void>

    • Sends a server message to the current virtual server.

      Parameters

      • content: string

        The message to send.

      Returns Promise<void>

    • Stop the whole TeamSpeak 3 Server instance.

      Parameters

      • Optionalreason: string

        The reason for stopping the server process. (optional)

      Returns Promise<void>

    • Update the login credentials for the current ServerQuery. You can only pass the username, the password will be generated automatically.

      Parameters

      • username: string

        The username to set.

      Returns Promise<string>

      The generated password.

    • Use a privilege key by its token.

      Parameters

      • token: string

        The token of the privilege key to use.

      Returns Promise<void>

      Please use Query.privilegeKeys.use() or Query.privilegeKeys.useByToken() instead.

    • Select a virtual server by its ID.

      Parameters

      • id: number

        The virtual server ID.

      Returns Promise<void>

      Use Query.virtualServers.use(...) instead.

    • Select a virtual server by its port.

      Parameters

      • port: number

        The virtual server port.

      Returns Promise<void>

      Use Query.virtualServers.use(...) instead.