@@ -95,7 +95,7 @@ public void onMessageContext(MessageContextInteractionEvent event) {
95
95
String originalMessageId = event .getTarget ().getId ();
96
96
String originalChannelId = event .getTarget ().getChannel ().getId ();
97
97
String authorId = event .getTarget ().getAuthor ().getId ();
98
- String mostCommonTag = tags .get ( 0 );
98
+ String mostCommonTag = tags .getFirst ( );
99
99
String chatGptPrompt =
100
100
"Summarize the following text into a concise title or heading not more than 4-5 words, remove quotations if any: %s"
101
101
.formatted (originalMessage );
@@ -142,7 +142,7 @@ public void onMessageContext(MessageContextInteractionEvent event) {
142
142
public void onModalSubmitted (ModalInteractionEvent event , List <String > args ) {
143
143
event .deferReply (true ).queue ();
144
144
145
- String authorId = args .get ( 0 );
145
+ String authorId = args .getFirst ( );
146
146
String messageId = args .get (1 );
147
147
String channelId = args .get (2 );
148
148
ForumChannel helperForum = getHelperForum (event .getJDA ());
@@ -226,13 +226,13 @@ private RestAction<ForumPostData> createForumPost(ModalInteractionEvent event,
226
226
String transferQuestionTag = event .getValue (MODAL_TAG ).getAsString ();
227
227
228
228
ForumChannel questionsForum = getHelperForum (event .getJDA ());
229
- String mostCommonTag = tags .get ( 0 );
229
+ String mostCommonTag = tags .getFirst ( );
230
230
231
231
String queryTag =
232
232
StringDistances .closestMatch (transferQuestionTag , tags ).orElse (mostCommonTag );
233
233
234
234
ForumTag tag = getTagOrDefault (questionsForum .getAvailableTagsByName (queryTag , true ),
235
- () -> questionsForum .getAvailableTagsByName (mostCommonTag , true ).get ( 0 ));
235
+ () -> questionsForum .getAvailableTagsByName (mostCommonTag , true ).getFirst ( ));
236
236
237
237
return questionsForum .createForumPost (forumTitle , forumMessage )
238
238
.setTags (ForumTagSnowflake .fromId (tag .getId ()))
@@ -279,7 +279,7 @@ private ForumChannel getHelperForum(JDA jda) {
279
279
280
280
private static ForumTag getTagOrDefault (List <ForumTag > tagsFoundOnForum ,
281
281
Supplier <ForumTag > defaultTag ) {
282
- return tagsFoundOnForum .isEmpty () ? defaultTag .get () : tagsFoundOnForum .get ( 0 );
282
+ return tagsFoundOnForum .isEmpty () ? defaultTag .get () : tagsFoundOnForum .getFirst ( );
283
283
}
284
284
285
285
private MessageEmbed makeEmbedForPost (User originalUser , String originalMessage ) {
0 commit comments