Skip to content

Commit

Permalink
Hide old configure commands for regular members as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Derkades committed Jan 9, 2025
1 parent b616011 commit dadba74
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/main/java/com/namelessmc/bot/commands/PingCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
import net.dv8tion.jda.api.interactions.InteractionHook;
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;

Expand All @@ -21,7 +22,8 @@ public class PingCommand extends Command {

@Override
public CommandData getCommandData(final Language language) {
return Commands.slash(this.name, language.get(PING_DESCRIPTION));
return Commands.slash(this.name, language.get(PING_DESCRIPTION))
.setDefaultPermissions(DefaultMemberPermissions.DISABLED);
}

@Override
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/com/namelessmc/bot/commands/URLCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,27 @@
import static com.namelessmc.bot.Language.Term.APIURL_DESCRIPTION;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.namelessmc.bot.Language;
import com.namelessmc.java_api.NamelessAPI;

import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
import net.dv8tion.jda.api.interactions.InteractionHook;
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;

public class URLCommand extends Command {

private static final Logger LOGGER = LoggerFactory.getLogger(URLCommand.class);

URLCommand() {
super("apiurl");
}

@Override
public CommandData getCommandData(final Language language) {
return Commands.slash(this.name, language.get(APIURL_DESCRIPTION));
return Commands.slash(this.name, language.get(APIURL_DESCRIPTION))
.setDefaultPermissions(DefaultMemberPermissions.DISABLED);
}

@Override
Expand Down

0 comments on commit dadba74

Please sign in to comment.