'use client'; import { cn } from "@/lib/utils"; interface ICommand { name: string description: string syntax: string permissions: string[] version: string | undefined examples: string[] subcommands: ICommand[] } const COMMAND_PREFIX = '!' const commands: ICommand[] = [ { name: "nightbot", description: "Interacts with Nightbot.", syntax: "", permissions: ["tts.commands.nightbot"], version: "4.2", examples: [], subcommands: [ { name: "play", description: "Play the songs on the queue.", syntax: "", permissions: [], version: undefined, examples: [], subcommands: [], }, { name: "pause", description: "Pause the currently playing song.", syntax: "", permissions: [], version: undefined, examples: [], subcommands: [], }, { name: "skip", description: "Skip the currently playing song.", syntax: "", permissions: [], version: undefined, examples: [], subcommands: [], }, { name: "volume", description: "Skip the currently playing song.", syntax: "", permissions: [], version: undefined, examples: [], subcommands: [], }, { name: "clear_queue", description: "Clears the queue.", syntax: "", permissions: [], version: undefined, examples: [], subcommands: [], }, { name: "clear_playlist", description: "Clears the playlist.", syntax: "", permissions: [], version: undefined, examples: [], subcommands: [], }, ] }, { name: "obs", description: "Interacts with OBS.", syntax: " ", permissions: [], version: "3.6", examples: [], subcommands: [ { name: "rotate", description: "Apply a rotational transformation", syntax: "", permissions: [], version: undefined, examples: [], subcommands: [], }, { name: "x", description: "Move element to a new X position", syntax: "", permissions: [], version: undefined, examples: [], subcommands: [], }, { name: "y", description: "Move element to a new Y position", syntax: "", permissions: [], version: undefined, examples: [], subcommands: [], }, ] }, { name: "refresh", description: "Refreshes certain data being stored on the client.", syntax: "", permissions: [], version: "3.2", examples: [], subcommands: [ { name: "tts_voice_enabled", description: "Refreshes the list of enabled TTS voices used by chat", syntax: "", permissions: [], version: undefined, examples: [], subcommands: [], }, { name: "word_filters", description: "Refreshes the list of words filters", syntax: "", permissions: [], version: undefined, examples: [], subcommands: [], }, { name: "default_voice", description: "Refreshes the default voice", syntax: "", permissions: [], version: undefined, examples: [], subcommands: [], }, { name: "redemptions", description: "Refreshes the redemmptions", syntax: "", permissions: [], version: "3.4", examples: [], subcommands: [], }, { name: "obs_cache", description: "Refreshes the cache for OBS", syntax: "", permissions: [], version: "3.7", examples: [], subcommands: [], }, { name: "permissions", description: "Refreshes the group permissions", syntax: "", permissions: [], version: "3.7", examples: [], subcommands: [], } ] }, { name: "skip", description: "Skips the currently playing message.", syntax: "", permissions: [], version: undefined, examples: [], subcommands: [ { name: "all", description: "Clears everything in queue and skips the currently playing message. This effectively runs !skipall command.", syntax: "", permissions: ["tts.commands.skipall"], version: "3.9", examples: [], subcommands: [] }, ] }, { name: "skipall", description: "Clears everything in queue and skips the currently playing message.", syntax: "", permissions: [], version: undefined, examples: [], subcommands: [] }, { name: "tts", description: "Clears everything in queue and skips the currently playing message.", syntax: "", permissions: [], version: "3.2", examples: [], subcommands: [ { name: "enable", description: "Enables a TTS voice.", syntax: "", permissions: [], version: undefined, examples: [], subcommands: [], }, { name: "disable", description: "Disables a TTS voice", syntax: "", permissions: [], version: undefined, examples: [], subcommands: [], }, { name: "add", description: "Adds a TTS voice to the list of available voices, case sensitive.", syntax: "", permissions: ["tom"], version: "3.9", examples: ["Brian"], subcommands: [] }, { name: "remove", description: "Removes a TTS voice from the list of available voices.", syntax: "", permissions: ["tom"], version: "3.9", examples: [], subcommands: [] }, { name: "join", description: "Voices the messages of another channel", syntax: "", permissions: ["tts.commands.tts.join"], version: "4.0", examples: [], subcommands: [], }, { name: "leave", description: "Stop reading the messages of another channel", syntax: "", permissions: ["tts.commands.tts.leave"], version: "4.0", examples: [], subcommands: [], } ] }, { name: "version", description: "Sends a message to the console with version info.", syntax: "", permissions: [], version: undefined, examples: [], subcommands: [] }, { name: "voice", description: "Change voice when reading messages for yourself.", syntax: "", permissions: [], version: undefined, examples: ["brian"], subcommands: [ { name: "", description: "Change chatter's voice when reading messages.", syntax: "", permissions: ["tts.commands.voice.admin"], version: "4.0", examples: ["brian @Nightbot"], subcommands: [] } ] } ] const CommandsPage = () => { return (
Commands
    {commands.map((command) =>
  • {COMMAND_PREFIX}{command.name}

    {command.permissions.map(p =>
    {p}
    )} {!!command.version &&
    version required: {command.version}
    }
    {command.description}
    {command.subcommands.length == 0 &&
    Syntax: {COMMAND_PREFIX}{command.name} {command.syntax}
    } {command.examples.map(ex =>
    Example: {COMMAND_PREFIX}{command.name} {ex}
    )} {command.subcommands.map(c =>
    {COMMAND_PREFIX}{command.name} {command.syntax.length == 0 ? "" : command.syntax + " "}{c.name} {c.syntax}
    {c.permissions.map(p =>
    {p}
    )} {!!c.version &&
    version required: {c.version}
    }
    {c.description}
    )}
  • )}
); } export default CommandsPage;