-
Notifications
You must be signed in to change notification settings - Fork 144
Snowflake
SinisterRectus edited this page Nov 16, 2019
·
12 revisions
extends Container
Defines the base methods and/or properties for all Discord objects that have a Snowflake ID.
This is an abstract base class. Direct instances should never exist.
Properties Inherited From Container
Name | Type | Description |
---|---|---|
client | Client | A shortcut to the client object to which this container is visible. |
parent | Container/Client | The parent object of to which this container is a child. For example, the parent of a role is the guild in which the role exists. |
Name | Type | Description |
---|---|---|
createdAt | number | The Unix time in seconds at which this object was created by Discord. Additional decimal points may be present, though only the first 3 (milliseconds) should be considered accurate. Equivalent to Date.parseSnowflake(Snowflake.id) . |
id | string | The Snowflake ID that can be used to identify the object. This is guaranteed to be unique except in cases where an object shares the ID of its parent. |
timestamp | string | The date and time at which this object was created by Discord, represented as an ISO 8601 string plus microseconds when available. Equivalent to Date.fromSnowflake(Snowflake.id):toISO() . |
Methods Inherited From Container
Defines the behavior of the ==
operator. Allows containers to be directly compared according to their type and __hash
return values.
Returns: boolean
Defines the behavior of the tostring
function. All containers follow the format ClassName: hash
.
Returns: string
Returns Snowflake.id
Returns: string
Returns a unique Date object that represents when the object was created by Discord. Equivalent to Date.fromSnowflake(Snowflake.id)
This method only operates on data in memory.
Returns: Date