SKUManager
ManagerOn this page
SKUManager is the cache and REST facade for SKU objects owned by the parent. Typical calls are fetch, create, edit, delete, resolve, and resolveId.
Constructor
SKUManager.new(client, application) The class table is callable, so SKUManager(client, application) is the same as .new.
| Name | Type | Required | Behavior |
|---|---|---|---|
client |
any |
required | Passed through to the implementation as written. |
application |
any |
required | Passed through to the implementation as written. |
local discord = require("discord")
local object = discord.SKUManager({}, {})Properties
- Name
application- Type
any- Access
- readonly
- Description
- Application object for the logged-in bot, available after ready.
- Availability
- Populated from the Gateway/REST payload or constructor for this SKUManager.
Methods
SKUManager:fetch()
#Request a fresh copy of this resource from REST and update the cache.
Signature
SKUManager:fetch(id, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
id |
string |
required | Snowflake id string. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
SKUManager — the same instance, for chaining.
Throws
A DiscordLua error when arguments are invalid or the request fails without a callback.
Example
local discord = require("discord")
-- object is a SKUManager
object:fetch("123", function(err, result)
if err then error(err) end
end)SKUManager:fetchSubscription()
#Fetch Subscription from REST and update the local cache when the request succeeds.
Signature
SKUManager:fetchSubscription(skuId, subscriptionId, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
skuId |
string |
required | Snowflake id string. |
subscriptionId |
string |
required | Snowflake id string. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
SKUManager — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a SKUManager
object:fetchSubscription("123", "123", function(err, result)
if err then error(err) end
end)SKUManager:fetchSubscriptions()
#Fetch Subscriptions from REST and update the local cache when the request succeeds.
Signature
SKUManager:fetchSubscriptions(skuId, options, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
skuId |
string |
required | Snowflake id string. |
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
SKUManager — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a SKUManager
object:fetchSubscriptions("123", {}, function(err, result)
if err then error(err) end
end)Examples
local discord = require("discord")
local object = discord.SKUManager({})Related APIs
ApplicationCommandManager · ApplicationCommandPermissionsManager · ApplicationEmojiManager · AutoModerationRuleManager · BaseGuildEmojiManager · BaseManager · CachedManager · CategoryChannelChildManager
Version: discord 1.2.4 · runtime 1.0.0