Skip to content

Commit

Permalink
Update client.js
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioSmuu committed Jul 8, 2021
1 parent 86cf9ac commit 0b08ac4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions handler/core/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ client.commands = new Collection()

////cmd
function readDir(dir){
let files = {}
const files = {}

fs.readdirSync(dir)
.sort((a, b) => fs.statSync(path.resolve(dir, a)).mtime.getTime() - fs.statSync(path.resolve(dir, b)).mtime.getTime())
.map(file => {
if (fs.lstatSync(path.resolve(dir, file)).isFile()) {
if (file.endsWith('.js')) {
console.log(`- ${file} OK!`)
let comandos = require(path.resolve(dir, file))
const comandos = require(path.resolve(dir, file))
comandos.info.cmd.map(e => client.commands.set(e, comandos))
}
}
Expand All @@ -28,7 +28,7 @@ readDir(path.resolve(__dirname, '../comandos/'))
////cmd

////evt
let files = fs.readdirSync(path.resolve(__dirname, '../eventos/'))
const files = fs.readdirSync(path.resolve(__dirname, '../eventos/'))
files.map(f => {
if (f.endsWith('.js')) client.on(f.slice(0, -3), require('../eventos/'+f).bind(null, client))
})
Expand Down

0 comments on commit 0b08ac4

Please sign in to comment.