diff --git a/CommandChecks/HomeServerPerms.cs b/CommandChecks/HomeServerPerms.cs index 22f3a710..e16dbd7d 100644 --- a/CommandChecks/HomeServerPerms.cs +++ b/CommandChecks/HomeServerPerms.cs @@ -137,14 +137,22 @@ public override async Task ExecuteCheckAsync(CommandContext ctx, bool help public class SlashRequireHomeserverPermAttribute : SlashCheckBaseAttribute { public ServerPermLevel TargetLvl; + public bool OwnerOverride; - public SlashRequireHomeserverPermAttribute(ServerPermLevel targetlvl) - => TargetLvl = targetlvl; + public SlashRequireHomeserverPermAttribute(ServerPermLevel targetlvl, bool ownerOverride = false) + { + TargetLvl = targetlvl; + OwnerOverride = ownerOverride; + } public override async Task ExecuteChecksAsync(InteractionContext ctx) { if (ctx.Guild.Id != Program.cfgjson.ServerID) return false; + + // bot owners can bypass perm checks ONLY if the command allows it. + if (OwnerOverride && Program.cfgjson.BotOwners.Contains(ctx.User.Id)) + return true; var level = await GetPermLevelAsync(ctx.Member); if (level >= TargetLvl) diff --git a/Commands/InteractionCommands/InsidersInteractions.cs b/Commands/InteractionCommands/InsidersInteractions.cs index 33624108..132143ea 100644 --- a/Commands/InteractionCommands/InsidersInteractions.cs +++ b/Commands/InteractionCommands/InsidersInteractions.cs @@ -3,7 +3,7 @@ namespace Cliptok.Commands.InteractionCommands public class InsidersInteractions : ApplicationCommandModule { [SlashCommand("send-insiders-info-buttons", "Sends a message with buttons to get Insider roles for #insiders-info.", false)] - [SlashRequireHomeserverPerm(ServerPermLevel.TrialModerator), SlashCommandPermissions(permissions: DiscordPermission.ModerateMembers)] + [SlashRequireHomeserverPerm(ServerPermLevel.Admin, ownerOverride: true), SlashCommandPermissions(permissions: DiscordPermission.ModerateMembers)] public static async Task SendInsidersInfoButtonMessage(InteractionContext ctx) { if (Program.cfgjson.InsiderInfoChannel != 0 && ctx.Channel.Id != Program.cfgjson.InsiderInfoChannel)