SlashGuild

This object contains all commands of a guild.

Constructor

new SlashGuild(guildID, handler);

Parameter

Type

Required

Default

Description

guildID

string

true

none

The guild this object is attached to.

handler

true

none

The handler this command uses

Properties

id

The ID of this command. Type: string

handler

The handler used. Type: SlashCommandHandler

Methods

addCommand(command: ApplicationCommand)

Add a command to this guild. Returns: SlashCommand

async load()

Load the commands. Returns: void

hasName(name: string)

Check if this guild contains a command by name. Returns: boolean

getName(name: string)

Get a command from this guild by name. Returns: SlashCommand | undefined

hasID(id: string)

Check if this guild contains a command by id. Returns: boolean

getID(id: string)

Get a command from this guild by id. Returns: SlashCommand | undefined

Last updated

Was this helpful?