Don't ban a user if they are already on the ban list

This commit is contained in:
powermaker450 2024-10-13 19:08:41 -04:00
parent b5c9f6c6b2
commit 44be8355e3

View file

@ -38,9 +38,20 @@ export const data = new SlashCommandBuilder()
.setDefaultMemberPermissions(PermissionFlagsBits.ModerateMembers);
export async function execute(interaction: ChatInputCommandInteraction) {
const guildId = interaction.guild?.id!;
const confessionId = interaction.options.getString("id")!;
if (dt.isBanned(guildId, confessionId)) {
return interaction.reply({
content: "That user is already banned!",
ephemeral: true
});
}
const result = dt.addBan(
interaction.guild?.id!,
interaction.options.getString("id")!
guildId,
confessionId
);
try {