Optional data?: JSONValueOptional data to associate with the timer event This is passed to the onTimerEvent handler
Unique identifier for this specific timer instance
Optional interval?: numberIf present, makes the timer recurring with this interval (in milliseconds) If not present, the timer fires only once
A name to identify the timer type Used for event handling logic
The Reddit post ID where this timer belongs
// One-time event
const event: TimerEvent = {
postId: "t3_abc123",
name: "respawn_player",
id: "unique-uuid",
data: { playerId: "t2_xyz789" }
};
// Recurring event
const interval: TimerEvent = {
postId: "t3_abc123",
name: "spawn_asteroid",
id: "unique-uuid",
interval: 1000, // milliseconds
data: { maxAsteroids: 10 }
};
Represents a scheduled timer event in the game.
Timer events can be one-time events or recurring intervals. They are persisted in Redis and survive server restarts.