sh0ckR6 / role-colors

Discord Bot for adding custom role colors
MIT License
0 stars 0 forks source link

[BUG] - Error when using an old interactable after restarting the bot #5

Open sh0ckR6 opened 3 years ago

sh0ckR6 commented 3 years ago

Bug Report

Checklist:

*not required, but it would help!

Steps to reproduce

  1. Run a command that produces interactables as a response
  2. Restart the bot
  3. Use the interactables produced by the command ran before the restart

Expected behavior The interactables will still work


Actual behavior An error is thrown and the interactables do not work


Stacktrace

com.github.sh0ckr6.commands.MissingInteractionMessageException: This command is missing an interaction reply Message! (Maybe you forgot to set replyMessage when replying?)
    at com.github.sh0ckr6.commands.Command.onSelectionMenu(Command.kt:169)
    at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:481)
    at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:96)
    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:160)
    at net.dv8tion.jda.internal.handle.InteractionCreateHandler.handleAction(InteractionCreateHandler.java:90)
    at net.dv8tion.jda.internal.handle.InteractionCreateHandler.handleInternally(InteractionCreateHandler.java:62)
    at net.dv8tion.jda.internal.handle.SocketHandler.handle(SocketHandler.java:36)
    at net.dv8tion.jda.internal.requests.WebSocketClient.onDispatch(WebSocketClient.java:952)
    at net.dv8tion.jda.internal.requests.WebSocketClient.onEvent(WebSocketClient.java:839)
    at net.dv8tion.jda.internal.requests.WebSocketClient.handleEvent(WebSocketClient.java:817)
    at net.dv8tion.jda.internal.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:990)
    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)
sh0ckR6 commented 3 years ago

Like #4, I've already looked at this before making the issue. I'm just making it so that I don't forget to fix it.

Cause

replyMessage is null after restarting the bot and not running a command. This is related to #4, and it will probably be fixed before this is worked on.

Potential fix

sh0ckR6 commented 3 years ago

Honestly both this and #4 might even be fixable in the same PR, I'll play around with it and see what I come up with