[Solved] Coin flip command


if(command == "ht")
{
      function doRandHT() {
var rand = ['HEADS!','TAILS!'];

return rand[Math.floor(Math.random()*rand.length)];
}

 const embed = {
"title": `Here is the winner!`,
"description": doRandHT(),
"color": 7584788,
};
message.channel.send({ embed });


};

You can use this plain command for every random command in Discord.js I also integrated this with embed design so it will come in a well-designed box.

Warning: You may need to make changes in your code in order to get this working. Some uses different command structures, Don’t expect it to work when you just paste it. Make changes, look to your other commands and make changes according to them.

This is fully tested and working random command.

0

solved Coin flip command