Skip to content

Commit

Permalink
Configure user permissions for slash commands
Browse files Browse the repository at this point in the history
  • Loading branch information
duncte123 committed Mar 30, 2024
1 parent 7fcccde commit 1600048
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package me.duncte123.skybot.objects
import me.duncte123.skybot.Variables
import me.duncte123.skybot.objects.command.CommandCategory
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent
import net.dv8tion.jda.api.interactions.commands.DefaultMemberPermissions
import net.dv8tion.jda.api.interactions.commands.build.CommandData
import net.dv8tion.jda.api.interactions.commands.build.Commands
import net.dv8tion.jda.api.interactions.commands.build.SlashCommandData
Expand All @@ -41,6 +42,7 @@ abstract class SlashSupport : SkyCommand() {
)
.setGuildOnly(true)
.setNSFW(category == CommandCategory.NSFW)
.setDefaultPermissions(DefaultMemberPermissions.enabledFor(this.userPermissions.toList()))

configureSlashSupport(base)

Expand Down

0 comments on commit 1600048

Please sign in to comment.