Check if a user is banned from confessions before displaying the modal

This commit is contained in:
powermaker450 2024-10-14 11:52:04 -04:00
parent b45daf8fa2
commit 025a503abb

View file

@ -153,7 +153,13 @@ export async function execute(interaction: ChatInputCommandInteraction) {
collector.on("collect", i => {
if (i.customId === "submitConfession") {
i.showModal(submit);
// Check if the user is banned from confessions first before displaying the modal
dt.isBanned(i.guild.id, i.user.id)
? i.reply({
content: "You are banned from confessions in this server!",
ephemeral: true
})
: i.showModal(submit);
}
});