📕
AFKHandler
  • Introduction
  • FAQ
  • Changelog
  • Classes
    • AFKHandler
    • Command
    • SlashCommand
    • Event
    • Feature
  • Methods
    • Commands
    • SlashCommands
    • deleteSlash
    • Events
    • Features
    • load
    • setCooldown
    • time
    • convert
    • convertLong
  • Types
  • AFKHandlerInteraface
  • AFKHandlerOptions
  • CommandInterface
  • SlashCommandInterface
  • EventInterface
  • FeatureInterface
  • CommandHelp
  • (Callbacks)
  • (Utils)
Powered by GitBook
On this page

Was this helpful?

  1. Methods

Commands

Loads Commands

PreviousFeatureNextSlashCommands

Last updated 3 years ago

Was this helpful?

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

  • 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);
    },
  });

CommandInterface
Awaited
this