make /reminds ephemeral

more time before losing a streak in /work
This commit is contained in:
Jonny_Bro (Nikita) 2024-05-28 18:15:14 +05:00
parent 771bede60f
commit 2f3eabb3f3
Signed by: jonny_bro
GPG key ID: 3F1ECC04147E9BD8
2 changed files with 4 additions and 3 deletions

View file

@ -35,7 +35,7 @@ class Work extends BaseCommand {
time: `<t:${Math.floor(isInCooldown)}:R>`, time: `<t:${Math.floor(isInCooldown)}:R>`,
}); });
if (Math.floor(Date.now() / 1000) > Math.floor(memberData.cooldowns.work + 24 * 60 * 60)) memberData.workStreak = 0; if (Math.floor(Date.now() / 1000) > Math.floor(memberData.cooldowns.work + 30 * 60 * 60)) memberData.workStreak = 0;
memberData.cooldowns.work = Math.floor(Date.now() / 1000) + 24 * 60 * 60; // 24 hours memberData.cooldowns.work = Math.floor(Date.now() / 1000) + 24 * 60 * 60; // 24 hours
memberData.workStreak = (memberData.workStreak || 0) + 1; memberData.workStreak = (memberData.workStreak || 0) + 1;

View file

@ -15,7 +15,7 @@ class Reminds extends BaseCommand {
uk: client.translate("general/reminds:DESCRIPTION", null, "uk-UA"), uk: client.translate("general/reminds:DESCRIPTION", null, "uk-UA"),
ru: client.translate("general/reminds:DESCRIPTION", null, "ru-RU"), ru: client.translate("general/reminds:DESCRIPTION", null, "ru-RU"),
}) })
.setDMPermission(false), .setDMPermission(true),
dirname: __dirname, dirname: __dirname,
ownerOnly: false, ownerOnly: false,
}); });
@ -120,7 +120,7 @@ class Reminds extends BaseCommand {
* @param {import("discord.js").ChatInputCommandInteraction} interaction * @param {import("discord.js").ChatInputCommandInteraction} interaction
*/ */
async execute(client, interaction) { async execute(client, interaction) {
await interaction.deferReply(); await interaction.deferReply({ ephemeral: true });
const reminds = interaction.data.user.reminds; const reminds = interaction.data.user.reminds;
if (reminds.length === 0) return interaction.error("general/reminds:NO_REMINDS", null, { edit: true }); if (reminds.length === 0) return interaction.error("general/reminds:NO_REMINDS", null, { edit: true });
@ -138,6 +138,7 @@ class Reminds extends BaseCommand {
content: `${interaction.translate("common:PAGE")}: **1**/**${embeds.length}**`, content: `${interaction.translate("common:PAGE")}: **1**/**${embeds.length}**`,
embeds: [embeds[0]], embeds: [embeds[0]],
components: [row], components: [row],
ephemeral: true,
}); });
} }
} }