Skip to content

Instantly share code, notes, and snippets.

@limxuan
Created November 26, 2020 07:19
Show Gist options
  • Save limxuan/66ca88e4027875103e09c5f4a804f345 to your computer and use it in GitHub Desktop.
Save limxuan/66ca88e4027875103e09c5f4a804f345 to your computer and use it in GitHub Desktop.
readdirSync("./events/").forEach((file) => {
const events = readdirSync("./events/").filter((file) =>
file.endsWith(".js")
);
for (let file of events) {
let pull = require(`../events/${file}`);
if (pull.name) {
client.events.set(pull.name, pull);
} else {
continue;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment