Constructor # new EventHandler() Source: handlers/EventHandler.js, line 12 Methods # (static) addEventDirectory(dir) → {module:handlers/EventHandler~EventHandler} Add a directory to scan for events. Parameters: Name Type Description dir String The absolute path of the directory to add. Source: handlers/EventHandler.js, line 60 Returns: A reference to the CommandHandler class. Type module:handlers/EventHandler~EventHandler Example // Adds the directory "events" to the event handler. const { join } = require("path"); EventHandler.addEventDirectory(join(__dirname, "events")); # (static) attachClient(client) → {module:handlers/EventHandler~EventHandler} Attach a client to the EventHandler. Parameters: Name Type Description client module:discord.js~Client The Discord client to attach. Source: handlers/EventHandler.js, line 43 Returns: A reference to the EventHandler class. Type module:handlers/EventHandler~EventHandler # (static) loadEvents() → {module:handlers/EventHandler~EventHandler} Load all events. Source: handlers/EventHandler.js, line 117 Returns: A reference to the EventHandler class. Type module:handlers/EventHandler~EventHandler Example // Load all events in the directory "events" const { join } = require("path"); EventHandler.addEventDirectory(join(__dirname, "events")); EventHandler.loadEvents(); # (static) removeEventDirectory(dir) → {module:handlers/EventHandler~EventHandler} Remove a directory to scan for events. Parameters: Name Type Description dir String The absolute path of the directory to remove. Source: handlers/EventHandler.js, line 91 Returns: A reference to the EventHandler class. Type module:handlers/EventHandler~EventHandler Example // Removes the directory "events" from the event handler. const { join } = require("path"); EventHandler.removeEventDirectory(join(__dirname, "events"));