// Get a value (returns undefined if missing)
const enabled = ctx.storage.get<boolean>('enabled') ?? true;
// Set a value (persisted to disk)
ctx.storage.set('message', 'glhf');
ctx.storage.set('delay', 500);
ctx.storage.set('history', { wins: 10, losses: 3 });
// Check if a key exists
if (ctx.storage.has('message')) {
const msg = ctx.storage.get<string>('message');
}
// Delete a key
ctx.storage.delete('message');
// Get all keys and values (copy)
const all = ctx.storage.getAll();
// Clear everything (use with care)
ctx.storage.clear();