> For the complete documentation index, see [llms.txt](https://n-f9.gitbook.io/quack.js/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://n-f9.gitbook.io/quack.js/api/namespace/discord.md).

# Discord

QuackJSUtils.Discord

### Functions

#### CreateCategory

▸ `Const` **CreateCategory**(`guild`, `name`, `options`): `Promise`<`CategoryChannel`>

A function for creating category channels.

**Parameters**

| Name      | Type                        | Description                       |
| --------- | --------------------------- | --------------------------------- |
| `guild`   | `Guild`                     | The guild which will be modified. |
| `name`    | `string`                    | The name of the category.         |
| `options` | `GuildChannelCreateOptions` | The options for the category.     |

**Returns**

`Promise`<`CategoryChannel`>

The category channel.

**Defined in**

[src/modules/discord.ts:167](https://github.com/N-F9/quack.js/blob/08ab7ae/src/modules/discord.ts#L167)

***

#### CreateChannel

▸ `Const` **CreateChannel**(`guild`, `name`, `options`): `Promise`<`TextChannel`>

A function for creating a channel.

**Parameters**

| Name      | Type                        | Description                       |
| --------- | --------------------------- | --------------------------------- |
| `guild`   | `Guild`                     | The guild which will be modified. |
| `name`    | `string`                    | The name of the text channel.     |
| `options` | `GuildChannelCreateOptions` | The options for the text channel. |

**Returns**

`Promise`<`TextChannel`>

The text channel.

**Defined in**

[src/modules/discord.ts:140](https://github.com/N-F9/quack.js/blob/08ab7ae/src/modules/discord.ts#L140)

***

#### CreateRole

▸ `Const` **CreateRole**(`guild`, `options`): `void`

A function for creating roles.

**Parameters**

| Name      | Type                | Description                       |
| --------- | ------------------- | --------------------------------- |
| `guild`   | `Guild`             | The guild which will be modified. |
| `options` | `CreateRoleOptions` | The option for the new role.      |

**Returns**

`void`

**Defined in**

[src/modules/discord.ts:77](https://github.com/N-F9/quack.js/blob/08ab7ae/src/modules/discord.ts#L77)

***

#### DeleteCategory

▸ `Const` **DeleteCategory**(`guild`, `finder`): `void`

A function for deleting a category channel.

**Parameters**

| Name     | Type     | Description                                       |
| -------- | -------- | ------------------------------------------------- |
| `guild`  | `Guild`  | The guild which will be modified.                 |
| `finder` | `string` | The parameter which the function will search for. |

**Returns**

`void`

**Defined in**

[src/modules/discord.ts:180](https://github.com/N-F9/quack.js/blob/08ab7ae/src/modules/discord.ts#L180)

***

#### DeleteChannel

▸ `Const` **DeleteChannel**(`guild`, `finder`): `void`

A function for deleting a channel.

**Parameters**

| Name     | Type     | Description                                       |
| -------- | -------- | ------------------------------------------------- |
| `guild`  | `Guild`  | The guild which will be modified.                 |
| `finder` | `string` | The parameter which the function will search for. |

**Returns**

`void`

**Defined in**

[src/modules/discord.ts:153](https://github.com/N-F9/quack.js/blob/08ab7ae/src/modules/discord.ts#L153)

***

#### DeleteRole

▸ `Const` **DeleteRole**(`guild`, `finder`): `void`

A function for deleting roles.

**Parameters**

| Name     | Type     | Description                                       |
| -------- | -------- | ------------------------------------------------- |
| `guild`  | `Guild`  | The guild which will be modified.                 |
| `finder` | `string` | The parameter which the function will search for. |

**Returns**

`void`

**Defined in**

[src/modules/discord.ts:87](https://github.com/N-F9/quack.js/blob/08ab7ae/src/modules/discord.ts#L87)

***

#### Embed

▸ `Const` **Embed**(`message`, `placeholders?`): `MessageOptions`

A function for generating an embed with ease.

**Parameters**

| Name            | Type                      | Description                                            |
| --------------- | ------------------------- | ------------------------------------------------------ |
| `message`       | `QuackJSMessage`          | The message object to be generated from.               |
| `placeholders?` | `Record`<`string`, `any`> | The placerholders to be replaced within the `message`. |

**Returns**

`MessageOptions`

The formatted Discord Message Options.

**Defined in**

[src/modules/discord.ts:14](https://github.com/N-F9/quack.js/blob/08ab7ae/src/modules/discord.ts#L14)

***

#### GetChannel

▸ `Const` **GetChannel**(`guild`, `finder`): `undefined` | `ThreadChannel` | `GuildChannel`

A function for getting a channel.

**Parameters**

| Name     | Type                  | Description                                       |
| -------- | --------------------- | ------------------------------------------------- |
| `guild`  | `Guild`               | The guild which will be modified.                 |
| `finder` | `string` \| `Channel` | The parameter which the function will search for. |

**Returns**

`undefined` | `ThreadChannel` | `GuildChannel`

The channel.

**Defined in**

[src/modules/discord.ts:193](https://github.com/N-F9/quack.js/blob/08ab7ae/src/modules/discord.ts#L193)

***

#### GiveRole

▸ `Const` **GiveRole**(`guild`, `member`, `finder`): `Promise`<`GuildMember`>

A function for giving a user a role.

**Parameters**

| Name     | Type          | Description                              |
| -------- | ------------- | ---------------------------------------- |
| `guild`  | `Guild`       | The guild which will be modified.        |
| `member` | `GuildMember` | The member which will be given the role. |
| `finder` | `string`      | The parameter for finding roles.         |

**Returns**

`Promise`<`GuildMember`>

A boolean whether or not the user was given the role.

**Defined in**

[src/modules/discord.ts:112](https://github.com/N-F9/quack.js/blob/08ab7ae/src/modules/discord.ts#L112)

***

#### HasRole

▸ `Const` **HasRole**(`member`, `finder`): `boolean`

A function for checking if a user has a role.

**Parameters**

| Name     | Type          | Description                                       |
| -------- | ------------- | ------------------------------------------------- |
| `member` | `GuildMember` | The memeber which will be check.                  |
| `finder` | `string`      | The parameter which the function will search for. |

**Returns**

`boolean`

`true` if the user has the role and `false` if the user doesn't have the role.

**Defined in**

[src/modules/discord.ts:100](https://github.com/N-F9/quack.js/blob/08ab7ae/src/modules/discord.ts#L100)

***

#### MoveChannelToCategory

▸ `Const` **MoveChannelToCategory**(`guild`, `channel`, `category`): `void`

A function for moving a channel to a category.

**Parameters**

| Name       | Type                          | Description                                        |
| ---------- | ----------------------------- | -------------------------------------------------- |
| `guild`    | `Guild`                       | The guild which will be modified.                  |
| `channel`  | `string` \| `Channel`         | The channel to be moved to the `category`.         |
| `category` | `string` \| `CategoryChannel` | The category which the `channel` will be moved to. |

**Returns**

`void`

**Defined in**

[src/modules/discord.ts:207](https://github.com/N-F9/quack.js/blob/08ab7ae/src/modules/discord.ts#L207)

***

#### Prompt

▸ `Const` **Prompt**(`message`, `member`, `options`): `Promise`<`undefined` | `Message`<`boolean`> | `MessageReaction`>

A function for prompting the user for input; either from a message input or a reaction input.

**Parameters**

| Name      | Type                   | Description                    |
| --------- | ---------------------- | ------------------------------ |
| `message` | `Message`<`boolean`>   | The message object to be used. |
| `member`  | `GuildMember`          | The member to be prompted.     |
| `options` | `QuackJSPromptOptions` | The option of the prompt.      |

**Returns**

`Promise`<`undefined` | `Message`<`boolean`> | `MessageReaction`>

A promise which resolves the input the user gave.

**Defined in**

[src/modules/discord.ts:51](https://github.com/N-F9/quack.js/blob/08ab7ae/src/modules/discord.ts#L51)

***

#### RemoveRole

▸ `Const` **RemoveRole**(`guild`, `member`, `finder`): `Promise`<`GuildMember`>

A function for removing a role from a user.

**Parameters**

| Name     | Type          | Description                                     |
| -------- | ------------- | ----------------------------------------------- |
| `guild`  | `Guild`       | The guild which will be modified.               |
| `member` | `GuildMember` | The member which will be removed from the role. |
| `finder` | `string`      | The parameter for finding roles.                |

**Returns**

`Promise`<`GuildMember`>

A boolean whether or not the user was given the role.

**Defined in**

[src/modules/discord.ts:126](https://github.com/N-F9/quack.js/blob/08ab7ae/src/modules/discord.ts#L126)
