Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BotShard

Creates and handles the communication of a shard

Hierarchy

  • BotShard

Index

Constructors

constructor

Properties

Readonly id

state

Methods

communicate

  • communicate(event: string): Promise<Serializable>
  • Sends a message to the child process in order to emit a registered given event

    Parameters

    • event: string

      The event to be emitted in the child process

    Returns Promise<Serializable>

disconnect

emitEvent

  • emitEvent<E>(event: E, args: Arguments<Events[E]>): void
  • Sends the child process a message to emit the given event to EventsHandler

    Type parameters

    Parameters

    • event: E

      The event to be emitted

    • args: Arguments<Events[E]>

      The arguments of the events

    Returns void

onMessage

spawn

  • spawn(): void
  • Spawns a new child according to the given file path. Sets the environmental variables for the process with the sharding information

    Returns void

Generated using TypeDoc