Open github-learning-lab[bot] opened 4 years ago
const { cpuUsage } = require('process')
const Discord = require('discord.js'), client = new Discord.Client(), config = require('./config.json'), fs = require('fs')
client.login(config.token) client.commands = new Discord.Collection()
fs.readdir('./commabds', (err, files) => { if (err) throw err files.forEach(file => { if (!file.endsWith('.js')) return const command = require (./commands/${file}) client.commands.set(command.name, command)
./commands/${file}
})
client.on('message', message => { if (message.type !== 'DEFAULT' || message.author.bot) return
const args = message.content.trim().split(/ +/g) const commandName = args.shift().toLowerCase() if (!commandName.startsWith(config.prefix)) return const command = client.commands.get(commandName.slice(config.prefix.lenght)) if (command) return command.run(message, args, client)
{ "token": "Le Token du bot :v", "prefix": "+"
}
const { cpuUsage } = require('process')
const Discord = require('discord.js'), client = new Discord.Client(), config = require('./config.json'), fs = require('fs')
client.login(config.token) client.commands = new Discord.Collection()
fs.readdir('./commabds', (err, files) => { if (err) throw err files.forEach(file => { if (!file.endsWith('.js')) return const command = require (
./commands/${file}
) client.commands.set(command.name, command)})
client.on('message', message => { if (message.type !== 'DEFAULT' || message.author.bot) return
})