DiscordGatewayCloseReason

public enum DiscordGatewayCloseReason : Int

Represents the reason a gateway was closed.

  • We don’t quite know why the gateway closed.

    Declaration

    Swift

    case unknown = 0
  • The gateway closed because the network dropped.

    Declaration

    Swift

    case noNetwork = 50
  • The gateway closed from a normal WebSocket close event.

    Declaration

    Swift

    case normal = 1000
  • Something went wrong, but we aren’t quite sure either.

    Declaration

    Swift

    case unknownError = 4000
  • Discord got an opcode is doesn’t recognize.

    Declaration

    Swift

    case unknownOpcode = 4001
  • We sent a payload Discord doesn’t know what to do with.

    Declaration

    Swift

    case decodeError = 4002
  • We tried to send stuff before we were authenticated.

    Declaration

    Swift

    case notAuthenticated = 4003
  • We failed to authenticate with Discord.

    Declaration

    Swift

    case authenticationFailed = 4004
  • We tried to authenticate twice.

    Declaration

    Swift

    case alreadyAuthenticated = 4005
  • We sent a bad sequence number when trying to resume.

    Declaration

    Swift

    case invalidSequence = 4007
  • We sent messages too fast.

    Declaration

    Swift

    case rateLimited = 4008
  • Our session timed out.

    Declaration

    Swift

    case sessionTimeout = 4009
  • We sent an invalid shard when identifing.

    Declaration

    Swift

    case invalidShard = 4010
  • We sent a protocol Discord doesn’t recognize.

    Declaration

    Swift

    case unknownProtocol = 4012
  • We got disconnected.

    Declaration

    Swift

    case disconnected = 4014
  • The voice server crashed.

    Declaration

    Swift

    case voiceServerCrash = 4015
  • We sent an encryption mode Discord doesn’t know.

    Declaration

    Swift

    case unknownEncryptionMode = 4016