GuildManager

Guild Manager to work with Guilds

Constructor

new GuildManager(client, id) → {GuildManager}

Parameters:
NameTypeDescription
clientobject

the Application Client

idstring

the id of the guild

Returns:
Type: 
GuildManager
Example
// You can use this way
const manager = new GuildManager(<Client>);
const guild = await manager.fetch(guildId);
console.log(guild);

// Or this way
const manager = new GuildManager(<Client>, guildId);
const guild = await manager.fetch();
console.log(guild);

Members

id :string|null

the id of the user

Type:
  • string | null

Methods

(async) addGuildMemberRole(guildId, userId, roleId) → {Promise.<object>}

Add a role to a guild member

Parameters:
NameTypeDescription
guildIdstring | null

the guild id

userIdstring

the user id

roleIdstring

the role id

Returns:
Type: 
Promise.<object>

(async) fetch(guildId, with_counts) → {Promise.<object>}

Fetch a guild

Parameters:
NameTypeDefaultDescription
guildIdstring | null

the guild id

with_countsbooleanfalse

whether to include approximate member and presence counts

Returns:
Type: 
Promise.<object>

(async) fetchChannels(guildId) → {Promise.<object>}

Fetch a guild's channels

Parameters:
NameTypeDescription
guildIdstring | null

the guild id

Returns:
Type: 
Promise.<object>

(async) fetchGuildMember(guildId, userId) → {Promise.<object>}

Fetch a guild's member

Parameters:
NameTypeDescription
guildIdstring | null

the guild id

userIdstring

the user id

Returns:
Type: 
Promise.<object>

(async) fetchGuildRoles(guildId) → {Promise.<object>}

Fetch a guild's roles

Parameters:
NameTypeDescription
guildIdstring | null

the guild id

Returns:
Type: 
Promise.<object>

(async) fetchThreads(guildId) → {Promise.<object>}

Fetch a guild's members

Parameters:
NameTypeDescription
guildIdstring | null

the guild id

Returns:
Type: 
Promise.<object>

(async) removeGuildMemberRole(guildId, userId, roleId) → {Promise.<object>}

Remove a role from a guild member

Parameters:
NameTypeDescription
guildIdstring | null

the guild id

userIdstring

the user id

roleIdstring

the role id

Returns:
Type: 
Promise.<object>

(async) searchGuildMembers(guildId, searchQuery, limit) → {Promise.<object>}

Search a guild's members

Parameters:
NameTypeDefaultDescription
guildIdstring | null

the guild id

searchQuerystring

the search query

limitnumber | 11

the max number of members to return (1-1000)

Returns:
Type: 
Promise.<object>