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

x/higa/deno/client/Client.ts>Client

A package to interract with the Discord API coded by myself
Latest
class Client
import { Client } from "https://deno.land/x/higa@0.1.2/deno/client/Client.ts";

Constructors

new
Client(options: ClientOptions)

Properties

private
cache_: CacheManager

Application's cache

private
connection_closed: boolean
private
hearbeat_responded: boolean
private
heartbeat_interval: number
private
sequence_number: number | null
private
session_id: string
private
readonly
token: string

Application's token

private
readonly
tokenType: "Bearer" | "Bot" | ""

Token type

private
ws: WebSocket

Websocket to connect the application to the Discord Gateway

readonly
applicationCommand: ApplicationCommandManager

Application Command Manager to interact with the REST API

auditLog: AuditLogManager

Audit Log Manager to interact with the REST API

Channel Manager to interact with the REST API

Emoji Manager to interact with the REST API

Guild Manager to interact with the REST API

guildScheduledEvent: GuildScheduledEventManager

Guild Scheduled Event Manager to interact with the REST API

guildTemplate: GuildTemplateManager

Guild Template Manager to interact with the REST API

readonly
intents: number

Intents the application has activated

interaction: InteractionManager

Integration Manager to interact with the REST API

Invite Manager to interact with the REST API

stageInstance: StageInstanceManager

Stage Instance Manager to interact with the REST API

Sticker Manager to interact with the REST API

User Manager to interact with the REST API

readonly
version: APIVersions

API Version to use

Voice Manager to interact with the REST API

Webhook Manager to interact with the REST API

Methods

private
handleEvent<K extends keyof ClientEvents>(event: K, object: unknown)

When a Gateway event is received, emit it to the client

private
intentsToNumber(intents: (keyof ClientIntents)[])

Given a list of intents, return the number that represents them

It sets up the WebSocket connection and listens for messages from Discord

Interact with the Discord Gateway to add a Presence to the Bot User