DiscordLua
discorddiscord
v1.2.4
Install

GuildMemberRoleManager

Manager
On 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.

manager Module 1.2.4 Source

Constructor

GuildMemberRoleManager.new(client, member, roleIds)

The class table is callable, so GuildMemberRoleManager(client, member, roleIds) is the same as .new.

NameTypeRequiredBehavior
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.
lua
local discord = require("discord")
local object = discord.GuildMemberRoleManager({}, {}, {})

Properties

GuildMemberRoleManager.cache

# readonly
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

GuildMemberRoleManager.client

# readonly
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.

GuildMemberRoleManager.member

# readonly
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

NameTypeRequiredBehavior
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

lua
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

lua
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

lua
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

lua
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

NameTypeRequiredBehavior
role any required Passed through to the implementation as written.

Returns

GuildMemberRoleManager — the same instance, for chaining.

Example

lua
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

lua
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

lua
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

lua
local discord = require("discord")
-- object is a GuildMemberRoleManager
object:icon()

GuildMemberRoleManager:premiumSubscriberRole()

#

Performs premium subscriber role on this GuildMemberRoleManager. Call it from bot code when you need that operation on the current object.

Signature

GuildMemberRoleManager:premiumSubscriberRole()

Parameters

No parameters.

Returns

any.

Example

lua
local discord = require("discord")
-- object is a GuildMemberRoleManager
object:premiumSubscriberRole()

GuildMemberRoleManager:remove()

#

Remove an item from this GuildMemberRoleManager.

Signature

GuildMemberRoleManager:remove(role, reason, callback)

Parameters

NameTypeRequiredBehavior
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

lua
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

NameTypeRequiredBehavior
role any required Passed through to the implementation as written.
id string required Snowflake id string.

Returns

any.

Example

lua
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

NameTypeRequiredBehavior
role any required Passed through to the implementation as written.

Returns

any.

Example

lua
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

NameTypeRequiredBehavior
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

lua
local discord = require("discord")
-- object is a GuildMemberRoleManager
object:set(roles, reason, function(err, result)
    if err then error(err) end
end)

Examples

lua
local discord = require("discord")
local object = discord.GuildMemberRoleManager({})

ApplicationCommandManager · ApplicationCommandPermissionsManager · ApplicationEmojiManager · AutoModerationRuleManager · BaseGuildEmojiManager · BaseManager · CachedManager · CategoryChannelChildManager

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc