r/javaScriptStudyGroup • u/marquesdinisp • Aug 26 '20
hello can someone help me? can someone tell me if is something wrong please. i can`t put the bot on-line and make it work.
4
u/Greyhaven7 Aug 26 '20
Did you just...
I think you want to delete this asap.
2
u/DefiantBidet Aug 27 '20
He has no idea he just shared a private key with the internet. Op.
Please learn about private keys and security.
You just compromised your discord server by posting its key in your screenshot. Your lack of knowledge is dangerous. Consider taking courses1
1
u/Nunuvin Aug 27 '20
pls paste code, dont do screenshots.
1
u/marquesdinisp Aug 27 '20
const Discord = require('discord.js');
const client = new Discord.Client();
const prefix = '+';
const fs = require('fs');
client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for(const file of commandFiles){
const command = require(`./commands/${file}`);
client.commands.set(command.name, command);
}
client.once('ready', () => {
console.log('JÁ está on-line!');
});
client.on('message', message => {
if(!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();if(command === 'ping'){
client.commands.get('ping').execute(message, args);
} else if (command === 'twitch'){
client.commands.get('twitch').execute(message, args);
} else if (command === 'help'){
client.commands.get('help').execute(message, args);
} else if (command === 'rickroll'){
client.commands.get('rickroll').execute(message, args);
} else if (command === 'allstar'){
client.commands.get('allstar').execute(message, args);
} else if (command === '80s'){
client.commands.get('80s').execute(message, args);
}});
module JS
module.exports = {
name: 'ping',
description: "this is a ping command!",
execute(message, args){
message.channel.send('pong!');
}
}







2
u/dagneyandleo Aug 26 '20
What happens when you try to run? How does it fail/error?