Skip to main content
Module

x/discord_rpc/mod.ts>Client

Discord RPC module for Deno.
Latest
class Client
import { Client } from "https://deno.land/x/discord_rpc@0.3.2/mod.ts";

Constructors

new
Client(options: ClientOptions)

Properties

optional
application: ApplicationPayload
readonly
authenticated
optional
config: ClientConfig
optional
ipc: DiscordIPC
optional
token: string
optional
tokenExpires: Date
optional
user: UserPayload
readonly
userTag

Methods

authenticate(token: string)

Authenticates with given access token. This is automatically called when using authorize().

Starts complete OAuth2 flow, using given client secret and scopes in ClientOptions.

Throws if they are not provided.

Clears the currently set activity, if any. This will hide the "Playing X" message displayed below the user's name.

closeActivityJoinRequest(userID: string)
closeActivityRequest(userID: string)
getChannel(channelID?: string)
getChannels(guildID?: string)
getGuild(guildID?: string)
selectTextChannel(channelID: string, timeout?)
selectVoiceChannel(
channelID: string,
force?,
timeout?,
)
sendActivityJoinInvite(userID: string)
setActivity(activity?: Activity)

Set Presence Activity

setVoiceSettings(settings: Partial<VoiceSettings>)
subscribe<T extends Record<string, unknown>>(event: keyof RPCEvent, args?: T)
unsubscribe<T extends Record<string, unknown>>(event: keyof RPCEvent, args?: T)
[Symbol.asyncIterator](): AsyncIterableIterator<ClientEvent>