📕
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. Classes

Event

PreviousSlashCommandNextFeature

Last updated 3 years ago

Was this helpful?

class Event<V extends keyof ClientEvents, T = unknown> implements <T>

constructor(options: <V, T>)

const { Event } = require("afkhandler");

module.exports = new Event({
  name: "guildMemberAdd", // event name
  once: false,
  // if the command only runs once
  run({ client, gadget }, member) {
    // run can be execute, callback, fire or emit
    console.log(`${member.user.username} joined a guild!`);
  },
});
import { Event } from "afkhandler";

export default new Event({
  name: "guildMemberAdd", // event name
  once: false,
  // if the command only runs once
  run({ client, gadget }, member) {
    // run can be execute, callback, fire or emit
    console.log(`${member.user.username} joined a guild!`);
  },
});

EventInterface
EventInterface