Skip to main content

Interface: XPChangeEvent

Event emitted when a user's XP changes (without level change)

All fields are read-only event data

Remarks​

The storeId field identifies which data store triggered this event. Leaderboard cache invalidation uses this field to invalidate only the affected store.

Example​

{
* guildId: '123456789012345678',
* userId: '234567890123456789',
* storeId: 'default',
* oldXp: 1500,
* newXp: 1550,
* delta: 50,
* reason: 'message'
* }

Properties​

delta​

readonly delta: number;

Change in XP (newXp - oldXp, can be negative)


guildId​

readonly guildId: string;

Guild where XP change occurred


newXp​

readonly newXp: number;

New XP amount


oldXp​

readonly oldXp: number;

Previous XP amount


reason?​

readonly optional reason: string;

Optional reason for XP change (e.g., 'manual_adjustment', 'message')


storeId​

readonly storeId: string;

Store identifier that triggered this event


userId​

readonly userId: string;

User whose XP changed