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:
@@ -5,9 +5,9 @@ const { Character, Group } = require('../models');
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
name: "interactionCreate",
|
name: "interactionCreate",
|
||||||
async execute (interaction) {
|
async execute (interaction) {
|
||||||
|
if (interaction.type !== InteractionType.ApplicationCommandAutocomplete) return;
|
||||||
let isRegistered = await UserUtils.registrationCheck(interaction);
|
let isRegistered = await UserUtils.registrationCheck(interaction);
|
||||||
if (!isRegistered) return;
|
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}`);
|
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);
|
let user = await UserUtils.getUserByDiscordId(interaction.member.id);
|
||||||
|
|||||||
@@ -22,9 +22,8 @@ module.exports = {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
interaction.reply({
|
interaction.channel.send({
|
||||||
content: `${interaction.member} You are not registered, use the /register command`,
|
content: `${interaction.member} You are not registered, use the /register command`
|
||||||
ephemeral: false
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user