DataManager
ManagerOn this page
DataManager is the cache and REST facade for Data objects owned by the parent. Typical calls are fetch, create, edit, delete, resolve, and resolveId.
Constructor
DataManager.new(client, holds) The class table is callable, so DataManager(client, holds) is the same as .new.
| Name | Type | Required | Behavior |
|---|---|---|---|
client |
any |
required | Passed through to the implementation as written. |
holds |
any |
required | Passed through to the implementation as written. |
local discord = require("discord")
local object = discord.DataManager({}, {})Properties
- Name
cache- Type
any- Access
- readonly
- Description
- In-memory Collection of cached objects owned by this DataManager.
- Availability
- Populated from the Gateway/REST payload or constructor for this DataManager.
- 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 DataManager.
Methods
DataManager:resolve()
#Resolve a snowflake, object, or mention to a cached instance.
Signature
DataManager:resolve(idOrInstance) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
idOrInstance |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a DataManager
object:resolve("123")DataManager:resolveId()
#Resolve a snowflake, object, or mention to an id string.
Signature
DataManager:resolveId(idOrInstance) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
idOrInstance |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a DataManager
object:resolveId("123")Examples
local discord = require("discord")
local object = discord.DataManager({})Related APIs
ApplicationCommandManager · ApplicationCommandPermissionsManager · ApplicationEmojiManager · AutoModerationRuleManager · BaseGuildEmojiManager · BaseManager · CachedManager · CategoryChannelChildManager
Version: discord 1.2.4 · runtime 1.0.0