diff --git a/commands/General/afk.js b/commands/General/afk.js index 45cd7b9b..62f47e17 100644 --- a/commands/General/afk.js +++ b/commands/General/afk.js @@ -45,7 +45,7 @@ class Afk extends BaseCommand { * @param {Object} data */ async execute(client, interaction, data) { - interaction.deferReply({ ephemeral: true }); + await interaction.deferReply({ ephemeral: true }); const reason = interaction.options.getString("message"); diff --git a/commands/General/remindme.js b/commands/General/remindme.js index 603046c8..4973f6c0 100644 --- a/commands/General/remindme.js +++ b/commands/General/remindme.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder } = require("discord.js"); +const { SlashCommandBuilder, EmbedBuilder } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"), ms = require("ms"), moment = require("moment"); @@ -60,15 +60,13 @@ class Remindme extends BaseCommand { await interaction.deferReply({ ephemeral: true }); if (!data.userData.reminds) data.userData.reminds = []; - // TODO: rework this shit - const time = interaction.options.getString("time"), - message = interaction.options.getString("message"), - dateNow = Date.now(); + + const dateNow = Date.now(); const reminderData = { - message: message, + message: interaction.options.getString("message"), createdAt: dateNow, - sendAt: dateNow + ms(time), + sendAt: dateNow + ms(interaction.options.getString("time")), }; data.userData.reminds.push(reminderData); @@ -78,10 +76,26 @@ class Remindme extends BaseCommand { client.databaseCache.usersReminds.set(interaction.user.id, data.userData); - interaction.success("general/remindme:SAVED", { - message, - time: moment(reminderData.sendAt).locale(interaction.getLocale()).format("Do MMMM YYYY, HH:mm:ss"), - }, { edit: true }); + const embed = new EmbedBuilder() + .setAuthor({ + name: interaction.translate("general/remindme:EMBED_SAVED"), + }) + .addFields([ + { + name: interaction.translate("general/remindme:EMBED_TIME"), + value: moment(reminderData.sendAt).locale(interaction.getLocale()).format("Do MMMM YYYY, HH:mm:ss"), + }, + { + name: interaction.translate("common:MESSAGE"), + value: reminderData.message, + }, + ]) + .setColor(client.config.embed.color) + .setFooter(client.config.embed.footer); + + interaction.editReply({ + embeds: [embed], + }); } } diff --git a/helpers/checkReminds.js b/helpers/checkReminds.js index dd7b21e0..da7beb67 100644 --- a/helpers/checkReminds.js +++ b/helpers/checkReminds.js @@ -27,14 +27,19 @@ module.exports.init = function (client) { mustSent.forEach(r => { const embed = new EmbedBuilder() .setAuthor({ - name: client.translate("general/remindme:TITLE"), + name: client.translate("general/remindme:EMBED_TITLE"), }) - .setDescription( - client.translate("general/remindme:CREATED", { - time: moment(r.createdAt).locale(client.defaultLanguage).format("dddd, Do MMMM YYYY, HH:mm:ss"), - }), - ) .addFields([ + { + name: client.translate("general/remindme:EMBED_CREATED"), + value: moment(r.createdAt).locale(client.defaultLanguage).format("Do MMMM YYYY, HH:mm:ss"), + inline: true, + }, + { + name: client.translate("general/remindme:EMBED_TIME"), + value: moment(r.sendAt).locale(client.defaultLanguage).format("Do MMMM YYYY, HH:mm:ss"), + inline: true, + }, { name: client.translate("common:MESSAGE"), value: r.message, diff --git a/languages/en-US/general/remindme.json b/languages/en-US/general/remindme.json index 9e2e7d95..629960b2 100644 --- a/languages/en-US/general/remindme.json +++ b/languages/en-US/general/remindme.json @@ -3,7 +3,8 @@ "USAGE": "[time] [message]", "EXAMPLES": "remindme time:12h message:Use the command 'work'\nremindme time:5m message:Get the chicken from the freezer!", "TIME": "Time (e.g., 10s, 5m, 2h, 1d, 3w)", - "SAVED": "Reminder `{{message}}` saved for **{{time}}**", - "TITLE": "Reminder from JaBa", - "CREATED": "Reminder created: **{{time}}**" + "EMBED_SAVED": "Remind saved!", + "EMBED_TIME": "Reminder was set to", + "EMBED_TITLE": "Remind", + "EMBED_CREATED": "Created" } \ No newline at end of file diff --git a/languages/ru-RU/general/remindme.json b/languages/ru-RU/general/remindme.json index a0e590e3..59467b72 100644 --- a/languages/ru-RU/general/remindme.json +++ b/languages/ru-RU/general/remindme.json @@ -3,7 +3,8 @@ "USAGE": "[time] [message]", "EXAMPLES": "remindme time:12h message:Использовать команду work\nremindme time:5m message:Достать курицу из морозилки!", "TIME": "Время (Например: 10s, 5m, 2h, 1d, 3w)", - "SAVED": "Напоминание `{{message}}` сохранено на **{{time}}**", - "TITLE": "Напоминание от JaBa", - "CREATED": "Напоминание создано: **{{time}}**" + "EMBED_SAVED": "Напоминание сохранено!", + "EMBED_TIME": "Сохранено на", + "EMBED_TITLE": "Напоминание", + "EMBED_CREATED": "Создано" } \ No newline at end of file diff --git a/languages/uk-UA/general/remindme.json b/languages/uk-UA/general/remindme.json index 09510b0c..ebbc45c8 100644 --- a/languages/uk-UA/general/remindme.json +++ b/languages/uk-UA/general/remindme.json @@ -3,7 +3,8 @@ "USAGE": "[time] [message]", "EXAMPLES": "remindme time:12h message:Використовувати команду work\nremindme time:5m message:Дістати курку з морозилки", "TIME": "Час (Наприклад: 10s, 5m, 2h, 1d, 3w)", - "SAVED": "Нагадування `{{message}}` збережено на **{{time}}**", - "TITLE": "Нагадування від JaBa", - "CREATED": "Нагадування створено: **{{time}}**" + "EMBED_SAVED": "Нагадування збережено!", + "EMBED_TIME": "Створено на", + "EMBED_TITLE": "Нагадування", + "EMBED_CREATED": "Створено" } \ No newline at end of file