feat: handle blocking users
Node.js CI / Lint and Test (push) Successful in 54s

This commit is contained in:
2025-09-27 17:30:28 -07:00
parent 64d5d4a9b5
commit bb90584693
3 changed files with 83 additions and 3 deletions
+14
View File
@@ -47,6 +47,12 @@ export const handleModalSubmit = async(
});
return;
}
if (record.blockedUsers.includes(interaction.user.id)) {
await interaction.editReply({
content: "You are blocked from asking questions in this server.",
});
return;
}
const question = interaction.fields.getTextInputValue("textinput");
const channel
= veluna.discord.channels.cache.get(record.questionChannelId)
@@ -71,6 +77,13 @@ export const handleModalSubmit = async(
style: 3,
type: 2,
},
{
// eslint-disable-next-line @typescript-eslint/naming-convention -- Discord API.
custom_id: `block-${interaction.user.id}`,
label: "Block user",
style: 4,
type: 2,
},
],
type: 1,
},
@@ -159,5 +172,6 @@ export const handleModalSubmit = async(
},
],
});
await message.delete();
}
};