Member
ClassOn this page
Member is a DiscordLua class representing a Discord resource. Obtain it from a manager, an event payload, or the constructor when one is documented below.
Properties
- Name
avatar- Type
any- Access
- readonly
- Description
- Instance field
Member.avatar. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Member.
- Name
avatarDecorationData- Type
any- Access
- readonly
- Description
- Instance field
Member.avatarDecorationData. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Member.
- Name
banner- Type
any- Access
- readonly
- Description
- Instance field
Member.banner. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Member.
- 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 Member.
- Name
collectibles- Type
any- Access
- readonly
- Description
- Instance field
Member.collectibles. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Member.
- Name
communicationDisabledUntil- Type
any- Access
- readonly
- Description
- Instance field
Member.communicationDisabledUntil. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Member.
- Name
flags- Type
any- Access
- mutable
- Description
- Instance field
Member.flags. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Member.
- Name
guildId- Type
any- Access
- readonly
- Description
- Instance field
Member.guildId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Member.
- Name
id- Type
any- Access
- readonly
- Description
- Snowflake id of this Member.
- Availability
- Populated from the Gateway/REST payload or constructor for this Member.
- Name
joinedAt- Type
any- Access
- readonly
- Description
- Instance field
Member.joinedAt. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Member.
- Name
nick- Type
any- Access
- readonly
- Description
- Instance field
Member.nick. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Member.
- Name
nickname- Type
any- Access
- mutable
- Description
- Instance field
Member.nickname. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Member.
- Name
pending- Type
any- Access
- readonly
- Description
- Instance field
Member.pending. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Member.
- Name
presence- Type
any- Access
- readonly
- Description
- Instance field
Member.presence. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Member.
- Name
raw- Type
any- Access
- readonly
- Description
- Instance field
Member.raw. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Member.
- Name
roles- Type
- GuildMemberRoleManager
- Access
- readonly
- Description
- Cache and REST facade for guildmemberrole objects owned by this Member. Use it to fetch, create, resolve, and mutate those resources.
- Availability
- Created in
Member.newand remains valid for the lifetime of the Member. - Related
- GuildMemberRoleManager
Methods
Member:addRole()
#Add Role to this Member.
Signature
Member:addRole(roleId, reason, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
roleId |
string |
required | Snowflake id string. |
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
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:addRole("123", reason, function(err, result)
if err then error(err) end
end)Member:avatarDecorationURL()
#Performs avatar decoration url on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:avatarDecorationURL() Parameters
No parameters.
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:avatarDecorationURL()Member:avatarURL()
#Performs avatar url on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:avatarURL(options) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:avatarURL({})Member:ban()
#Performs ban on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:ban(options, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:ban({}, function(err, result)
if err then error(err) end
end)Member:bannable()
#Performs bannable on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:bannable() Parameters
No parameters.
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:bannable()Member:bannerURL()
#Performs banner url on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:bannerURL(options) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:bannerURL({})Member:communicationDisabledUntilTimestamp()
#Performs communication disabled until timestamp on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:communicationDisabledUntilTimestamp() Parameters
No parameters.
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:communicationDisabledUntilTimestamp()Member:createdAt()
#Create dAt through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
Member:createdAt() Parameters
No parameters.
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:createdAt()Member:createDM()
#Create DM through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
Member:createDM(callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:createDM(function(err, result)
if err then error(err) end
end)Member:createdTimestamp()
#Create dTimestamp through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
Member:createdTimestamp() Parameters
No parameters.
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:createdTimestamp()Member:deleteDM()
#Permanently delete DM through REST.
Signature
Member:deleteDM(callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:deleteDM(function(err, result)
if err then error(err) end
end)Member:disableCommunicationUntil()
#Performs disable communication until on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:disableCommunicationUntil(untilIso, reason, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
untilIso |
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
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:disableCommunicationUntil(untilIso, reason, function(err, result)
if err then error(err) end
end)Member:displayAvatarDecorationURL()
#Performs display avatar decoration url on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:displayAvatarDecorationURL() Parameters
No parameters.
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:displayAvatarDecorationURL()Member:displayAvatarURL()
#Performs display avatar url on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:displayAvatarURL(options) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:displayAvatarURL({})Member:displayBannerURL()
#Performs display banner url on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:displayBannerURL(options) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:displayBannerURL({})Member:displayColor()
#Performs display color on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:displayColor() Parameters
No parameters.
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:displayColor()Member:displayHexColor()
#Performs display hex color on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:displayHexColor() Parameters
No parameters.
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:displayHexColor()Member:displayName()
#Performs display name on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:displayName() Parameters
No parameters.
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:displayName()Member:dmChannel()
#Performs dm channel on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:dmChannel() Parameters
No parameters.
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:dmChannel()Member:edit()
#Apply a REST update to this resource.
Signature
Member:edit(options, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:edit({}, function(err, result)
if err then error(err) end
end)Member:equals()
#Return whether this Member refers to the same resource as the argument.
Signature
Member:equals(other) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
other |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a Member
object:equals(other)Member:fetch()
#Request a fresh copy of this resource from REST and update the cache.
Signature
Member:fetch(callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:fetch(function(err, result)
if err then error(err) end
end)Member:guild()
#Performs guild on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:guild() Parameters
No parameters.
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:guild()Member:isCommunicationDisabled()
#Predicate that returns whether this Member matches isCommunicationDisabled. Use it to branch before calling type-specific methods.
Signature
Member:isCommunicationDisabled() Parameters
No parameters.
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:isCommunicationDisabled()Member:isGuest()
#Predicate that returns whether this Member matches isGuest. Use it to branch before calling type-specific methods.
Signature
Member:isGuest() Parameters
No parameters.
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:isGuest()Member:joinedTimestamp()
#Performs joined timestamp on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:joinedTimestamp() Parameters
No parameters.
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:joinedTimestamp()Member:kick()
#Performs kick on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:kick(reason, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
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
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:kick(reason, function(err, result)
if err then error(err) end
end)Member:kickable()
#Performs kickable on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:kickable() Parameters
No parameters.
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:kickable()Member:manageable()
#Performs manageable on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:manageable() Parameters
No parameters.
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:manageable()Member:moderatable()
#Performs moderatable on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:moderatable() Parameters
No parameters.
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:moderatable()Member:partial()
#Performs partial on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:partial() Parameters
No parameters.
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:partial()Member:permissionsIn()
#Performs permissions in on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:permissionsIn(channel, checkAdmin) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
channel |
any |
required | Passed through to the implementation as written. |
checkAdmin |
any |
required | Passed through to the implementation as written. |
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:permissionsIn(channel, checkAdmin)Member:removeRole()
#Remove Role from this Member.
Signature
Member:removeRole(roleId, reason, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
roleId |
string |
required | Snowflake id string. |
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
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:removeRole("123", reason, function(err, result)
if err then error(err) end
end)Member:removeTimeout()
#Remove Timeout from this Member.
Signature
Member:removeTimeout(reason, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
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
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:removeTimeout(reason, function(err, result)
if err then error(err) end
end)Member:send()
#Send a message, payload, or packet using this object.
Signature
Member:send(contentOrOptions, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
contentOrOptions |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:send("Hello", function(err, result)
if err then error(err) end
end)Member:setFlags()
#Set the Flags field. Builders return this Member so setters can be chained.
Signature
Member:setFlags(flags) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
flags |
any |
required | Passed through to the implementation as written. |
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:setFlags(flags)Member:setNickname()
#Set the Nickname field. Builders return this Member so setters can be chained.
Signature
Member:setNickname(nick, reason, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
nick |
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
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:setNickname(nick, reason, function(err, result)
if err then error(err) end
end)Member:timeout()
#Performs timeout on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:timeout(duration, reason, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
duration |
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
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:timeout(duration, reason, function(err, result)
if err then error(err) end
end)Member:toJSON()
#Serialize this Member into a Lua table suitable for REST or debugging.
Signature
Member:toJSON() Parameters
No parameters.
Returns
any.
Example
local discord = require("discord")
-- object is a Member
object:toJSON()Member:toString()
#function toString() { [native code] }
Signature
Member:toString() Parameters
No parameters.
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:toString()Member:voice()
#Performs voice on this Member. Call it from bot code when you need that operation on the current object.
Signature
Member:voice() Parameters
No parameters.
Returns
Member — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Member
object:voice()Examples
Obtain this object from a manager, wrap helper, or event payload — it is not constructed directly in typical bot code.
Related APIs
ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment
Version: discord 1.2.4 · runtime 1.0.0