Files
zunda-bot/Sources/DiscordKit/Bot.swift

18 lines
395 B
Swift

import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
public struct Bot {
let client: ApiClient
public init(token: String) async throws {
client = ApiClient(token: token)
let gatewayURL = try await client.getGatewayURL()
let gateway = GatewayClient(gatewayURL: gatewayURL)
try await gateway.openConnection()
}
}