DiscordLua
discorddiscord
v1.2.4
Install

SubscriptionManager

Manager
On this page

SubscriptionManager is the cache and REST facade for Subscription objects owned by the parent. Typical calls are fetch, create, edit, delete, resolve, and resolveId.

manager Module 1.2.4 REST Source

Constructor

SubscriptionManager.new(client, application)

The class table is callable, so SubscriptionManager(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.SubscriptionManager({}, {})

Properties

SubscriptionManager.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 SubscriptionManager.

Methods

SubscriptionManager:fetch()

#

Request a fresh copy of this resource from REST and update the cache.

Signature

SubscriptionManager:fetch(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

SubscriptionManager — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a SubscriptionManager
object:fetch("123", "123", function(err, result)
    if err then error(err) end
end)

Examples

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

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

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc