Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DiscordQuery

DiscordQuery class converting .dq source code into engine commands

Hierarchy

  • DiscordQuery

Index

Constructors

constructor

Properties

Private _callstack

_callstack: Array<EngineCall>

Engine commands to execute in order

Private callbackHandler

callbackHandler: (command: keyof EngineCommand, value: any) => void

Callback handler for all commands

Type declaration

Private engine

engine: Engine

Engine instance

Private listenHandler

listenHandler: (event: Event) => void

Listener for discord events

Type declaration

    • Parameters

      Returns void

raw

raw: boolean

Variable that decided if outputted is passed to a handler or console

Accessors

callback

  • set callback(callback: (command: keyof EngineCommand, values: any) => void): void

callstack

listener

  • set listener(handler: (event: Event) => void): void

Methods

execute

  • execute(killOnEnd: boolean, discordToken?: undefined | string, guildID?: undefined | string, channelID?: undefined | string): Promise<void>
  • Main runner function that initilizes the discord engine and runs all commands parsed from the source.

    Parameters

    • killOnEnd: boolean

      Expresses whether the engine client should be stopped when all commands have finished executed, or if it should wait until the entire program exits.

    • Optional discordToken: undefined | string

      Discord bot token if passed it uses this to login to the discord bot

    • Optional guildID: undefined | string

      Discord guild id, if the discord id has been passed it will select this guild.

    • Optional channelID: undefined | string

      Discord channel id, if the guild id has been passed it will select this channel.

    Returns Promise<void>

Private generate

parse

  • parse(src: string): void

reload

  • reload(): Promise<boolean>

Generated using TypeDoc