aboutsummaryrefslogtreecommitdiff
path: root/modules/public.js
blob: 8c43df87ca2a49da874a12f08cef7bf3eef79def (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const { MessageButton } = require("discord.js");

module.exports = (interaction, keys) => {
    if (typeof cooldowns[interaction.user.id] !== "undefined" && new Date() - cooldowns[interaction.user.id] < 30000) {
        return new MessageButton()
            .setCustomId("pony.public|" + keys[1])
            .setLabel(l("Wait " + Math.ceil((30000 - (new Date() - cooldowns[interaction.user.id]))/1000) + " seconds", "Patientez " + Math.ceil((30000 - (new Date() - cooldowns[interaction.user.id]))/1000) + " secondes", interaction.user.id, interaction.guild ? interaction.guild.id : 0))
            .setStyle("PRIMARY")
            .setDisabled(true);
    } else {
        return new MessageButton()
            .setCustomId("pony.public|" + keys[1])
            .setLabel(l("Show to everypony", "Afficher à tous", interaction.user.id, interaction.guild ? interaction.guild.id : 0))
            .setStyle("PRIMARY")
    }
}