LimitedCollection
ClassOn this page
LimitedCollection is a DiscordLua class representing a Discord resource. Obtain it from a manager, an event payload, or the constructor when one is documented below.
Constructor
LimitedCollection.new(maxSize, keepOverLimit) The class table is callable, so LimitedCollection(maxSize, keepOverLimit) is the same as .new.
| Name | Type | Required | Behavior |
|---|---|---|---|
maxSize |
any |
required | Passed through to the implementation as written. |
keepOverLimit |
any |
required | Passed through to the implementation as written. |
local discord = require("discord")
local object = discord.LimitedCollection({}, {})Properties
- Name
keepOverLimit- Type
any- Access
- readonly
- Description
- Instance field
LimitedCollection.keepOverLimit. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this LimitedCollection.
- Name
maxSize- Type
any- Access
- readonly
- Description
- Instance field
LimitedCollection.maxSize. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this LimitedCollection.
Methods
LimitedCollection:set()
#Performs set on this LimitedCollection. Call it from bot code when you need that operation on the current object.
Signature
LimitedCollection:set(key, value) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
key |
any |
required | Passed through to the implementation as written. |
value |
any |
required | Passed through to the implementation as written. |
Returns
LimitedCollection — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a LimitedCollection
object:set(key, value)Examples
local discord = require("discord")
local object = discord.LimitedCollection({})Related APIs
ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment
Version: discord 1.2.4 · runtime 1.0.0