Katrix / AckCord

A Discord library for Scala using Akka
https://ackcord.katsstuff.net/
MIT License
113 stars 15 forks source link

Autocomplete errors if the user doesn't enter anything #65

Closed Yomanz closed 2 years ago

Yomanz commented 2 years ago

When running the command:

image
ackcord.requests.HttpException: HttpMethod(POST) https://discord.com/api/v9/interactions/<<ID>>/<<TOKEN>>/callback: 400, Bad Request {"code": 50035, "errors": {"data": {"choices": {"0": {"name": {"_errors": [{"code": "BASE_TYPE_REQUIRED", "message": "This field is required"}]}}, "1": {"name": {"_errors": [{"code": "BASE_TYPE_REQUIRED", "message": "This field is required"}]}}, "2": {"name": {"_errors": [{"code": "BASE_TYPE_REQUIRED", "message": "This field is required"}]}}}}}, "message": "Invalid Form Body"}
    at ackcord.requests.RequestStreams$.$anonfun$requestParser$3(RequestStreams.scala:228)
    at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:467)
    at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:63)
    at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:100)
    at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
    at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:94)
    at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:100)
    at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:49)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:48)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175)

Adding an entry fixes it:

image