Skip to content

Commit f1133c7

Browse files
committed
made it ask for permission.VIEW_CHANNEL
1 parent dcee24a commit f1133c7

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/main/java/org/ironriders/discordbot/Commands/InitializeCommands.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,29 @@
55
import net.dv8tion.jda.api.interactions.commands.OptionType;
66
import net.dv8tion.jda.api.interactions.commands.build.Commands;
77
import net.dv8tion.jda.api.interactions.commands.build.OptionData;
8+
import net.dv8tion.jda.api.interactions.commands.Permission;
89

910
public class InitializeCommands extends ListenerAdapter {
1011
@Override
1112
public void onReady(ReadyEvent event) {
1213
event.getJDA().updateCommands().addCommands(
1314
Commands.slash("tba", "Retrieves some information on any team of your choosing.")
1415
.addOption(OptionType.INTEGER, "teamnumber", "Team Number", false)
15-
.setDefaultPermissions(DefaultMemberPermissions.ENABLED),
16+
.enabledFor(Permission.VIEW_CHANNEL),
1617
Commands.slash("thebluealliance", "Retrieves some information on any team of your " +
1718
"choosing.")
1819
.addOption(OptionType.INTEGER, "teamnumber", "Team Number", false)
19-
.setDefaultPermissions(DefaultMemberPermissions.ENABLED),
20+
.enabledFor(Permission.VIEW_CHANNEL),
2021
Commands.slash("teaminfo", "Retrieves some information on our team.")
21-
.setDefaultPermissions(DefaultMemberPermissions.ENABLED),
22+
.enabledFor(Permission.VIEW_CHANNEL),
2223

2324
// Instructional Commands
24-
Commands.slash("help", "Retrieves a key of all the commands plus how to contribute.").setDefaultPermissions(DefaultMemberPermissions.ENABLED),
25+
Commands.slash("help", "Retrieves a key of all the commands plus how to contribute.").enabledFor(Permission.VIEW_CHANNEL),
2526
Commands.slash("resources", "Retrieves an embed with our teams resources.")
26-
.setDefaultPermissions(DefaultMemberPermissions.ENABLED),
27+
.enabledFor(Permission.VIEW_CHANNEL),
2728
Commands.slash("roster", "Provides instructions on complete ones membership.")
2829
.addOption(OptionType.MENTIONABLE, "notify", "Member to notify", false)
29-
.setDefaultPermissions(DefaultMemberPermissions.ENABLED),
30+
.enabledFor(Permission.VIEW_CHANNEL),
3031
Commands.slash("schedule", "Provides a schedule for the selected department.")
3132
.addOptions(
3233
new OptionData(
@@ -40,9 +41,9 @@ public void onReady(ReadyEvent event) {
4041
.addChoice("Design/CAD Department", "cad")
4142
.addChoice("Drive Team", "drive")
4243
)
43-
.setDefaultPermissions(DefaultMemberPermissions.ENABLED),
44+
.enabledFor(Permission.VIEW_CHANNEL),
4445
Commands.slash("chants", "Retrieves a key of all our chants.")
45-
.setDefaultPermissions(DefaultMemberPermissions.ENABLED)
46+
.setDefaultPermissions(DefaultMemberPermissions.enabledFor)
4647
).queue();
4748
}
4849
}

0 commit comments

Comments
 (0)