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

JDA conversion of STRING to INTEGER issue. #471

Closed
SfenKer opened this issue Oct 30, 2024 · 1 comment · Fixed by #475
Closed

JDA conversion of STRING to INTEGER issue. #471

SfenKer opened this issue Oct 30, 2024 · 1 comment · Fixed by #475

Comments

@SfenKer
Copy link
Contributor

SfenKer commented Oct 30, 2024

JDA: 5.1.2
LiteCommands: 3.8.1-SNAPSHOT
Stacktrace:

[15:24:17] [ERROR] [net.dv8tion.jda.api.JDA             ]: One of the EventListeners had an uncaught exception
java.lang.IllegalArgumentException: Choice of type STRING cannot be converted to INTEGER
	at net.dv8tion.jda.internal.utils.Checks.check(Checks.java:79)
	at net.dv8tion.jda.internal.requests.restaction.interactions.AutoCompleteCallbackActionImpl.addChoices(AutoCompleteCallbackActionImpl.java:68)
	at net.dv8tion.jda.internal.interactions.command.CommandAutoCompleteInteractionImpl.replyChoices(CommandAutoCompleteInteractionImpl.java:96)
	at net.dv8tion.jda.api.events.interaction.command.CommandAutoCompleteInteractionEvent.replyChoices(CommandAutoCompleteInteractionEvent.java:120)
	at dev.rollczi.litecommands.jda.JDAPlatform$SlashCommandController.onCommandAutoCompleteInteraction(JDAPlatform.java:142)
	at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:455)
	at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:98)
	at net.dv8tion.jda.internal.hooks.EventManagerProxy.handleInternally(EventManagerProxy.java:88)
	at net.dv8tion.jda.internal.hooks.EventManagerProxy.handle(EventManagerProxy.java:70)
	at net.dv8tion.jda.internal.JDAImpl.handleEvent(JDAImpl.java:169)
	at net.dv8tion.jda.internal.handle.InteractionCreateHandler.handleInternally(InteractionCreateHandler.java:89)
	at net.dv8tion.jda.internal.handle.SocketHandler.handle(SocketHandler.java:39)
	at net.dv8tion.jda.internal.requests.WebSocketClient.onDispatch(WebSocketClient.java:1009)
	at net.dv8tion.jda.internal.requests.WebSocketClient.onEvent(WebSocketClient.java:892)
	at net.dv8tion.jda.internal.requests.WebSocketClient.handleEvent(WebSocketClient.java:870)
	at net.dv8tion.jda.internal.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:1048)
	at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:385)
	at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:276)
	at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:996)
	at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:755)
	at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108)
	at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64)
	at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)

How to do it?
Just provide empty input in Integer argument.
{876E5700-3DF0-4084-8DD8-0D6693396E42}

Cause?
Probably suggesting <port> schematic is issue.

@SfenKer
Copy link
Contributor Author

SfenKer commented Nov 1, 2024

If someone has same problem, i recommend to create custom argument suggester until this will be fixed.

.argumentSuggester(Integer.class, of("port"), new IntegerArgumentSuggester())

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

Successfully merging a pull request may close this issue.

1 participant