megoRU / HangmanDiscordBot

Discord hangman bot
GNU General Public License v3.0
3 stars 0 forks source link

Cannot perform action due to a lack of Permission. Missing permission: VIEW_CHANNEL #260

Closed megoRU closed 3 months ago

megoRU commented 1 year ago
2023-05-07T07:00:11.152Z ERROR 1 --- [inWS-ReadThread] net.dv8tion.jda.api.JDA                  : One of the EventListeners had an uncaught exception

net.dv8tion.jda.api.exceptions.InsufficientPermissionException: Cannot perform action due to a lack of Permission. Missing permission: VIEW_CHANNEL
        at net.dv8tion.jda.internal.entities.channel.mixin.middleman.GuildChannelMixin.checkPermission(GuildChannelMixin.java:64) ~[JDA-5.0.0-beta.8.jar!/:5.0.0-beta.8]
        at net.dv8tion.jda.internal.entities.channel.mixin.middleman.GuildChannelMixin.checkPermission(GuildChannelMixin.java:56) ~[JDA-5.0.0-beta.8.jar!/:5.0.0-beta.8]
        at net.dv8tion.jda.internal.entities.channel.mixin.middleman.GuildMessageChannelMixin.checkCanAccessChannel(GuildMessageChannelMixin.java:121) ~[JDA-5.0.0-beta.8.jar!/:5.0.0-beta.8]
        at net.dv8tion.jda.internal.entities.channel.mixin.middleman.MessageChannelMixin.sendTyping(MessageChannelMixin.java:253) ~[JDA-5.0.0-beta.8.jar!/:5.0.0-beta.8]
        at main.core.events.HangmanButton.hangman(HangmanButton.java:40) ~[classes!/:0.0.1-SNAPSHOT]
        at main.controller.UpdateController.buttonEvent(UpdateController.java:117) ~[classes!/:0.0.1-SNAPSHOT]
        at main.controller.UpdateController.distributeEventsByType(UpdateController.java:77) ~[classes!/:0.0.1-SNAPSHOT]
        at main.controller.UpdateController.processEvent(UpdateController.java:64) ~[classes!/:0.0.1-SNAPSHOT]
        at main.core.CoreBot.onButtonInteraction(CoreBot.java:48) ~[classes!/:0.0.1-SNAPSHOT]
        at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:427) ~[JDA-5.0.0-beta.8.jar!/:5.0.0-beta.8]
        at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:96) ~[JDA-5.0.0-beta.8.jar!/:5.0.0-beta.8]
        at net.dv8tion.jda.internal.hooks.EventManagerProxy.handleInternally(EventManagerProxy.java:88) ~[JDA-5.0.0-beta.8.jar!/:5.0.0-beta.8]
        at net.dv8tion.jda.internal.hooks.EventManagerProxy.handle(EventManagerProxy.java:70) ~[JDA-5.0.0-beta.8.jar!/:5.0.0-beta.8]
        at net.dv8tion.jda.internal.JDAImpl.handleEvent(JDAImpl.java:176) ~[JDA-5.0.0-beta.8.jar!/:5.0.0-beta.8]
        at net.dv8tion.jda.internal.handle.InteractionCreateHandler.handleAction(InteractionCreateHandler.java:148) ~[JDA-5.0.0-beta.8.jar!/:5.0.0-beta.8]
        at net.dv8tion.jda.internal.handle.InteractionCreateHandler.handleInternally(InteractionCreateHandler.java:100) ~[JDA-5.0.0-beta.8.jar!/:5.0.0-beta.8]
        at net.dv8tion.jda.internal.handle.SocketHandler.handle(SocketHandler.java:39) ~[JDA-5.0.0-beta.8.jar!/:5.0.0-beta.8]
        at net.dv8tion.jda.internal.requests.WebSocketClient.onDispatch(WebSocketClient.java:985) ~[JDA-5.0.0-beta.8.jar!/:5.0.0-beta.8]
        at net.dv8tion.jda.internal.requests.WebSocketClient.onEvent(WebSocketClient.java:871) ~[JDA-5.0.0-beta.8.jar!/:5.0.0-beta.8]
        at net.dv8tion.jda.internal.requests.WebSocketClient.handleEvent(WebSocketClient.java:849) ~[JDA-5.0.0-beta.8.jar!/:5.0.0-beta.8]
        at net.dv8tion.jda.internal.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:1024) ~[JDA-5.0.0-beta.8.jar!/:5.0.0-beta.8]
        at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:385) ~[nv-websocket-client-2.14.jar!/:na]
        at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:276) ~[nv-websocket-client-2.14.jar!/:na]
        at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:996) ~[nv-websocket-client-2.14.jar!/:na]
        at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:755) ~[nv-websocket-client-2.14.jar!/:na]
        at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108) ~[nv-websocket-client-2.14.jar!/:na]
        at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64) ~[nv-websocket-client-2.14.jar!/:na]
        at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45) ~[nv-websocket-client-2.14.jar!/:na]

2023-05-07T07:00:44.095Z ERROR 1 --- [inWS-ReadThread] net.dv8tion.jda.api.JDA                  : One of the EventListeners had an uncaught exception
megoRU commented 1 year ago

Вообще проверка должна быть