Unlike other Discord libraries, AckCord doesn’t have one specific snowflake type,
instead it uses a type
SnowflakeType[A] to refer to something of type
Most of these types also have aliases, like
UserId being an alias
Converting to snowflake
To convert a long or string(prefer string) to a snowflake, use the apply method
on the companion object. For example:
You can also use this to “cast” one snowflake type to another.
In some cases it’s not possible to give a concrete type to the snowflake.
In those cases
RawSnowflake is used instead, an alias for
In most cases you’ll have to cast this to what you need yourself.
For channels, AckCord will try to use the most specific type possible. In most
cases this will work fine, but in some cases you’ll have to cast. As casting is
much more common with channel id types, they have a special method
To do this, and also help with type inference a bit more.
val channelId: ChannelId = ChannelId(0L) val c: CacheSnapshot = ??? c.getTextChannel(channelId.asChannelId)