Files
website/docs/api/namespaces/Presence.md
2024-01-08 18:32:17 +00:00

2.2 KiB

id, title, sidebar_label, sidebar_position, custom_edit_url
id title sidebar_label sidebar_position custom_edit_url
Presence Namespace: Presence Presence 0 null

Interfaces

Type Aliases

Config

Ƭ Config<T>: Object

Type parameters

Name Type
T extends keyof Dependencies[]

Type declaration

Name Type
execute (...v: IntoDependencies<T>) => Result
inject? [...T]

Defined in

src/core/presences.ts:17

Functions

module

module<T>(conf): Config<T>

A small wrapper to provide type inference. Create a Presence module which MUST be put in a file called presence.(language-extension) adjacent to the file where Sern.init is CALLED.

Type parameters

Name Type
T extends keyof Dependencies[]

Parameters

Name Type
conf Config<T>

Returns

Config<T>

Defined in

src/core/presences.ts:28


of

of(root): Object

Create a Presence body which can be either:

  • once, the presence is activated only once.
  • repeated, per cycle or event, the presence can be changed.

Parameters

Name Type
root Omit<Result, "repeat" | "onRepeat">

Returns

Object

Name Type
once () => Omit<Result, "repeat" | "onRepeat">
repeated (onRepeat: PresenceReduce, repeat: number | [Emitter, string]) => { activities?: ActivitiesOptions[] ; afk?: boolean ; onRepeat: PresenceReduce ; repeat: number | [Emitter, string] ; shardId?: number[] ; status?: Status }

Defined in

src/core/presences.ts:39