# SlashGuild

### Constructor

```javascript
new SlashGuild(guildID, handler);
```

| Parameter | Type                                                                               | Required | Default | Description                           |
| --------- | ---------------------------------------------------------------------------------- | -------- | ------- | ------------------------------------- |
| guildID   | string                                                                             | true     | none    | The guild this object is attached to. |
| handler   | [SlashCommandHandler](/slashdiscord-js/documentation/class-slashcommandhandler.md) | true     | none    | The handler this command uses         |

### Properties

id

> The ID of this command.\
> **Type**: string

handler

> The handler used.\
> **Type**: [SlashCommandHandler](/slashdiscord-js/documentation/class-slashcommandhandler.md)

### Methods

addCommand(command: [ApplicationCommand](/slashdiscord-js/documentation/slashcommand/applicationcommand.md))

> Add a command to this guild.\
> **Returns**: [SlashCommand](/slashdiscord-js/documentation/slashcommand.md)

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](/slashdiscord-js/documentation/slashcommand.md) | 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](/slashdiscord-js/documentation/slashcommand.md) | undefined


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jeroenoboy.gitbook.io/slashdiscord-js/documentation/slashguild.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
