Constructor
new GuildManager(client, id) → {GuildManager}
Parameters:
Name | Type | Description |
---|---|---|
client | object | the Application Client |
id | string | 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:
Name | Type | Description |
---|---|---|
guildId | string | | the guild id |
userId | string | the user id |
roleId | string | the role id |
Returns:
- Type:
- Promise.<object>
(async) fetch(guildId, with_counts) → {Promise.<object>}
Fetch a guild
Parameters:
Name | Type | Default | Description |
---|---|---|---|
guildId | string | | the guild id | |
with_counts | boolean | false | whether to include approximate member and presence counts |
Returns:
- Type:
- Promise.<object>
(async) fetchChannels(guildId) → {Promise.<object>}
Fetch a guild's channels
Parameters:
Name | Type | Description |
---|---|---|
guildId | string | | the guild id |
Returns:
- Type:
- Promise.<object>
(async) fetchGuildMember(guildId, userId) → {Promise.<object>}
Fetch a guild's member
Parameters:
Name | Type | Description |
---|---|---|
guildId | string | | the guild id |
userId | string | the user id |
Returns:
- Type:
- Promise.<object>
(async) fetchGuildRoles(guildId) → {Promise.<object>}
Fetch a guild's roles
Parameters:
Name | Type | Description |
---|---|---|
guildId | string | | the guild id |
Returns:
- Type:
- Promise.<object>
(async) fetchThreads(guildId) → {Promise.<object>}
Fetch a guild's members
Parameters:
Name | Type | Description |
---|---|---|
guildId | string | | the guild id |
Returns:
- Type:
- Promise.<object>
(async) removeGuildMemberRole(guildId, userId, roleId) → {Promise.<object>}
Remove a role from a guild member
Parameters:
Name | Type | Description |
---|---|---|
guildId | string | | the guild id |
userId | string | the user id |
roleId | string | the role id |
Returns:
- Type:
- Promise.<object>
(async) searchGuildMembers(guildId, searchQuery, limit) → {Promise.<object>}
Search a guild's members
Parameters:
Name | Type | Default | Description |
---|---|---|---|
guildId | string | | the guild id | |
searchQuery | string | the search query | |
limit | number | | 1 | the max number of members to return (1-1000) |
Returns:
- Type:
- Promise.<object>