DiscordKit: fix url encoded ? in gateway url

This commit is contained in:
2026-03-17 19:39:06 -04:00
parent 7506a06d7f
commit 52e22fb58c

View File

@@ -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
}