kiranshila / Doplarr

An *arr request bot for Discord
MIT License
437 stars 31 forks source link

Slash commands greyed out #21

Closed MrStarktastic closed 3 years ago

MrStarktastic commented 3 years ago

I followed the short guide and ended up with the slash commands greyed out whenever I tried to type them. Also when setting up the OAuth2 url I had to choose permissions (I chose admin to rule this out as a reason for not working), otherwise the bot would appear offline. The rest of the environment variables were set properly. Any idea why this happens?

kiranshila commented 3 years ago

The slash commands as greyed out means something is up with the role. Are you sure you assigned yourself the role that allows you to use the commands?

For the permissions - you shouldn't have needed to select any permissions (that's kinda the whole point of the slash command interface). I'll look into it though. I'm finishing up a refactor that will make errors in the code easier to spot.

MrStarktastic commented 3 years ago

Thanks for the quick response. I assumed that there was nothing wrong with my user because I was the owner of the channel with no need for a role. Apparently I had to add a role for myself with the permission to use slash commands and use that role as the "target" of the bot.

Now the commands are not greyed out, thanks! But then the bot is stuck "thinking" after the request is sent. These are the logs I'm getting from the container:

03:22:16,182 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]

03:22:16,182 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]

03:22:16,182 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/app/target/Doplarr.jar!/logback.xml]

03:22:16,188 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@7a606260 - URL [jar:file:/app/target/Doplarr.jar!/logback.xml] is not of type file

03:22:16,250 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set

03:22:16,251 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]

03:22:16,254 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CONSOLE]

03:22:16,302 |-WARN in ch.qos.logback.core.ConsoleAppender[CONSOLE] - This appender no longer admits a layout as a sub-component, set an encoder instead.

03:22:16,302 |-WARN in ch.qos.logback.core.ConsoleAppender[CONSOLE] - To ensure compatibility, wrapping your layout in LayoutWrappingEncoder.

03:22:16,302 |-WARN in ch.qos.logback.core.ConsoleAppender[CONSOLE] - See also http://logback.qos.ch/codes.html#layoutInsteadOfEncoder for details

03:22:16,303 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to ERROR

03:22:16,303 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [CONSOLE] to Logger[ROOT]

03:22:16,303 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.

03:22:16,304 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@5dbab232 - Registering current configuration as safe fallback point

03:22:40.413 [ForkJoinPool.commonPool-worker-3] ERROR doplarr.arr-utils -


l

java.util.concurrent.CompletionException: java.io.EOFException

    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)

    at java.base/java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)

    at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)

    at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)

    at java.base/java.util.concurrent.CompletableFuture.postFire(Unknown Source)

    at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(Unknown Source)

    at java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)

    at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)

    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)

    at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)

    at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)

    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)

Caused by: java.io.EOFException: null

    at java.base/java.util.zip.GZIPInputStream.readUByte(Unknown Source)

    at java.base/java.util.zip.GZIPInputStream.readUShort(Unknown Source)

    at java.base/java.util.zip.GZIPInputStream.readHeader(Unknown Source)

    at java.base/java.util.zip.GZIPInputStream.<init>(Unknown Source)

    at java.base/java.util.zip.GZIPInputStream.<init>(Unknown Source)

    at hato.middleware$gunzip.invokeStatic(middleware.clj:578)

    at hato.middleware$gunzip.invoke(middleware.clj:574)

    at clojure.core$update.invokeStatic(core.clj:6208)

    at clojure.core$update.invoke(core.clj:6200)

    at hato.middleware$fn__11750.invokeStatic(middleware.clj:609)

    at hato.middleware$fn__11750.invoke(middleware.clj:607)

    at clojure.lang.MultiFn.invoke(MultiFn.java:229)

    at hato.middleware$decompression_response.invokeStatic(middleware.clj:629)

    at hato.middleware$decompression_response.invoke(middleware.clj:625)

    at hato.middleware$wrap_decompression$fn__11762$fn__11763.invoke(middleware.clj:641)

    at hato.middleware$wrap_request_timing$fn__11734$fn__11735.invoke(middleware.clj:571)

    at hato.client$request_STAR_$reify__11869.apply(client.clj:308)

    ... 10 common frames omitted
kiranshila commented 3 years ago

Apparently I had to add a role for myself with the permission to use slash commands and use that role as the "target" of the bot.

Yes exactly. I'm sorry that wasn't clear. The discord api for permissions on slash commands is really messed up - gating it to roles is mutually exclusive to allowing everyone to use the commands. Every user that interacts with the bot must have the role you define for that interaction.

Those errors certainly look like exceptions with the HTTP client. Do you mind sharing your setup? Are you on windows? Is this is docker? Etc.

kiranshila commented 3 years ago

As I said - a lot of those errors (esp. with the HTTP client) are going to be more fleshed out with more helpful feedback in the upcoming release.

MrStarktastic commented 3 years ago

I feel so embarrassed! I forgot that I had Sonarr & Radarr configured with a base URL! Changed the URLs in ENV from http://sonarr:8989 to http://sonarr:8989/sonarr (same with radarr). Works beautifully now! Thank you! Keep up the good work! (I love that I can choose quality profile btw)

kiranshila commented 3 years ago

Ah perfect! Yeah this next update would have made that error more clear. Glad you could figure it out, cheers!