- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 102
Closed
Labels
bugSomething isn't workingSomething isn't workingenhance commandModify or improve an existing command or group of commands of the botModify or improve an existing command or group of commands of the botgood first issueGood for newcomersGood for newcomerspriority: normal
Milestone
Description
Overview
When using /audit on a user who has more than 10 reported cases, the command crashes with an exception:
Cannot have more than 10 embeds in a message!
8:02:04.098 [pool-2-thread-4] ERROR net.dv8tion.jda.api.requests.RestAction - RestAction queue returned failure
java.lang.IllegalArgumentException: Cannot have more than 10 embeds in a message!
	at net.dv8tion.jda.internal.utils.Checks.check(Checks.java:48) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.internal.requests.restaction.WebhookMessageActionImpl.addEmbeds(WebhookMessageActionImpl.java:138) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.internal.entities.AbstractWebhookClient.sendMessageEmbeds(AbstractWebhookClient.java:67) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.internal.entities.AbstractWebhookClient.sendMessageEmbeds(AbstractWebhookClient.java:40) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at org.togetherjava.tjbot.commands.moderation.AuditCommand.lambda$auditUser$5(AuditCommand.java:159) ~[main/:?]
	at net.dv8tion.jda.internal.requests.restaction.operator.FlatMapRestAction.supply(FlatMapRestAction.java:44) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.internal.requests.restaction.operator.FlatMapRestAction.lambda$queue$0(FlatMapRestAction.java:54) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.internal.requests.restaction.operator.RestActionOperator.doSuccess(RestActionOperator.java:44) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.internal.requests.restaction.operator.MapRestAction.lambda$queue$0(MapRestAction.java:41) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.internal.requests.restaction.operator.RestActionOperator.doSuccess(RestActionOperator.java:44) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.internal.requests.restaction.operator.MapRestAction.lambda$queue$0(MapRestAction.java:41) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.internal.requests.restaction.operator.RestActionOperator.doSuccess(RestActionOperator.java:44) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.internal.requests.restaction.operator.CombineRestAction.lambda$queue$6(CombineRestAction.java:136) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.api.utils.MiscUtil.locked(MiscUtil.java:146) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.internal.requests.restaction.operator.CombineRestAction.lambda$queue$7(CombineRestAction.java:129) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.internal.requests.restaction.operator.RestActionOperator.doSuccess(RestActionOperator.java:44) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.internal.requests.restaction.operator.MapRestAction.lambda$queue$0(MapRestAction.java:41) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.internal.requests.DeferredRestAction.queue(DeferredRestAction.java:138) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.internal.requests.restaction.operator.MapRestAction.queue(MapRestAction.java:41) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.internal.requests.restaction.operator.CombineRestAction.queue(CombineRestAction.java:129) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.internal.requests.restaction.operator.MapRestAction.queue(MapRestAction.java:41) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.internal.requests.restaction.operator.MapRestAction.queue(MapRestAction.java:41) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.internal.requests.restaction.operator.FlatMapRestAction.queue(FlatMapRestAction.java:51) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.api.requests.RestAction.queue(RestAction.java:573) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.api.requests.RestAction.queue(RestAction.java:539) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at org.togetherjava.tjbot.commands.moderation.AuditCommand.auditUser(AuditCommand.java:160) ~[main/:?]
	at org.togetherjava.tjbot.commands.moderation.AuditCommand.onSlashCommand(AuditCommand.java:126) ~[main/:?]
	at org.togetherjava.tjbot.commands.system.CommandSystem.lambda$onSlashCommand$7(CommandSystem.java:121) ~[main/:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
	at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: net.dv8tion.jda.api.exceptions.ContextException
	at net.dv8tion.jda.api.exceptions.ContextException.here(ContextException.java:54) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.internal.requests.restaction.operator.RestActionOperator.contextWrap(RestActionOperator.java:105) ~[JDA-4.4.0_351.jar:4.4.0_351]
	at net.dv8tion.jda.internal.requests.restaction.operator.FlatMapRestAction.queue(FlatMapRestAction.java:50) ~[JDA-4.4.0_351.jar:4.4.0_351]
	... 8 morePossible solutions
The cause is quite clear, it attempts to display all cases and then fails cause there are too many. Obviously, this case is not supposed to be triggered really often and its not thaaat big of a deal but we should find at least a solution.
Dyno has pagination support to solve this, so there is an optional option on the command to show page 2, page 3, ... Would probably be a clean solution to do it that way ourselves as well.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhance commandModify or improve an existing command or group of commands of the botModify or improve an existing command or group of commands of the botgood first issueGood for newcomersGood for newcomerspriority: normal