DiscordLua
discorddiscord
v1.2.4
Install

Snowflake

Class
On this page

Snowflake 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

Snowflake.new(id)

The class table is callable, so Snowflake(id) is the same as .new.

NameTypeRequiredBehavior
id string required Snowflake id string.
lua
local discord = require("discord")
local object = discord.Snowflake({})

Properties

Snowflake.id

# readonly
Name
id
Type
any
Access
readonly
Description
Snowflake id of this Snowflake.
Availability
Populated from the Gateway/REST payload or constructor for this Snowflake.

Methods

Snowflake:createdAt()

#

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

Signature

Snowflake:createdAt()

Parameters

No parameters.

Returns

Snowflake — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Snowflake
object:createdAt()

Snowflake:createdTimestamp()

#

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

Signature

Snowflake:createdTimestamp()

Parameters

No parameters.

Returns

Snowflake — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Snowflake
object:createdTimestamp()

Examples

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

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

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc