PartialsUtil
ClassOn 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.
Methods
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
| Name | Type | Required | Behavior |
|---|---|---|---|
enabled |
any |
required | Passed through to the implementation as written. |
kind |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a PartialsUtil
PartialsUtil.allows(enabled, kind)Predicate that returns whether this PartialsUtil matches is_partial. Use it to branch before calling type-specific methods.
Signature
PartialsUtil.is_partial(value) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
value |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a PartialsUtil
PartialsUtil.is_partial(value)Resolve a snowflake, object, or mention to a cached instance.
Signature
PartialsUtil.resolve(list) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
list |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a PartialsUtil
PartialsUtil.resolve(list)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
| Name | Type | Required | Behavior |
|---|---|---|---|
value |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
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.
Related APIs
ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment
Version: discord 1.2.4 · runtime 1.0.0