A class to manage the client's presence statuses.

Hierarchy

  • PresenceManager

Constructors

Properties

The client that this presence manager will be used by.

Memberof

PresenceManager

The options for this presence manager.

Memberof

PresenceManager

Default Value

{
templates: ['{num_guilds} servers!'],
status: 'online',
type: 'PLAYING',
afk: false
}
refreshIntervalHandle: null | Timeout

The refresh interval handle for this presence manager.

Memberof

PresenceManager

The presence templater used by this presence manager.

Memberof

PresenceManager

Methods

  • Update the client's presence with a presence randomly chosen from the templates specified.

    Returns Promise<void>

    Promise that resolves on presence update.

    Emits

    client#presenceUpdated

    Emits

    client#presenceUpdateError

  • Set the refresh interval at which the presences should update. The presences that are used are the ones specified in the templates option.

    Parameters

    • refreshInterval: null | number = null

      The interval at which the presences should update. Must be a positive integer.

    Returns void

    Throws

    Throws if the interval is not positive.

    Emits

    client#presenceRefreshInterval

  • Update the client's presence.

    Parameters

    • status: string

      The status message to set. It can be a templated message. See PresenceTemplater.

    • data: PresenceData = {}

      Additional data to pass to the presence updater.

    Returns Promise<void>

    A promise that resolves on presence update.

    Emits

    client#presenceUpdated

    Emits

    client#presenceUpdateError

Generated using TypeDoc