Skip to content

Commit

Permalink
Update replayCooldown.js
Browse files Browse the repository at this point in the history
  • Loading branch information
forgetfulskybro authored Jul 16, 2023
1 parent 31610b2 commit b67a80b
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/buttons/replayCooldown.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ module.exports = {
ephemeral: true,
content: client.translation.get(guildDb?.language, 'Settings.replaySame'),
});

if (value < 2000) return modalInteraction.reply({
ephemeral: true,
content: client.translation.get(guildDb?.language, 'Settings.cooldownMin'),
});

if (isNumericRegex(value) === false)
return modalInteraction.reply({
ephemeral: true,
Expand All @@ -50,11 +56,7 @@ module.exports = {
const generalMsg = new EmbedBuilder()
.setTitle(client.translation.get(guildDb?.language, 'Settings.embed.generalTitle'))
.setDescription(
`${client.translation.get(guildDb?.language, 'Settings.embed.voteCooldown')}: ${
guildDb.voteCooldown
? `${guildDb.voteCooldown}`
: `<:x_:1077962443013238814>`
}\n${client.translation.get(guildDb?.language, 'Settings.embed.replayCooldown')}: ${
`${client.translation.get(guildDb?.language, 'Settings.embed.replayType')}: ${guildDb.replayType}\n${client.translation.get(guildDb?.language, 'Settings.embed.replayCooldown')}: ${
guildDb.replayCooldown
? `${value}`
: `<:x_:1077962443013238814>`
Expand All @@ -67,14 +69,15 @@ module.exports = {
});

const generalButtons = new ActionRowBuilder().addComponents(
new ButtonBuilder()
.setCustomId("voteCooldown")
.setLabel(client.translation.get(guildDb?.language, 'Settings.button.voteCooldown'))
.setStyle(guildDb.voteCooldown ? "Success" : "Secondary"),
new ButtonBuilder()
.setCustomId("replayCooldown")
.setLabel(client.translation.get(guildDb?.language, 'Settings.button.replayCooldown'))
.setStyle(guildDb.replayCooldown ? "Success" : "Secondary")
.setStyle(guildDb.replayCooldown ? "Success" : "Secondary"),
new ButtonBuilder()
.setCustomId("replayType")
.setLabel(client.translation.get(guildDb?.language, 'Settings.button.replayType'))
.setStyle("Primary")
.setEmoji("📝"),
);

await client.database.updateGuild(interaction.guild.id, {
Expand Down

0 comments on commit b67a80b

Please sign in to comment.