DiscordLua
discorddiscord
v1.2.4
Install

Member

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

class Module 1.2.4 Source

Properties

Member.avatar

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

Member.avatarDecorationData

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

Member.banner

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

Member.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 Member.

Member.collectibles

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

Member.communicationDisabledUntil

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

Member.flags

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

Member.guildId

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

Member.id

# readonly
Name
id
Type
any
Access
readonly
Description
Snowflake id of this Member.
Availability
Populated from the Gateway/REST payload or constructor for this Member.

Member.joinedAt

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

Member.nick

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

Member.nickname

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

Member.pending

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

Member.premiumSince

# readonly
Name
premiumSince
Type
any
Access
readonly
Description
Instance field Member.premiumSince. 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.

Member.presence

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

Member.raw

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

Member.roles

# readonly
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.new and remains valid for the lifetime of the Member.
Related
GuildMemberRoleManager

Member.user

# readonly
Name
user
Type
User
Access
readonly
Description
User object associated with this Member.
Availability
Populated from the Gateway/REST payload or constructor for this Member.
Related
User

Methods

Member:addRole()

#

Add Role to this Member.

Signature

Member:addRole(roleId, reason, callback)

Parameters

NameTypeRequiredBehavior
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

lua
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

lua
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

NameTypeRequiredBehavior
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

lua
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

NameTypeRequiredBehavior
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

lua
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

lua
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

NameTypeRequiredBehavior
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

lua
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

lua
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

lua
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

NameTypeRequiredBehavior
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

Member — the same instance, for chaining.

Example

lua
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

lua
local discord = require("discord")
-- object is a Member
object:createdTimestamp()

Member:deleteDM()

#

Permanently delete DM through REST.

Signature

Member:deleteDM(callback)

Parameters

NameTypeRequiredBehavior
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

Member — the same instance, for chaining.

Example

lua
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

NameTypeRequiredBehavior
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

lua
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

lua
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

NameTypeRequiredBehavior
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

lua
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

NameTypeRequiredBehavior
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

lua
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

lua
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

lua
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

lua
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

lua
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

NameTypeRequiredBehavior
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

lua
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

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

Returns

any.

Example

lua
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

NameTypeRequiredBehavior
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

Member — the same instance, for chaining.

Example

lua
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

lua
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

lua
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

lua
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

lua
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

NameTypeRequiredBehavior
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

lua
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

lua
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

lua
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

lua
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

lua
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

NameTypeRequiredBehavior
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

lua
local discord = require("discord")
-- object is a Member
object:permissionsIn(channel, checkAdmin)

Member:premiumSinceTimestamp()

#

Performs premium since timestamp on this Member. Call it from bot code when you need that operation on the current object.

Signature

Member:premiumSinceTimestamp()

Parameters

No parameters.

Returns

Member — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Member
object:premiumSinceTimestamp()

Member:removeRole()

#

Remove Role from this Member.

Signature

Member:removeRole(roleId, reason, callback)

Parameters

NameTypeRequiredBehavior
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

lua
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

NameTypeRequiredBehavior
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

lua
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

NameTypeRequiredBehavior
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

lua
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

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

Returns

Member — the same instance, for chaining.

Example

lua
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

NameTypeRequiredBehavior
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

lua
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

NameTypeRequiredBehavior
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

lua
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

lua
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

lua
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

lua
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.

ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc