File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
src/main/java/pw/chew/mlb Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ public static void main(String[] args) throws IOException {
52
52
CommandClientBuilder client = new CommandClientBuilder ();
53
53
54
54
// Set the client settings
55
- client .setActivity (Activity .watching ("the 2024 season !" ));
55
+ client .setActivity (Activity .watching ("the all star game !" )); // ASG Shenanigans
56
56
client .setOwnerId (prop .getProperty ("userId" , "476488167042580481" ));
57
57
client .setPrefix ("woody!" );
58
58
Original file line number Diff line number Diff line change @@ -16,10 +16,17 @@ public JSONObject record() {
16
16
}
17
17
18
18
public int wins () {
19
+ // ASG Shenanigans
20
+ // ASG Shenanigans
21
+ if (name ().equals ("NL All-Stars" )) return 45 ;
22
+ if (name ().equals ("AL All-Stars" )) return 46 ;
19
23
return record ().getInt ("wins" );
20
24
}
21
25
22
26
public int losses () {
27
+ // ASG Shenanigans
28
+ if (name ().equals ("NL All-Stars" )) return 46 ;
29
+ if (name ().equals ("AL All-Stars" )) return 45 ;
23
30
return record ().getInt ("losses" );
24
31
}
25
32
Original file line number Diff line number Diff line change @@ -135,6 +135,8 @@ public List<Command.Choice> asChoices() {
135
135
public record Teams (JSONArray raw ) {
136
136
public List <Command .Choice > asChoices () {
137
137
List <Command .Choice > choices = new ArrayList <>();
138
+ // ASG Shenanigans
139
+ choices .add (new Command .Choice ("All Star Game" , 160 ));
138
140
for (int i = 0 ; i < raw .length (); i ++) {
139
141
JSONObject team = raw .getJSONObject (i );
140
142
choices .add (new Command .Choice (team .getString ("name" ), team .getInt ("id" )));
@@ -168,8 +170,11 @@ public List<Command.Choice> potentialChoices(String query) {
168
170
}
169
171
}
170
172
171
- // Send a message if we don't know what team
172
- return potential ;
173
+ // ASG Shenanigans
174
+ potential .add (new Command .Choice ("All Star Game" , 160 ));
175
+
176
+ // Return the potential list, distinct, and no more than 25 choices
177
+ return potential .stream ().distinct ().toList ().subList (0 , Math .min (potential .size (), 25 ));
173
178
}
174
179
}
175
180
You can’t perform that action at this time.
0 commit comments