DiscordLua
discorddiscord
v1.2.4
Install

PartialsUtil

Class
On this page

PartialsUtil 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

Methods

PartialsUtil.allows()

# static

Performs allows on this PartialsUtil. Call it from bot code when you need that operation on the current object.

Signature

PartialsUtil.allows(enabled, kind)

Parameters

NameTypeRequiredBehavior
enabled any required Passed through to the implementation as written.
kind any required Passed through to the implementation as written.

Returns

any.

Example

lua
local discord = require("discord")
-- object is a PartialsUtil
PartialsUtil.allows(enabled, kind)

PartialsUtil.is_partial()

# static

Predicate that returns whether this PartialsUtil matches is_partial. Use it to branch before calling type-specific methods.

Signature

PartialsUtil.is_partial(value)

Parameters

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

Returns

any.

Example

lua
local discord = require("discord")
-- object is a PartialsUtil
PartialsUtil.is_partial(value)

PartialsUtil.resolve()

# static

Resolve a snowflake, object, or mention to a cached instance.

Signature

PartialsUtil.resolve(list)

Parameters

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

Returns

any.

Example

lua
local discord = require("discord")
-- object is a PartialsUtil
PartialsUtil.resolve(list)

PartialsUtil.resolve_one()

# static

Performs resolve one on this PartialsUtil. Call it from bot code when you need that operation on the current object.

Signature

PartialsUtil.resolve_one(value)

Parameters

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

Returns

any.

Example

lua
local discord = require("discord")
-- object is a PartialsUtil
PartialsUtil.resolve_one(value)

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