Guild

Guild

new Guild()

Source:
Properties:
Name Type Attributes Description
afkChannel GuildChannel <nullable>

Represents the afk Channel

afkChannelID Snowflake <nullable>

The id of the afk channel

available Boolean

Whether the guild is available or not

channel Store.<GuildChannel>

A Store of the Channels in the Guild

createdTimestamp Number

The timestamp in ms when the guild was created

defaultMessageNotificaions Number

The default message notification for the Guild

emojis Store.<Emoji>

A Store of Guild Emojis

features Array

An array of guild features

icon String <nullable>

The icon hash of the guild

iconURL String <nullable>

The url of the guild's icon

id Snowflake

The id of the guild

large Boolean

Whether the guild is large or not, depends on Client.largeThreshold

memberCount Number

The guilds's member count

members Store.<Member>

The amount of Members that the guild is in

name String

The name of the guild

owner Member <nullable>

The member object of the guild owner

ownerID Member <nullable>

The id of the guild owner

presences Array

An array of member presence

region String

The region of the guild

roles Store.<Role>

A Store of Roles ( Where Roles are cached )

systemChannel Object <nullable>

The system channel of the guild

systemChannelID Snowflake <nullable>

The id of the system channel

Extends

  • UnavailableGuild

Methods

ban(user, optionsopt) → {Promise.<User>}

Source:

Bans a member from the guild

Parameters:
Name Type Attributes Description
user Snowflake

The id of the member to ban

options Object <optional>

Options for the guild ban

Properties
Name Type Attributes Default Description
days Number <optional>
0

Number of days to delete messages for

reason String <optional>
''

Reasom for the ban

Returns:
Type
Promise.<User>

beginPrune(days) → {Promise.<Object>}

Source:

Begins a prune operation. Returns an object with one 'pruned' key indicating the number of members that would be removed in a prune operation.

Parameters:
Name Type Description
days Number

Number of days to count prune for (1 or more)

Returns:
Type
Promise.<Object>

delete() → {Promise.<Guild>}

Source:

Deletes a guild

Returns:
Type
Promise.<Guild>

deleteRole(role) → {Promise.<Role>}

Source:

Deletes a role from the guild

Parameters:
Name Type Description
role Snowflake

The id of the role to delete

Returns:
Type
Promise.<Role>

getBan(user) → {Promise.<BannedUser>}

Source:

Gets information about the banned user id

Parameters:
Name Type Description
user Snowflake

The id of the banned user

Returns:
Type
Promise.<BannedUser>

getBans() → {Promise.<Array.<BannedUsers>>}

Source:

Returns an array of banned users

Returns:
Type
Promise.<Array.<BannedUsers>>

getChannels() → {Promise.<(TextChannel|VoiceChannel|CategoryChannel)>}

Source:

Fetch all the guild channels using the REST API and sends an array of channels that were fetched from the cache

Returns:
Type
Promise.<(TextChannel|VoiceChannel|CategoryChannel)>

getInvites() → {Promise.<Array.<Invite>>}

Source:

Returns an array of guild invites

Returns:
Type
Promise.<Array.<Invite>>

getMember(user) → {Promise.<Member>}

Source:

Fetches a guild member from the cache, if not present will use the REST API and set it inside the cache

Parameters:
Name Type Description
user Snowflake

The id of the member

Returns:
Type
Promise.<Member>

giveRole(user, role) → {Promise.<Member>}

Source:

Gives a member a role

Parameters:
Name Type Description
user Snowflake

The id of the member to give the role

role Snowflake

The role to give to the member

Returns:
Type
Promise.<Member>

kick(user, reason) → {Promise.<User>}

Source:

Kicks a member from the guild

Parameters:
Name Type Description
user Snowflake

The id of the member to kick

reason String

The reason for the kick

Returns:
Type
Promise.<User>

(async) leave() → {Promise.<Guild>}

Source:

Similiar to Client#leaveGuild(), makes the bot leave the current guild

Returns:
Type
Promise.<Guild>

makeChannel(name, typeopt) → {Promise.<(TextChannel|VoiceChannel|CategoryChannel)>}

Source:

Creates a Guild Channel Guild Channel types:

  • text - Text Channel
  • voice - Voice Channel
  • category - Category Channel
Parameters:
Name Type Attributes Default Description
name String

The name of the channel

type String <optional>
'text'

The type of the channel

Returns:
Type
Promise.<(TextChannel|VoiceChannel|CategoryChannel)>

makeRole(name, isHoistedopt, isMentionableopt) → {Promise.<Role>}

Source:

Creates a guild role

Parameters:
Name Type Attributes Default Description
name String

The name of the role

isHoisted Boolean <optional>
false

Whether the role should be seperate from the @everyone role

isMentionable Boolean <optional>
false

Whther the role should be mentionable

Returns:
Type
Promise.<Role>

modifyChannelPosition(channel, position) → {Promise.<Channel>}

Source:

Edits a channel's position

Parameters:
Name Type Description
channel Snowflake

The id of the channel to set the position of

position Number

The new position of the channel

Returns:
Type
Promise.<Channel>

modifyRole(role, optionsopt) → {Promise.<Role>}

Source:

Edits a guild role

Parameters:
Name Type Attributes Description
role Snowflake

The id of the role to edit

options Object <optional>

The options for the role

Properties
Name Type Attributes Default Description
name String <optional>

The new name of the role

color Number <optional>

The color of the role in RGB Form. e.g (1, 1, 1)

isHoisted Boolean <optional>
false

Whether the role should be displayed separately in the sidebar

isMentionable Boolean <optional>
false

Whether the role is mentionable

Returns:
Type
Promise.<Role>

pruneCount(days) → {Promise.<Object>}

Source:

Returns an object with one 'pruned' key indicating the number of members that would be removed in a prune operation.

Parameters:
Name Type Description
days Number

Number of days to count prune for (1 or more)

Returns:
Type
Promise.<Object>

removeRole(user, role) → {Promise.<Member>}

Source:

Removes a role from a member

Parameters:
Name Type Description
user Snowflake

The id of the user to remove the role from

role Snowflake

The id of the role to remove

Returns:
Type
Promise.<Member>

setChannelPosition(channel, position) → {Promise.<(TextChannel|VoiceChannel|GuildChannel)>}

Source:

Edits a channel position

Parameters:
Name Type Description
channel Snowflake

The id of the guild channel

position Number

The new position of the channel

Returns:
Type
Promise.<(TextChannel|VoiceChannel|GuildChannel)>

setOwnNick(nick) → {Promise.<Member>}

Source:

Sets the nickname of the client

Parameters:
Name Type Description
nick String

The new nickname for the bot

Returns:
Type
Promise.<Member>

(async) softban(user, reason) → {Promise.<User>}

Source:

Softbans a member from the guild

Parameters:
Name Type Description
user Snowflake

The id of the member to softban

reason String

The reason for the softban

Returns:
Type
Promise.<User>

unban(user, reason) → {Promise.<User>}

Source:

Unbans a member from the guild

Parameters:
Name Type Description
user Snowflake

The id of the member to unban

reason String

The reason for the unban

Returns:
Type
Promise.<User>