> For the complete documentation index, see [llms.txt](https://lxrnz.gitbook.io/discord-debug/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lxrnz.gitbook.io/discord-debug/classes/debugger.md).

# Debugger

## <mark style="color:blue;">Constructor</mark>

```typescript
new Debugger(client, options);
```

| PARAMETER | TYPE                                                                    | DESCRIPTION                | OPTIONAL |
| --------- | ----------------------------------------------------------------------- | -------------------------- | -------- |
| `client`  | [Client](https://old.discordjs.dev/#/docs/discord.js/main/class/Client) | discord.js Client instance | ❌        |
| `options` | [Options](/discord-debug/interfaces/options.md)                         | Debugger options           | ✅        |

## <mark style="color:blue;">Properties</mark>

### `.owners`

Array of owner IDs\
**Type**: [Snowflake](https://old.discordjs.dev/#/docs/discord.js/main/typedef/Snowflake)\[]

### `.client`

discord.js Client instance\
**Type**: [Client](https://old.discordjs.dev/#/docs/discord.js/main/class/Client)

### `.options`

Debugger Options\
**Type**: [?Options](/discord-debug/interfaces/options.md)

## <mark style="color:blue;">Methods</mark>

### .messageRun(`message`, `args?`)

Runs the debugger instance for message commands

| PARAMETER | TYPE                                                                                                 | DETAILS                             | OPTIONAL |
| --------- | ---------------------------------------------------------------------------------------------------- | ----------------------------------- | -------- |
| `message` | [Message](https://old.discordjs.dev/#/docs/discord.js/main/class/Message)                            | discord.js Message instance         | ❌        |
| `args`    | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)\[] | Message args, including sub command | ✅        |

**Returns**: [Promise](broken://spaces/iU5KWxOmgXDGCc70aX9C/pages/KJ91I447F6jljIC3gPsw)<[Message](https://old.discordjs.dev/#/docs/discord.js/main/class/Message)>

**Examples**:

```typescript
if (message.content.startsWith('!debug')) {
    args = message.content.split(' ').slice(1);
    await Debugger.messageRun(message, args);
}
```

### .addOwner(`id`)

{% hint style="info" %}
Recommended: **`!debug owners add <id>`**
{% endhint %}

Add a `userId` to the owners array

| PARAMETER | TYPE                                                                            | DETAILS | OPTIONAL |
| --------- | ------------------------------------------------------------------------------- | ------- | -------- |
| `id`      | [Snowflake](https://old.discordjs.dev/#/docs/discord.js/main/typedef/Snowflake) | User ID | ❌        |

**Returns**: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)\[]

**Examples**:

```typescript
const owners = Debugger.addOwner('923925375657082931');
console.log(`Owners: ${owners}`);
```

### .removeOwner(`id`)

{% hint style="info" %}
Recommended: **`!debug owners remove <id>`**
{% endhint %}

Remove a `userId` from the owners array

| PARAMETER | TYPE                                                                            | DETAILS | OPTIONAL |
| --------- | ------------------------------------------------------------------------------- | ------- | -------- |
| `id`      | [Snowflake](https://old.discordjs.dev/#/docs/discord.js/main/typedef/Snowflake) | User ID | ❌        |

**Returns**: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)\[]

**Examples**:

```typescript
const owners = Debugger.removeOwner('923925375657082931');
console.log(`Owners: ${owners}`);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://lxrnz.gitbook.io/discord-debug/classes/debugger.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.
