// Handle a specific command
chat.onSlashCommand("/status", async (event) => {
await event.channel.post("All systems operational!");
});
// Handle multiple commands
chat.onSlashCommand(["/help", "/info"], async (event) => {
await event.channel.post(`You invoked ${event.command}`);
});
// Catch-all handler
chat.onSlashCommand(async (event) => {
console.log(`Command: ${event.command}, Args: ${event.text}`);
});
type SlashCommandHandler = (event: SlashCommandEvent<TState>) => void | Promise<void>