Fix registration check causing duplicate acks

Registration reminders are now sent as a unique message.
We also no longer perform a registration check on autocomplete requests
This commit is contained in:
2023-03-14 16:06:25 +01:00
parent 3d1ed01bcb
commit 0f4b23b4ab
2 changed files with 3 additions and 4 deletions

View File

@@ -5,9 +5,9 @@ const { Character, Group } = require('../models');
module.exports = {
name: "interactionCreate",
async execute (interaction) {
if (interaction.type !== InteractionType.ApplicationCommandAutocomplete) return;
let isRegistered = await UserUtils.registrationCheck(interaction);
if (!isRegistered) return;
if (interaction.type !== InteractionType.ApplicationCommandAutocomplete) return;
console.log(`Autocomplete request from ${interaction.user.tag} (${interaction.user.id}) for ${interaction.commandName} with ${interaction.options.getFocused(true).value}`);
let user = await UserUtils.getUserByDiscordId(interaction.member.id);

View File

@@ -22,9 +22,8 @@ module.exports = {
return true;
}
interaction.reply({
content: `${interaction.member} You are not registered, use the /register command`,
ephemeral: false
interaction.channel.send({
content: `${interaction.member} You are not registered, use the /register command`
});
return false;