5
5
import net .dv8tion .jda .api .interactions .commands .OptionType ;
6
6
import net .dv8tion .jda .api .interactions .commands .build .Commands ;
7
7
import net .dv8tion .jda .api .interactions .commands .build .OptionData ;
8
+ import net .dv8tion .jda .api .interactions .commands .Permission ;
8
9
9
10
public class InitializeCommands extends ListenerAdapter {
10
11
@ Override
11
12
public void onReady (ReadyEvent event ) {
12
13
event .getJDA ().updateCommands ().addCommands (
13
14
Commands .slash ("tba" , "Retrieves some information on any team of your choosing." )
14
15
.addOption (OptionType .INTEGER , "teamnumber" , "Team Number" , false )
15
- .setDefaultPermissions ( DefaultMemberPermissions . ENABLED ),
16
+ .enabledFor ( Permission . VIEW_CHANNEL ),
16
17
Commands .slash ("thebluealliance" , "Retrieves some information on any team of your " +
17
18
"choosing." )
18
19
.addOption (OptionType .INTEGER , "teamnumber" , "Team Number" , false )
19
- .setDefaultPermissions ( DefaultMemberPermissions . ENABLED ),
20
+ .enabledFor ( Permission . VIEW_CHANNEL ),
20
21
Commands .slash ("teaminfo" , "Retrieves some information on our team." )
21
- .setDefaultPermissions ( DefaultMemberPermissions . ENABLED ),
22
+ .enabledFor ( Permission . VIEW_CHANNEL ),
22
23
23
24
// 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 ),
25
26
Commands .slash ("resources" , "Retrieves an embed with our teams resources." )
26
- .setDefaultPermissions ( DefaultMemberPermissions . ENABLED ),
27
+ .enabledFor ( Permission . VIEW_CHANNEL ),
27
28
Commands .slash ("roster" , "Provides instructions on complete ones membership." )
28
29
.addOption (OptionType .MENTIONABLE , "notify" , "Member to notify" , false )
29
- .setDefaultPermissions ( DefaultMemberPermissions . ENABLED ),
30
+ .enabledFor ( Permission . VIEW_CHANNEL ),
30
31
Commands .slash ("schedule" , "Provides a schedule for the selected department." )
31
32
.addOptions (
32
33
new OptionData (
@@ -40,9 +41,9 @@ public void onReady(ReadyEvent event) {
40
41
.addChoice ("Design/CAD Department" , "cad" )
41
42
.addChoice ("Drive Team" , "drive" )
42
43
)
43
- .setDefaultPermissions ( DefaultMemberPermissions . ENABLED ),
44
+ .enabledFor ( Permission . VIEW_CHANNEL ),
44
45
Commands .slash ("chants" , "Retrieves a key of all our chants." )
45
- .setDefaultPermissions (DefaultMemberPermissions .ENABLED )
46
+ .setDefaultPermissions (DefaultMemberPermissions .enabledFor )
46
47
).queue ();
47
48
}
48
49
}
0 commit comments