aboutsummaryrefslogtreecommitdiff
path: root/modules/episodepublic.js
diff options
context:
space:
mode:
Diffstat (limited to 'modules/episodepublic.js')
-rw-r--r--modules/episodepublic.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/episodepublic.js b/modules/episodepublic.js
new file mode 100644
index 0000000..73318f5
--- /dev/null
+++ b/modules/episodepublic.js
@@ -0,0 +1,16 @@
+const { MessageButton } = require("discord.js");
+
+module.exports = (interaction, series, episode) => {
+ if (typeof cooldowns[interaction.user.id] !== "undefined" && new Date() - cooldowns[interaction.user.id] < 30000) {
+ return new MessageButton()
+ .setCustomId("episode.public|" + series + "|" + episode)
+ .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("episode.public|" + series + "|" + episode)
+ .setLabel(l("Show to everypony", "Afficher à tous", interaction.user.id, interaction.guild ? interaction.guild.id : 0))
+ .setStyle("PRIMARY")
+ }
+} \ No newline at end of file