Skip to content

Update bot status

The framework provides a StatusManager that automatically cycles through your bot’s presence statuses. You configure it via your zumito.config.ts file, which is loaded by the framework’s launcher.

  1. Create a status options file

    Create src/config/StatusOptions.ts:

    import { ActivityType } from "zumito-framework/discord";
    import type { StatusManagerOptions } from "zumito-framework";
    export const statusOptions: StatusManagerOptions = {
    statuses: [{
    status: 'online',
    activities: [{
    name: 'z-help',
    type: ActivityType.Playing
    }]
    }],
    RuledStatuses: [],
    updateInterval: 15000,
    order: "sequential"
    };
  2. Pass to zumito.config.ts

    zumito.config.ts
    import type { LauncherConfig } from 'zumito-framework';
    import { statusOptions } from './src/config/StatusOptions.js';
    export const config: LauncherConfig = {
    statusOptions: statusOptions,
    // ... bundles, discordClientOptions, etc.
    };
FieldTypeRequiredDescription
statusesPresenceData[]YesList of statuses the bot cycles through.
RuledStatusesRuledPresenceData[]NoTime-conditional statuses (e.g., holiday-specific).
updateIntervalnumberNoHow often the bot changes status (ms). If omitted, cycles once on ready but does not repeat.
order"sequential" | "random"NoCycle order. Defaults to sequential.
FieldTypeDescription
status'online' | 'dnd' | 'idle' | 'invisible'Discord presence status.
activitiesActivitiesOptions[]Array of activities to display.

An activity has:

FieldTypeDescription
namestringText displayed (e.g., Playing z-help).
typeActivityTypeActivityType.Playing, ActivityType.Watching, ActivityType.Listening, ActivityType.Streaming, ActivityType.Competing.

Statuses with date rules — only active within a time range:

RuledStatuses: [{
status: 'online',
activities: [{
name: 'Halloween event!',
type: ActivityType.Playing
}],
rules: [{
startTime: new Date('2026-10-25'),
endTime: new Date('2026-11-01')
}]
}]
Rule fieldTypeDescription
startTimeDateStatus becomes active after this date.
endTimeDateStatus becomes inactive after this date.
statuses: [
{
status: 'online',
activities: [{ name: 'with fire', type: ActivityType.Playing }]
},
{
status: 'dnd',
activities: [{ name: 'the docs', type: ActivityType.Watching }]
},
{
status: 'idle',
activities: [{ name: 'lofi beats', type: ActivityType.Listening }]
}
],
updateInterval: 20000,
order: "sequential"

The bot cycles through each status every 20 seconds, in order.

order: "random",
updateInterval: 30000

The bot picks a random status from the list every 30 seconds.

statuses: [{
status: 'online',
activities: [{
name: 'Coding with Zumito',
type: ActivityType.Streaming,
url: 'https://twitch.tv/yourchannel'
}]
}]

You can also update the status programmatically from your modules:

import { ServiceContainer } from 'zumito-framework';
import { ZumitoFramework } from 'zumito-framework';
const framework = ServiceContainer.get(ZumitoFramework);
framework.statusManager?.setStatus({
status: 'dnd',
activities: [{ name: 'maintenance...', type: ActivityType.Playing }]
});

The statusChanged event fires every time the presence changes:

framework.eventEmitter.on('statusChanged', (presenceData) => {
console.log('Bot status changed to:', presenceData);
});
  1. The launcher (node_modules/zumito-framework/dist/launcher.js) loads your zumito.config.ts.
  2. It merges your config with framework defaults and passes it to ZumitoFramework.
  3. During initialization, if statusOptions is defined, a StatusManager is created.
  4. On the Discord ready event, the first status is set immediately.
  5. If updateInterval is set, the status cycles on a timer.
  6. RuledStatuses are filtered by their date rules — only active ones are included in the cycle.