Snowflake
ClassOn 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.
Constructor
Snowflake.new(id) The class table is callable, so Snowflake(id) is the same as .new.
| Name | Type | Required | Behavior |
|---|---|---|---|
id |
string |
required | Snowflake id string. |
local discord = require("discord")
local object = discord.Snowflake({})Properties
- 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
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
local discord = require("discord")
-- object is a Snowflake
object:createdTimestamp()Examples
local discord = require("discord")
local object = discord.Snowflake({})Related APIs
ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment
Version: discord 1.2.4 · runtime 1.0.0