File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/main/java/net/javadiscord/javabot/systems/configuration Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 66import net .javadiscord .javabot .Bot ;
77import net .javadiscord .javabot .data .config .GuildConfig ;
88import net .javadiscord .javabot .data .config .UnknownPropertyException ;
9+ import net .javadiscord .javabot .util .Checks ;
910import net .javadiscord .javabot .util .Responses ;
1011import org .jetbrains .annotations .NotNull ;
1112
1819public abstract class ConfigSubcommand extends SlashCommand .Subcommand {
1920 @ Override
2021 public void execute (@ NotNull SlashCommandInteractionEvent event ) {
21- if (event .getGuild () == null ) {
22+ if (event .getGuild () == null || event . getMember () == null ) {
2223 Responses .replyGuildOnly (event ).queue ();
2324 return ;
2425 }
26+ if (!Checks .hasAdminRole (event .getGuild (), event .getMember ())) {
27+ Responses .replyAdminOnly (event , event .getGuild ()).queue ();
28+ return ;
29+ }
2530 try {
2631 handleConfigSubcommand (event , Bot .config .get (event .getGuild ())).queue ();
2732 } catch (UnknownPropertyException e ) {
You can’t perform that action at this time.
0 commit comments