GuildMemberRoleManager
ManagerOn this page
GuildMemberRoleManager is the cache and REST facade for GuildMemberRole objects owned by the parent. Typical calls are fetch, create, edit, delete, resolve, and resolveId.
Constructor
GuildMemberRoleManager.new(client, member, roleIds) The class table is callable, so GuildMemberRoleManager(client, member, roleIds) is the same as .new.
| Name | Type | Required | Behavior |
|---|---|---|---|
client |
any |
required | Passed through to the implementation as written. |
member |
any |
required | Passed through to the implementation as written. |
roleIds |
any |
required | Passed through to the implementation as written. |
local discord = require("discord")
local object = discord.GuildMemberRoleManager({}, {}, {})Properties
- Name
cache- Type
- Collection
- Access
- readonly
- Description
- In-memory Collection of cached objects owned by this GuildMemberRoleManager.
- Availability
- Populated from the Gateway/REST payload or constructor for this GuildMemberRoleManager.
- Related
- Collection
- Name
client- Type
any- Access
- readonly
- Description
- Owning Client instance used for REST, cache, and event dispatch.
- Availability
- Populated from the Gateway/REST payload or constructor for this GuildMemberRoleManager.
- Name
member- Type
any- Access
- readonly
- Description
- Guild member view of the user, when the event occurred in a guild.
- Availability
- Populated from the Gateway/REST payload or constructor for this GuildMemberRoleManager.
Methods
GuildMemberRoleManager:add()
#Add an item to this GuildMemberRoleManager.
Signature
GuildMemberRoleManager:add(role, reason, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
role |
any |
required | Passed through to the implementation as written. |
reason |
string |
optional | Audit-log reason sent as X-Audit-Log-Reason on REST mutations. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
GuildMemberRoleManager — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildMemberRoleManager
object:add(role, reason, function(err, result)
if err then error(err) end
end)GuildMemberRoleManager:botRole()
#Performs bot role on this GuildMemberRoleManager. Call it from bot code when you need that operation on the current object.
Signature
GuildMemberRoleManager:botRole() Parameters
No parameters.
Returns
any.
Example
local discord = require("discord")
-- object is a GuildMemberRoleManager
object:botRole()GuildMemberRoleManager:color()
#Performs color on this GuildMemberRoleManager. Call it from bot code when you need that operation on the current object.
Signature
GuildMemberRoleManager:color() Parameters
No parameters.
Returns
any.
Example
local discord = require("discord")
-- object is a GuildMemberRoleManager
object:color()GuildMemberRoleManager:guild()
#Performs guild on this GuildMemberRoleManager. Call it from bot code when you need that operation on the current object.
Signature
GuildMemberRoleManager:guild() Parameters
No parameters.
Returns
GuildMemberRoleManager — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildMemberRoleManager
object:guild()GuildMemberRoleManager:has()
#Performs has on this GuildMemberRoleManager. Call it from bot code when you need that operation on the current object.
Signature
GuildMemberRoleManager:has(role) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
role |
any |
required | Passed through to the implementation as written. |
Returns
GuildMemberRoleManager — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildMemberRoleManager
object:has(role)GuildMemberRoleManager:highest()
#Performs highest on this GuildMemberRoleManager. Call it from bot code when you need that operation on the current object.
Signature
GuildMemberRoleManager:highest() Parameters
No parameters.
Returns
GuildMemberRoleManager — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildMemberRoleManager
object:highest()GuildMemberRoleManager:hoist()
#Performs hoist on this GuildMemberRoleManager. Call it from bot code when you need that operation on the current object.
Signature
GuildMemberRoleManager:hoist() Parameters
No parameters.
Returns
any.
Example
local discord = require("discord")
-- object is a GuildMemberRoleManager
object:hoist()GuildMemberRoleManager:icon()
#Performs icon on this GuildMemberRoleManager. Call it from bot code when you need that operation on the current object.
Signature
GuildMemberRoleManager:icon() Parameters
No parameters.
Returns
any.
Example
local discord = require("discord")
-- object is a GuildMemberRoleManager
object:icon()GuildMemberRoleManager:remove()
#Remove an item from this GuildMemberRoleManager.
Signature
GuildMemberRoleManager:remove(role, reason, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
role |
any |
required | Passed through to the implementation as written. |
reason |
string |
optional | Audit-log reason sent as X-Audit-Log-Reason on REST mutations. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
GuildMemberRoleManager — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildMemberRoleManager
object:remove(role, reason, function(err, result)
if err then error(err) end
end)GuildMemberRoleManager:resolved()
#Performs resolved on this GuildMemberRoleManager. Call it from bot code when you need that operation on the current object.
Signature
GuildMemberRoleManager:resolved(role, id) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
role |
any |
required | Passed through to the implementation as written. |
id |
string |
required | Snowflake id string. |
Returns
any.
Example
local discord = require("discord")
-- object is a GuildMemberRoleManager
object:resolved(role, "123")GuildMemberRoleManager:resolveId()
#Resolve a snowflake, object, or mention to an id string.
Signature
GuildMemberRoleManager:resolveId(role) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
role |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a GuildMemberRoleManager
object:resolveId(role)GuildMemberRoleManager:set()
#Performs set on this GuildMemberRoleManager. Call it from bot code when you need that operation on the current object.
Signature
GuildMemberRoleManager:set(roles, reason, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
roles |
any |
required | Passed through to the implementation as written. |
reason |
string |
optional | Audit-log reason sent as X-Audit-Log-Reason on REST mutations. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
GuildMemberRoleManager — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildMemberRoleManager
object:set(roles, reason, function(err, result)
if err then error(err) end
end)Examples
local discord = require("discord")
local object = discord.GuildMemberRoleManager({})Related APIs
ApplicationCommandManager · ApplicationCommandPermissionsManager · ApplicationEmojiManager · AutoModerationRuleManager · BaseGuildEmojiManager · BaseManager · CachedManager · CategoryChannelChildManager
Version: discord 1.2.4 · runtime 1.0.0