gamodu62100

LoadEvents.js

Mar 20th, 2023
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const fs = require('fs')
  2.  
  3. module.exports = async bot => {
  4.  
  5.    fs.readdirSync("./Events").filter(f => f.endsWith(".js")).forEach(async file => {
  6.        
  7.        let event = require(`../Events/${file}`)
  8.        bot.on(file.split(".js").join(""),event.bind(null, bot))
  9.        console.log(`Evénement ${file} chargé avec succès!`)
  10.    })
  11. }
Add Comment
Please, Sign In to add comment