remove DiscordBM dependency
This commit is contained in:
@@ -23,6 +23,8 @@ public enum GatewayPayload: Decodable {
|
||||
public struct GatewayMessage: Decodable {
|
||||
let op: Int
|
||||
let d: GatewayPayload?
|
||||
let s: Int?
|
||||
let t: String?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case t
|
||||
@@ -34,6 +36,8 @@ public struct GatewayMessage: Decodable {
|
||||
public init(from decoder: Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
||||
op = try container.decode(Int.self, forKey: .op)
|
||||
s = try container.decode(Int?.self, forKey: .s)
|
||||
t = try container.decode(String?.self, forKey: .t)
|
||||
switch op {
|
||||
case 10:
|
||||
let hello = try container.decode(HelloPayload.self, forKey: .d)
|
||||
|
||||
Reference in New Issue
Block a user