Skip to main content
Module

x/arcscord/mod.ts>Client

A Discord client written in typescript
Latest
class Client
extends EventEmitter<{ [key: string]: (...param: any) => void; ready: ready; rawWS: rawWS; connected: connected; error: error; }>
Re-export
import { Client } from "https://deno.land/x/arcscord@v0.3.0-beta/mod.ts";

Constructors

new
Client(token: string, options?: ClientOptions)

Properties

bot: boolean
readonly
optional
disableEvents: (keyof GatewayDispatchEvents)[]

list of events that the bot don't emit

fetchAllMembers: boolean
gateway: Gateway

bot gateway

intents: number

int number for intents

presence: Presence

bot current presence

requestHandler: RestManager
rest
readonly
slashCommand: boolean
token: string

the token of the bot

unavailableGuilds: Snowflake[]
optional
user: ClientUser

a user object of the bot

ws

Methods

Takes a list of application commands, overwriting existing commands that are registered globally for this application. Updates will be available in all guilds after 1 hour.

Takes a list of application commands, overwriting existing commands for the guild.

connect the bot to discord

Create a new global command. New global commands will be available in all guilds after 1 hour ⚠ Creating a command with the same name as an existing command for your application will overwrite the old command. see discord-api-docs

createDM(userId: Snowflake): Promise<PrivateChannel>

Create a new guild command. ⚠ Creating a command with the same name as an existing command for your application will overwrite the old command. see discord-api-docs

createMessage(
channelId: Snowflake,
content: string,
): Promise<Message>
deleteApplicationCommand(commandId: Snowflake): Promise<void>

delete a global application command

deleteGuildApplicationCommand(guildId: Snowflake, commandId: Snowflake): Promise<void>

delete a guild command

Edit a global command. Updates will be available in all guilds after 1 hour

Edit a guild command.

fetchApplicationCommand(
commandId: Snowflake,
checkCache?,
cache?,
): Promise<ApplicationCommand>

fetch a global application command with the command id

get all global bot applications commands

fetchGuild(
checkCache?: boolean,
setToCache?: boolean,
): Promise<Guild>
fetchGuildApplicationCommand(
guildId: Snowflake,
commandId: Snowflake,
checkCache?,
cache?,
): Promise<ApplicationCommand>

fetch a guild command with id

get all applications commands of a guild

fetchMembers(
guildId: Snowflake,
limit?: number,
setToCache?: boolean,
after?: number,
): Promise<Member[]>
toJSON(space?): string