SubscriptionManager
ManagerOn 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.
Constructor
SubscriptionManager.new(client, application) The class table is callable, so SubscriptionManager(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.SubscriptionManager({}, {})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 SubscriptionManager.
Methods
SubscriptionManager:fetch()
#Request a fresh copy of this resource from REST and update the cache.
Signature
SubscriptionManager:fetch(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
SubscriptionManager — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a SubscriptionManager
object:fetch("123", "123", function(err, result)
if err then error(err) end
end)Examples
local discord = require("discord")
local object = discord.SubscriptionManager({})Related APIs
ApplicationCommandManager · ApplicationCommandPermissionsManager · ApplicationEmojiManager · AutoModerationRuleManager · BaseGuildEmojiManager · BaseManager · CachedManager · CategoryChannelChildManager
Version: discord 1.2.4 · runtime 1.0.0