Commands

Loads Commands

public async Commands(dir: string, options: { prefix: string; category?: string; callback?: (command: CommandInterface, fileName: string) => Awaited<unknown>; }): Promise<this>

  • dir: commands directory

  • options.prefix: prefix

  • options.category?: default category

  • options.callback?: function executed when a command is loaded

  client.Commands("src/commands", {
    prefix: "!",
    category: "Misc",
    callback(command, file) {
      console.log("Loading command " + command.name);
    },
  });

Last updated

Was this helpful?