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


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


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


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


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


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


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


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


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


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


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


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


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

Last updated