DiscordLua
discorddiscord
v1.2.4
Install

SKUManager

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

manager Module 1.2.4 REST Source

Constructor

SKUManager.new(client, application)

The class table is callable, so SKUManager(client, application) is the same as .new.

NameTypeRequiredBehavior
client any required Passed through to the implementation as written.
application any required Passed through to the implementation as written.
lua
local discord = require("discord")
local object = discord.SKUManager({}, {})

Properties

SKUManager.application

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

NameTypeRequiredBehavior
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

lua
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

NameTypeRequiredBehavior
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

lua
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

NameTypeRequiredBehavior
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

lua
local discord = require("discord")
-- object is a SKUManager
object:fetchSubscriptions("123", {}, function(err, result)
    if err then error(err) end
end)

Examples

lua
local discord = require("discord")
local object = discord.SKUManager({})

ApplicationCommandManager · ApplicationCommandPermissionsManager · ApplicationEmojiManager · AutoModerationRuleManager · BaseGuildEmojiManager · BaseManager · CachedManager · CategoryChannelChildManager

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc