AFKHandler

Your main file

class AFKHandler<T = unknown> extends DJSClient implements AFKHandlerInterface<T>

constructor(options: AFKHandlerOptions<T>)

const AFKHandler = require("afkhandler").default

const client = new AFKHandler({
    client: { // DJSClient opyions
        intents: 32767
    }, 
    eval: true, // eval in console
    gadget: "Hello World!", // custom gadget
    developers: ["012345678910111213"]
    // bot developers
})

client.on("ready", () => {
  client.Commands("src/commands", {
    // commands folder
    prefix: "!", // prefix
    category: "Misc", // default category
    callback(command, file) {
      // function executed when a command is loaded
      console.log("Loading command " + command.name);
    },
  });

  client.SlashCommands(
    "src/slash-commands",
    (
      cmd,
      file // slash folder
    ) => console.log("Loading slash command " + cmd.name)
    // function executed when a slash command is published
  );

  client.Events(
    "src/events",
    (
      event,
      file // events folder
    ) => console.log(`Loading event ${event.name}`)
    // function executed when an event is loaded
  );
  client.Features(
    "src/features",
    (
      feature,
      file // features folder
    ) => console.log(`Loading feature from ${file}`)
    // function executed when a feature is loaded
  );
});

client.login("token");

Last updated

Was this helpful?