Skip to main content
Module

x/commandis/deps.ts>Client

Official framework for Corddis lib ( for Deno only )
Latest
class Client
Re-export
import { Client } from "https://deno.land/x/commandis@v0.6.5/deps.ts";

Client which communicates with gateway and manages REST API communication.

Constructors

new
Client(token?: string, ...intents: number[])

Properties

_heartbeatTime
cache: CacheType
collectors: Collector<any>[]
collectors_id: number
events
gatewayData: GetGatewayType | undefined
readonly
guilds: GuildManager
intents: number[]
lastReq: number
mobile: boolean
ready: boolean
sequenceNumber: number | null
shards: Gateway[]
shardsCount: number
sleep: (t: number) => unknown
status: StatusType
token: string
user: User | null
readonly
users: UserManager

Methods

_fetch<T>(
method: string,
path: string,
body?: string | FormData | null,
json?,
contentType?: string | boolean,
headers?: DictionaryType,
): Promise<T>
_performReq(path: string, req: RequestInit): Promise<Response>
addIntents(...intent: number[]): Client

Adds intents to client

deleteInvite(id: string | Invite): Promise<InviteType>

Deletes a invite

fetchInvite(id: string): Promise<Invite>

Fetches invite with a certain id

Fetches slash commands.

game(name: string): Promise<StatusType>

Sets game status to all shards.

login(token?: string): Promise<boolean>

Logins with a certain token

me(): Promise<Me>

Gets current user as Me class

registerCollector<T>(collector: Collector<T>): Collector<T>

Overwrites a bunch of slash commands.

Registers a slash command.

removeCollector(id: number, done?)
setCache(key: CacheEnum, value: number)

Sets selected cache capacity to specifed value. 0 is infinity, -1 and less disables cache entirely. Note: when changing capacity cache is cleared

setShards(shards: number)

Sets number of shards to spawn.

setStatus(status: StatusType): Promise<StatusType>

Sets custom presence to all shards.

Unregisters a slash command.