Packages

A Gleam library for building Discord webhook payloads safely.

Current section

Files

Jump to
kitazith src kitazith@message_formatting@guild_navigation.erl
Raw

src/kitazith@message_formatting@guild_navigation.erl

-module(kitazith@message_formatting@guild_navigation).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/kitazith/message_formatting/guild_navigation.gleam").
-export([format/1]).
-export_type([guild_navigation_type/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.
-type guild_navigation_type() :: customize | browse | guide | linked_roles.
-file("src/kitazith/message_formatting/guild_navigation.gleam", 29).
?DOC(" Format a Discord guild navigation link.\n").
-spec format(guild_navigation_type()) -> binary().
format(Navigation_type) ->
case Navigation_type of
customize ->
<<"<id:customize>"/utf8>>;
browse ->
<<"<id:browse>"/utf8>>;
guide ->
<<"<id:guide>"/utf8>>;
linked_roles ->
<<"<id:linked-roles>"/utf8>>
end.