我的代码:
const Discord = require('discord.js');
const client = new Discord.Client();
const prefix = '$';
client.once('ready' , () => {
console.log('M-am trezit din morti!');
});
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 === 'about'){
}else if(command === 'troll'){
const messages = ["Esti un ratat!!", "Akatsuki este cel mai tare!", "Lui Tobi ii plac baietii!", "Invata sa joci, noobule!" , "Esti pe langa cu jocul!", "Cum naiba ai ajuns in factiunea asta?"]
const randomMessage = messages[Math.floor(Math.random() * messages.length)];
message.channel.send(randomMessage)
}
});
client.login('notgonnashowit');