File tree 1 file changed +32
-4
lines changed
menu/src/main/java/com/jagrosh/jdautilities/menu
1 file changed +32
-4
lines changed Original file line number Diff line number Diff line change 26
26
import net .dv8tion .jda .api .requests .RestAction ;
27
27
import net .dv8tion .jda .internal .utils .Checks ;
28
28
29
- import java .util .Arrays ;
30
- import java .util .LinkedList ;
31
- import java .util .List ;
32
- import java .util .Set ;
29
+ import java .util .*;
33
30
import java .util .concurrent .TimeUnit ;
34
31
import java .util .function .BiFunction ;
35
32
import java .util .function .Consumer ;
@@ -453,6 +450,21 @@ public Builder addItems(MessageEmbed... embeds)
453
450
this .embeds .addAll (Arrays .asList (embeds ));
454
451
return this ;
455
452
}
453
+
454
+ /**
455
+ * Adds the collection of provided {@link net.dv8tion.jda.api.entities.MessageEmbed MessageEmbeds} to the list
456
+ * of items to paginate.
457
+ *
458
+ * @param embeds
459
+ * The collection of MessageEmbeds to add
460
+ *
461
+ * @return This builder
462
+ */
463
+ public Builder addItems (Collection <MessageEmbed > embeds )
464
+ {
465
+ this .embeds .addAll (embeds );
466
+ return this ;
467
+ }
456
468
457
469
/**
458
470
* Adds {@link net.dv8tion.jda.api.entities.MessageEmbed MessageEmbeds} to the list of items to paginate.
@@ -494,6 +506,22 @@ public Builder setItems(MessageEmbed... embeds)
494
506
return this ;
495
507
}
496
508
509
+ /**
510
+ * Sets the {@link net.dv8tion.jda.api.entities.MessageEmbed MessageEmbeds} to paginate.
511
+ * <br>This method clears all previously set items before adding the provided collection of MessageEmbeds.
512
+ *
513
+ * @param embeds
514
+ * The collection of MessageEmbeds to set.
515
+ *
516
+ * @return This builder
517
+ */
518
+ public Builder setItems (Collection <MessageEmbed > embeds )
519
+ {
520
+ this .embeds .clear ();
521
+ addItems (embeds );
522
+ return this ;
523
+ }
524
+
497
525
/**
498
526
* Sets the {@link net.dv8tion.jda.api.entities.MessageEmbed MessageEmbeds} to paginate.
499
527
* <br>This method clears all previously set items before setting each String as a new MessageEmbed.
You can’t perform that action at this time.
0 commit comments