DiscordLua
discorddiscord
v1.2.4
Install

Options

Class
On this page

Options 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

Methods

Options.cacheEverything()

# static

Performs cache everything on this Options. Call it from bot code when you need that operation on the current object.

Signature

Options.cacheEverything()

Parameters

No parameters.

Returns

any.

Example

lua
local discord = require("discord")
-- object is a Options
Options.cacheEverything()

Options.cacheLimit()

# static

Performs cache limit on this Options. Call it from bot code when you need that operation on the current object.

Signature

Options.cacheLimit(resolved, managerName)

Parameters

NameTypeRequiredBehavior
resolved any required Passed through to the implementation as written.
managerName any required Passed through to the implementation as written.

Returns

any.

Example

lua
local discord = require("discord")
-- object is a Options
Options.cacheLimit(resolved, managerName)

Options.cacheWithLimits()

# static

Performs cache with limits on this Options. Call it from bot code when you need that operation on the current object.

Signature

Options.cacheWithLimits(settings)

Parameters

NameTypeRequiredBehavior
settings any required Passed through to the implementation as written.

Returns

any.

Example

lua
local discord = require("discord")
-- object is a Options
Options.cacheWithLimits(settings)

Options.createDefault()

# static

Create Default through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.

Signature

Options.createDefault()

Parameters

No parameters.

Returns

any.

Example

lua
local discord = require("discord")
-- object is a Options
Options.createDefault()

Options.resolve()

# static

Resolve a snowflake, object, or mention to a cached instance.

Signature

Options.resolve(userOptions)

Parameters

NameTypeRequiredBehavior
userOptions table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

any.

Example

lua
local discord = require("discord")
-- object is a Options
Options.resolve({})

Static members

  • Options.DefaultMakeCacheSettings
  • Options.DefaultSweeperSettings

Examples

Obtain this object from a manager, wrap helper, or event payload — it is not constructed directly in typical bot code.

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

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc