diff --git a/Sources/DiscordKit/GatewayClient.swift b/Sources/DiscordKit/GatewayClient.swift index 5588869..f1c378d 100644 --- a/Sources/DiscordKit/GatewayClient.swift +++ b/Sources/DiscordKit/GatewayClient.swift @@ -10,7 +10,10 @@ actor GatewayClient { var sequenceNum: Int? = nil init(gatewayURL: URL, token: String) { - ws = URLSession.shared.webSocketTask(with: gatewayURL.appending(component: "?v=10&encoding=json")) + print(gatewayURL.absoluteURL) + print(gatewayURL.appending(queryItems: [.init(name: "v", value: "10"), .init(name: "encoding", value: "json")])) + let queryItems = [URLQueryItem(name: "v", value: "10"), URLQueryItem(name: "encoding", value: "json")] + ws = URLSession.shared.webSocketTask(with: gatewayURL.appending(queryItems: queryItems)) self.token = token }