I want to add vote cooldown in this command. It can check whether user voted or not
const url = `https://top.gg/api/bots/${botId}/check?userId=${uId}`; // api endpoint
fetch(url, { method: "GET", headers: { Authorization: process.env.TOPGG }})
.then((res) => res.text())
.then((json) => {
var isVoted = JSON.parse(json).voted;
if (isVoted === 0) {
message.channel.send("not voted");
} else if (isVoted === 1) {
message.channel.send("voted");
}
const embed = new Discord.MessageEmbed()
embed stuff...)
message.channel.send(embed);
});
},
};