feat: Reminders #44

Merged
Anri merged 54 commits from feat/reminders into main 2023-01-17 12:15:15 +01:00
2 changed files with 17 additions and 1 deletions
Showing only changes of commit eb741f409a - Show all commits

View file

@ -1,4 +1,4 @@
import { Client, Interaction, InteractionType } from 'discord.js';
import { Client, ComponentType, Interaction, InteractionType } from 'discord.js';
import { getLocale } from '../../utils/locales';
/** https://discord.js.org/#/docs/discord.js/main/class/Client?scrollTo=e-interactionCreate */
@ -29,6 +29,21 @@ export default (interaction: Interaction, client: Client) => {
return modal.interaction(interaction, client);
}
case InteractionType.MessageComponent:
if (interaction.componentType == ComponentType.Button) {
const button = client.buttons.list.get(interaction.customId);
if (!button) {
return interaction.reply({
content: loc.get('e_interacreate_no_button'),
});
}
return interaction;
}
// Handle only buttons for now
throw RangeError;
default:
break;
}

View file

@ -1,6 +1,7 @@
{
"e_interacreate_no_command": "Désolé, la commande n'existe plus...",
"e_interacreate_no_modal": "Désolé, le modèle n'existe plus...",
"e_interacreate_no_button": "Désolé, le bouton n'existe plus...",
"c_ping_name": "Ping",
"c_ping_desc": "Pong!",