Skip to content

Commit d680ca5

Browse files
authored
Removed the automatic retry when discord closes the web socket (#118)
1 parent f078921 commit d680ca5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

gateway/src/main/java/com/javadiscord/jdi/internal/gateway/WebSocketHandler.java

+9-3
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ private void handleMessage(Buffer buffer) {
8282
}
8383

8484
private void handleClose(Void unused) {
85-
retryHandler.retry(
86-
() -> connectionMediator.getWebSocketManagerProxy().start(connectionMediator));
85+
LOGGER.warn(
86+
"The web socket connection to discord was closed. You will no longer receive"
87+
+ " gateway events.");
8788
}
8889

8990
void handleClose(int status, String reason) {
@@ -106,8 +107,13 @@ void handleClose(int status, String reason) {
106107
"Discord has updated their API, please use the latest updates on"
107108
+ " https://javadiscord.com/");
108109
break;
110+
case GatewayCloseEventCode.DISALLOWED_INTENTS:
111+
LOGGER.error(
112+
"You do not have all the required intents set on your bot. Visit"
113+
+ " https://discord.com/developers/applications/");
114+
break;
109115
default:
110-
LOGGER.error("[{}] {}", status, reason);
116+
LOGGER.error("Web socket close reason [{}] {}", status, reason);
111117
break;
112118
}
113119
}

0 commit comments

Comments
 (0)