presence() declares the presence of the bot, once, from any file of src/. It takes one object, PresenceConfig.
src/presence.ts
How to write the file, and what Discord shows for each type, is in the
guide. This page lists what exists.
presence()
src/, once; the bot has it as soon as it is connected.
PresenceDeclaration
Whatpresence() returns: a declaration the framework finds in the exports of a file.
PresenceConfig
presence(): activity for one, or activities for several shown in turn.
SinglePresenceConfig
A presence with one activity, or none.RotatingPresenceConfig
A presence whose activities are shown in turn.Several activities, shown one after the other, each for its
for: a list,
or a function that gives it.PresenceStatusName
'online' (green), 'idle' (orange), 'dnd' (red, “do not disturb”) or 'invisible' (shown as offline).
Activities
Activity
What the bot is doing: aPlainActivity or a StreamingActivity.
PlainActivity
An activity that is not a stream.What the bot is doing, as Discord shows it: “Playing name”, “Listening to
name”, “Watching name”, “Competing in name”, or the text itself with
'custom'.How long the activity is shown before the next one, at least 5 seconds:
'30s', '2m'. 30 seconds by default. Alone, it is how often a name that
is a function runs again.ActivityKind
StreamingActivity
A stream: “Streaming name”, with a link to it.How long the activity is shown before the next one, at least 5 seconds:
'30s', '2m'. 30 seconds by default. Alone, it is how often a name that
is a function runs again.ActivityText
PresenceContext
What a presence function receives, each time it runs: how many servers the bot is in, and the texts of the language files in the default language.The texts of the language files, in the default language. Only when the
project has language files.