Class ChatCommandHandler

Hierarchy

  • ChatCommandHandler

Constructors

Methods

  • Parse a message calling a command. Does not trim off a leading command prefix.

    Example

    const message = "setname weakeyes";
    const ctx = new ChatCommandContext(room, room.players.host, message);

    await worker.chatCommandHandler.parseMessage(ctx, message);

    Parameters

    Returns Promise<void>

  • Remove a command from the command handler.

    Parameters

    • commandName: string

      The name of the command to be removed, should be RegisteredChatCommand.name.

      worker.chatCommandHandler.removeCommand("ping");
      

    Returns void

Properties

registeredCommands: Map<string, RegisteredChatCommand>
room: Room

Generated using TypeDoc