Options
All
  • Public
  • Public/Protected
  • All
Menu

Thread interface for interacting with the master process from a worker

Hierarchy

  • ThreadComms
    • Thread

Index

Constructors

constructor

  • new Thread(worker?: Worker, register?: boolean): Thread

Properties

id

id: string

worker

worker: Worker = ...

Methods

_emit

  • _emit<K>(event: K, data: ThreadCommsEventEmitter[K], resolve: ResolveFunction<K>): boolean

broadcastEval

  • broadcastEval(code: string): Promise<any[]>

destroy

  • destroy(): void

getGuild

  • getGuild(guildId: string): Promise<APIGuild>

getStats

log

  • log(...messages: any[]): void

masterEval

  • masterEval(code: string): Promise<any>

register

  • register(comms: Worker | MessagePort): void

registerShard

  • registerShard(id: number): Promise<{}>

restartCluster

  • restartCluster(clusterId: string): void

restartShard

  • restartShard(shardId: any): void

sendCommand

sendWebhook

  • sendWebhook(webhookId: string, token: string, data: MessageTypes): Promise<APIMessage>
  • Sends a webhook using the master process, useful for respecting ratelimits

    Parameters

    • webhookId: string

      ID of webhook

    • token: string

      Token of webhook

    • data: MessageTypes

      Data for message

    Returns Promise<APIMessage>

    Message sent

tell

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Static method

Generated using TypeDoc