cerus / jda-slash-commands

Slash commands (and message components) for JDA
GNU General Public License v3.0
15 stars 3 forks source link

after modifying the values on the provided sample, it stops working. #4

Closed VingGit closed 3 years ago

VingGit commented 3 years ago

First i tried to make my own slashcommands, but after restarting the bot, none of the slashcommands had updated. It still remembered the old structure and values given into it in the description.

I then returned it back to normal, but this time i only changed the strings. Still no update on the behavior/appearance of the test commands.

i coudln't get the formatting to work so here's the pastebin to the code: https://pastebin.com/W2BEteMP

and i got the following error message(it probably won't help you much but here's my source code https://github.com/VingGit/UnicaBot/blob/master/src/main/java/Botti/Botti.java):

27.04 16:11:34 [Bot] [JDA MainWS-ReadThread] INFO net.dv8tion.jda.internal.requests.WebSocketClient - Connected to WebSocket 27.04 16:11:35 [Bot] [JDA MainWS-ReadThread] INFO net.dv8tion.jda.api.JDA - Finished Loading! 27.04 16:12:12 [Bot] [JDA MainWS-ReadThread] ERROR net.dv8tion.jda.api.JDA - One of the EventListeners had an uncaught exception 27.04 16:12:12 [Bot] java.lang.NullPointerException 27.04 16:12:12 [Bot] at de.cerus.jdasc.JDASlashCommands.handleInteraction(JDASlashCommands.java:411) 27.04 16:12:12 [Bot] at de.cerus.jdasc.listener.InteractionListener.onGenericEvent(InteractionListener.java:65) 27.04 16:12:12 [Bot] at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:392) 27.04 16:12:12 [Bot] at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:96) 27.04 16:12:12 [Bot] at de.cerus.jdasc.listener.InteractionListener.onRawGateway(InteractionListener.java:53) 27.04 16:12:12 [Bot] at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) 27.04 16:12:12 [Bot] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 27.04 16:12:12 [Bot] at java.base/java.lang.reflect.Method.invoke(Unknown Source) 27.04 16:12:12 [Bot] at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:410) 27.04 16:12:12 [Bot] at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:96) 27.04 16:12:12 [Bot] at net.dv8tion.jda.internal.hooks.EventManagerProxy.handleInternally(EventManagerProxy.java:88) 27.04 16:12:12 [Bot] at net.dv8tion.jda.internal.hooks.EventManagerProxy.handle(EventManagerProxy.java:70) 27.04 16:12:12 [Bot] at net.dv8tion.jda.internal.JDAImpl.handleEvent(JDAImpl.java:149) 27.04 16:12:12 [Bot] at net.dv8tion.jda.internal.requests.WebSocketClient.onDispatch(WebSocketClient.java:958) 27.04 16:12:12 [Bot] at net.dv8tion.jda.internal.requests.WebSocketClient.onEvent(WebSocketClient.java:839) 27.04 16:12:12 [Bot] at net.dv8tion.jda.internal.requests.WebSocketClient.handleEvent(WebSocketClient.java:817) 27.04 16:12:12 [Bot] at net.dv8tion.jda.internal.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:990) 27.04 16:12:12 [Bot] at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:385) 27.04 16:12:12 [Bot] at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:276) 27.04 16:12:12 [Bot] at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:996) 27.04 16:12:12 [Bot] at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:755) 27.04 16:12:12 [Bot] at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108) 27.04 16:12:12 [Bot] at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64) 27.04 16:12:12 [Bot] at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)

VingGit commented 3 years ago

poista2 poista

i commented out everything related to slashcommands, but discord still remembers those pieces of code even tho they don't exist there.

cerus commented 3 years ago

Excerpt from the Discord developer documentation:

Global commands are cached for 1 hour. That means that new global commands will fan out slowly across all guilds, and will be guaranteed to be updated in an hour.

I'll get back to you about the exception, I'm currently busy.

cerus commented 3 years ago

Alright, I had a quick look and it looks like you didn't register a command listener. Edit: I'm wrong, Discord notified your bot about a command that you didn't register (because you changed the values) so it wasn't able to process the command.

Try registering a guild specific command (because they update instantly I think) and let me know if you encounter any problems.

VingGit commented 3 years ago

i got it to work, thanks to you. But now we got another one.

https://pastebin.com/1YnwEkWT

27.04 20:25:29 [Bot] java.lang.IllegalStateException: Invalid option name 27.04 20:25:29 [Bot] at de.cerus.jdasc.command.ApplicationCommandOption.validate(ApplicationCommandOption.java:61) 27.04 20:25:29 [Bot] at de.cerus.jdasc.command.ApplicationCommandOption.(ApplicationCommandOption.java:56) 27.04 20:25:29 [Bot] at de.cerus.jdasc.command.CommandBuilder$SubCommandGroupBuilder.build(CommandBuilder.java:73) 27.04 20:25:29 [Bot] at Botti.Botti.initCommands(Botti.java:101) 27.04 20:25:29 [Bot] at Botti.Botti.launchBot(Botti.java:67)

is it because of the ä and ö letters?

VingGit commented 3 years ago

nah, it wasn't the umlauts.

cerus commented 3 years ago

Spaces are not allowed