Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Targeting specific commands with help command not working #384

Closed
PatchAlchemist opened this issue Apr 12, 2024 · 4 comments
Closed

Targeting specific commands with help command not working #384

PatchAlchemist opened this issue Apr 12, 2024 · 4 comments

Comments

@PatchAlchemist
Copy link

Anytime I try to use the help command on specific commands i get this embed:

Exception
IllegalArgumentException: URL must be a valid http(s) or attachment url.
CommandContext ID: xxxxxxxxxxxxxxxxxxx

If I do it to a command that doesnt exist though I still get this embed:

Error
No command found for 'h'

If you need help with a command you can use the help command. E.g. !help play

I believe the problem is here src/main/java/net/robinfriedli/aiode/command/commands/general/HelpCommand.java line 50

@robinfriedli
Copy link
Owner

Can you provide a stack trace? I can neither reproduce this nor see how line 50 is related to this exception

@PatchAlchemist
Copy link
Author

ERROR 2024-04-12 14:52:28,204 [command-execution-CommandContext@13bacb2b-f7cb-455c-a401-802cd64fa3cb] net.robinfriedli.aiode.exceptions.ExceptionUtils Exception while handling command !help play on guild The Cord of Bosses
net.robinfriedli.aiode.exceptions.CommandRuntimeException: java.lang.IllegalArgumentException: URL must be a valid http(s) or attachment url.
at net.robinfriedli.aiode.command.interceptor.interceptors.CommandExecutionInterceptor.performChained(CommandExecutionInterceptor.java:152)
at net.robinfriedli.aiode.command.interceptor.AbstractChainableCommandInterceptor.intercept(AbstractChainableCommandInterceptor.java:26)
at net.robinfriedli.aiode.command.interceptor.AbstractChainableCommandInterceptor.intercept(AbstractChainableCommandInterceptor.java:36)
at net.robinfriedli.aiode.command.interceptor.AbstractChainableCommandInterceptor.intercept(AbstractChainableCommandInterceptor.java:36)
at net.robinfriedli.aiode.command.interceptor.AbstractChainableCommandInterceptor.intercept(AbstractChainableCommandInterceptor.java:36)
at net.robinfriedli.aiode.command.interceptor.AbstractChainableCommandInterceptor.intercept(AbstractChainableCommandInterceptor.java:36)
at net.robinfriedli.aiode.command.interceptor.AbstractChainableCommandInterceptor.intercept(AbstractChainableCommandInterceptor.java:36)
at net.robinfriedli.aiode.command.interceptor.AbstractChainableCommandInterceptor.intercept(AbstractChainableCommandInterceptor.java:36)
at net.robinfriedli.aiode.command.interceptor.AbstractChainableCommandInterceptor.intercept(AbstractChainableCommandInterceptor.java:36)
at net.robinfriedli.aiode.command.interceptor.CommandInterceptorChain.intercept(CommandInterceptorChain.java:67)
at net.robinfriedli.aiode.command.CommandManager.doRunCommand(CommandManager.java:137)
at net.robinfriedli.aiode.concurrent.CommandExecutionTask.lambda$new$0(CommandExecutionTask.java:24)
at net.robinfriedli.aiode.concurrent.QueuedTask.run(QueuedTask.java:38)
at net.robinfriedli.aiode.concurrent.CommandExecutionTask.run(CommandExecutionTask.java:34)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.IllegalArgumentException: URL must be a valid http(s) or attachment url.
at net.dv8tion.jda.internal.utils.Checks.check(Checks.java:62)
at net.dv8tion.jda.api.EmbedBuilder.urlCheck(EmbedBuilder.java:908)
at net.dv8tion.jda.api.EmbedBuilder.setFooter(EmbedBuilder.java:799)
at net.robinfriedli.aiode.command.widget.AbstractPaginationWidget.prepareEmbedBuilderForPage(AbstractPaginationWidget.java:114)
at net.robinfriedli.aiode.command.widget.AbstractPaginationWidget.prepareInitialMessage(AbstractPaginationWidget.java:44)
at net.robinfriedli.aiode.command.widget.AbstractWidget.initialise(AbstractWidget.java:109)
at net.robinfriedli.aiode.command.commands.general.HelpCommand.lambda$showCommandHelp$1(HelpCommand.java:125)
at java.base/java.util.Optional.ifPresentOrElse(Optional.java:196)
at net.robinfriedli.aiode.command.commands.general.HelpCommand.showCommandHelp(HelpCommand.java:50)
at net.robinfriedli.aiode.command.commands.general.HelpCommand.doRun(HelpCommand.java:45)
at net.robinfriedli.aiode.command.interceptor.interceptors.CommandExecutionInterceptor.performChained(CommandExecutionInterceptor.java:61)
... 16 common frames omitted

I referenced line 50 because the help command seems to work until it tries to showCommandHelp() on line 50

@robinfriedli
Copy link
Owner

You need to looker higher up in the stack trace, line 50 is where it calls the lambda containing the entire help command logic. It gets up to here: at net.robinfriedli.aiode.command.commands.general.HelpCommand.lambda$showCommandHelp$1(HelpCommand.java:125) where it then fails at net.robinfriedli.aiode.command.widget.AbstractPaginationWidget.prepareEmbedBuilderForPage(AbstractPaginationWidget.java:114). This is because the logoUrl is invalid because your configuration for the property aiode.server.base_uri is wrong. Normally this is initially set to http://localhost:8000, which isn't reachable publicly of course (so there won't be a footer logo) but is a valid URL that doesn't cause an error.

@PatchAlchemist
Copy link
Author

You were correct I used the wrong syntax for my aiode.server.base_uri !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants