Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/harmony/src/gateway/mod.ts>Gateway

An easy to use Discord API Library for Deno.
Go to Latest
import { Gateway } from "https://deno.land/x/harmony@v2.6.0/src/gateway/mod.ts";

Handles Discord Gateway connection.

You should not use this and rather use Client class.

Constructors

new
Gateway(client: Client, shards?: number[])

Properties

private
heartbeatServerResponded: boolean
optional
_guildLoadTimeout: number
optional
_guildsLoaded: number
optional
_guildsToBeLoaded: number
_readyReceived: Promise<void>
optional
_resolveReadyReceived: () => void
client: Client
connected: boolean
readonly
destroyed: boolean
heartbeatInterval: number
optional
heartbeatIntervalID: number
initialized: boolean
lastPingTimestamp: number
ping: number
optional
sequenceID: number
optional
sessionID: string
readonly
shardID: number
optional
shards: number[]
optional
websocket: WebSocket

Methods

private
enqueueIdentify(forceNew?: boolean): void
private
onclose(unnamed 0: CloseEvent): Promise<void>
private
onerror(event: ErrorEvent): Promise<void>
private
onmessage(event: MessageEvent): Promise<void>
private
onopen(): void
private
sendIdentify(forceNewSession?: boolean): Promise<void>
private
sendResume(): Promise<void>
_checkGuildsLoaded(timeout?): void
closeGateway(code?: number, reason?: string): void
debug(msg: string): void
destroy(): void
heartbeat(): void
reconnect(forceNew?: boolean): Promise<void>
requestMembers(guild: string, options?: RequestMembersOptions): string
send(data: GatewayResponse): boolean
updateVoiceState(
guild: Guild | string,
channel?: VoiceChannel | string,
voiceOptions?: VoiceStateOptions,
): void