Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Commander

Hierarchy

  • Commander

Index

Constructors

constructor

Properties

Private commands

commands: BaseCommand[] = []

config

Private instances

instances: TeamSpeak[] = []

Static DEFAULT_PREFIX

DEFAULT_PREFIX: string = "!"

Methods

addInstance

  • addInstance(teamspeak: TeamSpeak, registerEvents?: boolean): Promise<this>
  • adds a teamspeak instance to the command handler

    Parameters

    • teamspeak: TeamSpeak

      the instance to add

    • Default value registerEvents: boolean = true

      depending on this setting the registerEvent command will be sent to the teamspeak server

    Returns Promise<this>

checkPermissions

createCommand

  • createCommand(name: string): Command

createCommandGroup

getAvailableCommands

  • getAvailableCommands(name?: undefined | string): BaseCommand[]

getAvailableCommandsWithPermission

  • getAvailableCommandsWithPermission(client: TeamSpeakClient, filter?: undefined | string): Promise<BaseCommand[]>
  • gets a list of availale commands with permission checks

    Parameters

    • client: TeamSpeakClient

      the client to check permissions for

    • Optional filter: undefined | string

      the name to prefilter commands

    Returns Promise<BaseCommand[]>

getReplyFunction

  • getReplyFunction(ev: TextMessageEvent): (Anonymous function)

Private getTranslatedString

  • getTranslatedString(__namedParameters: object): string
  • retrieves a string from a CommanderString Type

    Parameters

    • __namedParameters: object
      • client: TeamSpeakClient
      • data: string | function

        the string getter data

      • rest: rest

    Returns string

Private getTranslator

isPossibleCommand

  • isPossibleCommand(text: string): boolean

prefix

  • prefix(): string

Private runCommand

searchAvailableCommands

  • searchAvailableCommands(name: string, client: TeamSpeakClient): BaseCommand[]
  • regex searches available commands

    Parameters

    • name: string

      the name to find

    • client: TeamSpeakClient

      the requesting client

    Returns BaseCommand[]

Private textMessageHandler

translateString

  • translateString(client: TeamSpeakClient): (Anonymous function)
  • gets a string translation with the client object

    Parameters

    • client: TeamSpeakClient

    Returns (Anonymous function)

Static createThrottle

Static isValidCommandName

  • isValidCommandName(name: string): boolean
  • checks if the command name is valid to be created as a command

    Parameters

    • name: string

      the command to create

    Returns boolean

Generated using TypeDoc