DiscordLua
discorddiscord
v1.2.4
Install

LimitedCollection

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

class Module 1.2.4 Source

Constructor

LimitedCollection.new(maxSize, keepOverLimit)

The class table is callable, so LimitedCollection(maxSize, keepOverLimit) is the same as .new.

NameTypeRequiredBehavior
maxSize any required Passed through to the implementation as written.
keepOverLimit any required Passed through to the implementation as written.
lua
local discord = require("discord")
local object = discord.LimitedCollection({}, {})

Properties

LimitedCollection.keepOverLimit

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

LimitedCollection.maxSize

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

NameTypeRequiredBehavior
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

lua
local discord = require("discord")
-- object is a LimitedCollection
object:set(key, value)

Examples

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

ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc