Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SingleWorker

Hierarchy

  • Worker<{ DEBUG: string }>
    • SingleWorker

Index

Constructors

constructor

Properties

api

api: RestManager

cacheManager

cacheManager: CacheManager

channels

channels: Collection<string, APIChannel> = ...

Cached channels

comms

comms: SingleThread = ...

Thread communications

guildRoles

guildRoles: Collection<string, Collection<string, APIRole>> = ...

Cached roles

guilds

guilds: Collection<string, CachedGuild> = ...

Cached guilds

members

members: Collection<string, Collection<string, GatewayGuildMemberAddDispatchData>> = ...

Cached members

options

options: CompleteBotOptions = ...

Bot options

selfMember

selfMember: Collection<string, GatewayGuildMemberAddDispatchData> = ...

Cached self members

sharder

sharder: SingleSharder = ...

shards

shards: Collection<number, Shard> = ...

All shards on this cluster

Optional status

status?: GatewayPresenceUpdateData

The status that the worker will retain when a shard restarts, to change use Worker.setStatus() for no unintended side affects

user

user: APIUser = ...

Self user

users

users: Collection<string, APIUser> = ...

Cached users

voiceStates

voiceStates: Collection<string, CachedVoiceState> = ...

Cached voice states

Accessors

ready

  • get ready(): boolean
  • Whether or not all shards are online and ready

    Returns boolean

Methods

_beginSingleton

  • _beginSingleton(): Promise<void>
  • Returns Promise<void>

_waitForShard

  • _waitForShard(shard: Shard): Promise<{ err: boolean }>
  • Parameters

    Returns Promise<{ err: boolean }>

debug

  • debug(msg: any): void
  • Parameters

    • msg: any

    Returns void

getMembers

  • getMembers(guildId: string): Promise<Collection<any, APIGuildMember>>
  • Gets ALL members in a guild (via ws)

    Parameters

    • guildId: string

      ID of guild

    Returns Promise<Collection<any, APIGuildMember>>

guildShard

  • guildShard(guildId: string): Shard
  • Gets shard in charge of specific guild

    Parameters

    • guildId: string

      ID of guild

    Returns Shard

log

  • log(...data: any[]): void
  • Log something to master

    Parameters

    • Rest ...data: any[]

      What to log

    Returns void

setStatus

  • setStatus(type: "playing" | "streaming" | "listening" | "watching" | "competing", name: string, status?: "idle" | "online" | "dnd" | "offline" | "invisible", url?: string): void
  • Sets the status of the client

    example

    worker.setStatus('playing', 'Rocket League', 'online') // Playing Rocket League // Twitch streams worker.setStatus('streaming', 'Rocket League', 'online', 'https://twitch.com/jpbberry')

    Parameters

    • type: "playing" | "streaming" | "listening" | "watching" | "competing"

      Type of status, e.g "playing" is "Playing Game!"

    • name: string

      Name of status, in this case Game

    • status: "idle" | "online" | "dnd" | "offline" | "invisible" = 'online'

      Status type

    • Optional url: string

      Optional url for twitch stream

    Returns void

start

  • start(): Promise<void>
  • Returns Promise<void>

Generated using TypeDoc