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 new instance of Snowflake.
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

Properties

hashCode int
The hash code for this object. [...]
read-only, override
id int
Full snowflake id
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
timestamp DateTime
Returns timestamp included in Snowflake Snowflake reference
read-only

Methods

compareTo(Snowflake other) int
Compares this object to another Comparable [...]
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 non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
override

Operators

operator ==(Object 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
1420070400000
snowflakeDateOffset → const int
Offset of date in snowflake
1 << 22