Snowflake class

Snowflake represents id system used by Discord. id property is actual id of entity which holds Snowflake.

Implemented types

Constructors

Snowflake(dynamic id)
Creates instance of an Snowflake
factory
Snowflake.bulk()
Creates first snowflake which can be deleted by bulk-delete messages
Snowflake.fromDateTime(DateTime date)
Creates synthetic snowflake based on given date.
Snowflake.fromNow()
Creates synthetic snowflake based on current time
Snowflake.value(int _id)
Creates new instance of Snowflake.
const
Snowflake.zero()
Creates new instance with value of 0
const

Properties

hashCode int
The hash code for this object.
no setteroverride
id int
Full snowflake id
no setter
isZero bool
Returns true if snowflake is zero
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timestamp DateTime
Returns timestamp included in Snowflake Snowflake reference
no setter

Methods

compareTo(Snowflake other) int
Compares this object to another object.
override
isAfter(Snowflake s) bool
Checks if given Snowflake s is created after this instance
isBefore(Snowflake s) bool
Checks if given Snowflake s is created before this instance
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toSnowflakeEntity() SnowflakeEntity
Returns SnowflakeEntity from current Snowflake
toString() String
A string representation of this object.
override

Operators

operator ==(dynamic other) bool
The equality operator.
override

Static Methods

compareDates(Snowflake first, Snowflake second) int
Compares two Snowflakes based on creation date

Constants

discordEpoch → const int
START OF DISCORD EPOCH
snowflakeDateOffset → const int
Offset of date in snowflake