@@ -125,17 +125,22 @@ private void registerLoadedAnnotationsWithDiscord() {
125
125
loadedSlashCommands .forEach ((commandName , slashCommandClassInstance ) -> {
126
126
try {
127
127
Class <?> slashCommandClassInstanceClass = slashCommandClassInstance .getClass ();
128
- Method method = (Method ) slashCommandClassInstanceClass
128
+ Method method =
129
+ (Method ) slashCommandClassInstanceClass
129
130
.getMethod ("method" )
130
131
.invoke (slashCommandClassInstance );
131
132
132
133
Annotation [] annotations = method .getAnnotations ();
133
134
for (Annotation annotation : annotations ) {
134
- if (annotation .annotationType ().getName ().equals ("com.javadiscord.jdi.core.annotations.SlashCommand" )) {
135
+ if (
136
+ annotation .annotationType ().getName ()
137
+ .equals ("com.javadiscord.jdi.core.annotations.SlashCommand" )
138
+ ) {
135
139
Method nameMethod = annotation .annotationType ().getMethod ("name" );
136
140
String name = (String ) nameMethod .invoke (annotation );
137
141
138
- Method descriptionMethod = annotation .annotationType ().getMethod ("description" );
142
+ Method descriptionMethod =
143
+ annotation .annotationType ().getMethod ("description" );
139
144
String description = (String ) descriptionMethod .invoke (annotation );
140
145
141
146
Method optionsMethod = annotation .annotationType ().getMethod ("options" );
@@ -147,8 +152,10 @@ private void registerLoadedAnnotationsWithDiscord() {
147
152
Method optionNameMethod = option .getClass ().getMethod ("name" );
148
153
String optionName = (String ) optionNameMethod .invoke (option );
149
154
150
- Method optionDescriptionMethod = option .getClass ().getMethod ("description" );
151
- String optionDescription = (String ) optionDescriptionMethod .invoke (option );
155
+ Method optionDescriptionMethod =
156
+ option .getClass ().getMethod ("description" );
157
+ String optionDescription =
158
+ (String ) optionDescriptionMethod .invoke (option );
152
159
153
160
Method optionTypeMethod = option .getClass ().getMethod ("type" );
154
161
Enum <?> optionType = (Enum <?>) optionTypeMethod .invoke (option );
@@ -157,11 +164,14 @@ private void registerLoadedAnnotationsWithDiscord() {
157
164
Method optionRequiredMethod = option .getClass ().getMethod ("required" );
158
165
boolean optionRequired = (boolean ) optionRequiredMethod .invoke (option );
159
166
160
- builder .addOption (new CommandOption (
167
+ builder .addOption (
168
+ new CommandOption (
161
169
optionName ,
162
170
optionDescription ,
163
171
CommandOptionType .fromName (optionTypeValue ),
164
- optionRequired ));
172
+ optionRequired
173
+ )
174
+ );
165
175
}
166
176
167
177
createInteractionRequests .add (builder );
@@ -208,7 +218,11 @@ private void loadSlashCommands() {
208
218
if (constructor .getParameterCount () == 1 ) {
209
219
Parameter parameters = constructor .getParameters ()[0 ];
210
220
if (parameters .getType ().equals (Map .class )) {
211
- eventListeners .add (new InteractionEventHandler (constructor .newInstance (loadedSlashCommands )));
221
+ eventListeners .add (
222
+ new InteractionEventHandler (
223
+ constructor .newInstance (loadedSlashCommands )
224
+ )
225
+ );
212
226
return ;
213
227
}
214
228
return ;
0 commit comments