-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
flipcoin.js
36 lines (35 loc) · 889 Bytes
/
flipcoin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const Discord = require("discord.js");
const emoji = require('../../emoji.json')
module.exports = {
name: "flipcoin",
aliases: [],
description: "Flip a virtual coin",
category: "Fun",
usage: "flipcoin",
run: async (client, message, args) => {
try {
const answers = ["Heads", "Tails"];
const answer = answers[Math.floor(Math.random() * answers.length)];
const embed = new Discord.MessageEmbed() // Prettier()
.setColor("RANDOM")
.setDescription(`🪙 | I'm get: ${answer}`)
.setFooter(
"Requested by " + `${message.author.username}`,
message.author.displayAvatarURL({
dynamic: true,
format: "png",
size: 2048,
})
)
.setTimestamp();
message.channel.send(embed);
} catch (err) {
message.channel.send({
embed: {
color: 16734039,
description: "Something went wrong... :cry:",
},
});
}
},
};