From 5bfffdf707161306c1f19f8321c80afab791277b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mj=C3=B6llnir?= Date: Sun, 18 Jan 2026 18:18:24 +0100 Subject: [PATCH] fix(module_modo): ban interaction doesn't works --- module_modo.lua | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/module_modo.lua b/module_modo.lua index e07d7db..922d0df 100644 --- a/module_modo.lua +++ b/module_modo.lua @@ -717,16 +717,29 @@ function Module:OnInteractionCreate(interaction) actionStr = "Muted " .. util.DiscordRelativeTime(duration) .. " by " .. moderator.mentionString elseif interactionType == "alertmodule_ban" then - local duration = interaction.data.values and interaction.data.values[1] or nil - local ban = Bot:GetModuleForGuild(guild, "ban") - if (ban and not mute:CheckPermissions(moderator)) or (not ban and not moderator:hasPermission(enums.permission.banMembers)) then + if (not moderator:hasPermission(enums.permission.banMembers)) then interaction:editResponse({ - content = string.format("❌ You do not have permission mute this member") + content = string.format("❌ You do not have permission ban this member") + }) + + return + end + + local ban = Bot:GetModuleForGuild(guild, "ban") + if not ban then + interaction:respond({ + type = enums.interactionResponseType.channelMessageWithSource, + data = { + content = "❌ The ban module isn't enabled on this server", + flags = enums.interactionResponseFlag.ephemeral + } }) + return end + local duration = interaction.data.values and interaction.data.values[1] or nil if duration == "0" or duration == "0_deletemessages" then -- "Waiting" interaction:respond({