uniform naming

This commit is contained in:
Mylloon 2023-01-17 10:55:50 +01:00
parent ffa92bbd5f
commit 43e7eba319
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -174,7 +174,7 @@ export default {
// Use the cli because we already have enough data // Use the cli because we already have enough data
return newReminder(client, time, { return newReminder(client, time, {
locale: interaction.locale, locale: interaction.locale,
message: interaction.options.getString(loc_default?.get('c_reminder_sub1_opt2_name') as string), message: interaction.options.getString(loc_default?.get(`c_${filename}_sub1_opt2_name`) as string),
createdAt: interaction.createdAt.getTime(), createdAt: interaction.createdAt.getTime(),
channelId: interaction.channelId, channelId: interaction.channelId,
userId: interaction.user.id, userId: interaction.user.id,
@ -187,20 +187,20 @@ export default {
// Show modal to user to get at least the time // Show modal to user to get at least the time
const modal = new ModalBuilder() const modal = new ModalBuilder()
.setCustomId('reminderGUI') .setCustomId('reminderGUI')
.setTitle(loc.get('c_reminder_name').capitalize()); .setTitle(loc.get(`c_${filename}_name`).capitalize());
const timeGUI = new TextInputBuilder() const timeGUI = new TextInputBuilder()
.setCustomId('reminderGUI-time') .setCustomId('reminderGUI-time')
.setLabel(loc.get('c_reminder_sub1_opt1_name').capitalize()) .setLabel(loc.get(`c_${filename}_sub1_opt1_name`).capitalize())
.setStyle(TextInputStyle.Short) .setStyle(TextInputStyle.Short)
.setPlaceholder('1h') .setPlaceholder('1h')
.setRequired(true); .setRequired(true);
const messageGUI = new TextInputBuilder() const messageGUI = new TextInputBuilder()
.setCustomId('reminderGUI-message') .setCustomId('reminderGUI-message')
.setLabel(loc.get('c_reminder_sub1_opt2_name').capitalize()) .setLabel(loc.get(`c_${filename}_sub1_opt2_name`).capitalize())
.setStyle(TextInputStyle.Paragraph) .setStyle(TextInputStyle.Paragraph)
.setPlaceholder(loc.get('c_reminder_sub1_opt2_desc')) .setPlaceholder(loc.get(`c_${filename}_sub1_opt2_desc`))
.setRequired(false); .setRequired(false);
modal.addComponents( modal.addComponents(
@ -229,12 +229,12 @@ export default {
.addComponents( .addComponents(
new ButtonBuilder() new ButtonBuilder()
.setCustomId(idPrec) .setCustomId(idPrec)
.setLabel(loc.get('c_reminder12')) .setLabel(loc.get(`c_${filename}12`))
.setStyle(ButtonStyle.Primary)) .setStyle(ButtonStyle.Primary))
.addComponents( .addComponents(
new ButtonBuilder() new ButtonBuilder()
.setCustomId(idNext) .setCustomId(idNext)
.setLabel(loc.get('c_reminder13')) .setLabel(loc.get(`c_${filename}13`))
.setStyle(ButtonStyle.Primary), .setStyle(ButtonStyle.Primary),
); );
@ -249,12 +249,12 @@ export default {
?.toLowerCase() ?? '': { ?.toLowerCase() ?? '': {
const id = interaction.options.getInteger(loc_default?.get(`c_${filename}_sub3_opt1_name`) as string); const id = interaction.options.getInteger(loc_default?.get(`c_${filename}_sub3_opt1_name`) as string);
if (id === null) { if (id === null) {
return interaction.reply({ content: loc.get('c_reminder2'), ephemeral: true }); return interaction.reply({ content: loc.get(`c_${filename}2`), ephemeral: true });
} }
// Check if the ID exists and belongs to the user // Check if the ID exists and belongs to the user
if (await checkOwnershipReminder(client, id, interaction.user.id, interaction.guildId ?? '0')) { if (await checkOwnershipReminder(client, id, interaction.user.id, interaction.guildId ?? '0')) {
return interaction.reply({ content: loc.get('c_reminder3'), ephemeral: true }); return interaction.reply({ content: loc.get(`c_${filename}3`), ephemeral: true });
} }
// Stop timeout // Stop timeout