Current section
Files
Jump to
Current section
Files
src/discord_gleam@discord@snowflake.erl
-module(discord_gleam@discord@snowflake).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([decoder/0]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
?MODULEDOC(
" Snowflakes is discord's type for unique identifiers. \\\n"
" They are 64-bit unsigned integers, represented as strings. \\\n"
" See https://discord.com/developers/docs/reference#snowflakes\n"
).
-file("src/discord_gleam/discord/snowflake.gleam", 11).
-spec decoder() -> gleam@dynamic@decode:decoder(binary()).
decoder() ->
gleam@dynamic@decode:one_of(
{decoder, fun gleam@dynamic@decode:decode_string/1},
[begin
_pipe = {decoder, fun gleam@dynamic@decode:decode_int/1},
gleam@dynamic@decode:map(_pipe, fun erlang:integer_to_binary/1)
end]
).