Options
All
  • Public
  • Public/Protected
  • All
Menu

Class State

class

State Represents the current state of our Spectrum informations watching the websocket to synchronise server-side and client-side information

Hierarchy

  • State

Index

Constructors

constructor

Properties

Private Broadcaster

Broadcaster: Broadcaster

Our RSI WS API instance

Private RSI

RSI: RSI = RSI.getInstance()

Our RSI API instance

Protected _SubscribedLobbies

_SubscribedLobbies: SpectrumLobby[] = []

used internally to represent what lobbies we're listening to

Private _broadcasterReadyEvent

_broadcasterReadyEvent: SignalDispatcher = new SignalDispatcher()

Protected _originalIdentify

_originalIdentify: Identify

used internally to store the original state of things

Protected bookmarks

bookmarks: any

the currently bookmarked channels

Protected communities

communities: SpectrumCommunity[] = []

the communities we have access to

Protected member

member: any

information on the bot member

Protected notifications

notifications: any

notifications of the bot

Protected private_lobbies

private_lobbies: any

the list of private lobbies (i.e private messages)

Protected roles

roles: any

a role list

Private ws

ws: WebSocketConnection

our websocket connection to spectrum

Accessors

onBroadcasterReady

  • get onBroadcasterReady(): ISignal

Methods

Private _hasFailed

  • _hasFailed(a: any): void

Private _isReady

  • _isReady(a: any): void

getAccessibleLobbies

getCommunities

getCommunityByName

getSubscribedLobbies

isSubscribedToLobby

  • isSubscribedToLobby(lobby: SpectrumLobby): boolean
  • isSubscribedToLobby(id: number): boolean

newIdentifyPacket

  • newIdentifyPacket(packet: Identify): void

onMessage

  • onMessage(callback?: (Anonymous function)): number
  • Declare a global message listener for every message the bot will get to see.

    Parameters

    • Default value callback: (Anonymous function) = (message: receivedTextMessage) => { }

      the callback function on message.

    Returns number

Private restoreWS

  • restoreWS(): void

setBotPresence

  • setBotPresence(status: "away" | "online" | "playing" | "do_not_disturb" | "invisible", info?: string): Promise<RSIApiResponse>

setWsConnected

  • setWsConnected(ws: WebSocketConnection): void

subscribeToLobby

whenReady

  • whenReady(): Promise<boolean>
  • Convenience promise to track the first initialization of the API

    Returns Promise<boolean>

    a promise that will be true (and consumed) the next time the broadcaster is up and ready.

Generated using TypeDoc