-module(discord_gleam@discord@intents). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). -export([intents_to_bitfield/1, default/0, all/0, none/0]). -export_type([intents/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 intents() :: {intents, boolean(), boolean(), boolean()}. -file("src/discord_gleam/discord/intents.gleam", 6). ?DOC(" Calculate a bitfield from a set of intents.\n"). -spec intents_to_bitfield(intents()) -> integer(). intents_to_bitfield(Intents) -> Bitfield = 0, Bitfield@1 = case erlang:element(2, Intents) of true -> Bitfield + 512; false -> Bitfield end, Bitfield@2 = case erlang:element(4, Intents) of true -> Bitfield@1 + 4096; false -> Bitfield@1 end, Bitfield@3 = case erlang:element(3, Intents) of true -> Bitfield@2 + 32768; false -> Bitfield@2 end, Bitfield@3. -file("src/discord_gleam/discord/intents.gleam", 31). ?DOC(" Enable a set of default intents, which are usally used by most bots.\n"). -spec default() -> intents(). default() -> {intents, true, true, true}. -file("src/discord_gleam/discord/intents.gleam", 36). ?DOC(" Enable all the intents, use this if you want to receive all supported events.\n"). -spec all() -> intents(). all() -> {intents, true, true, true}. -file("src/discord_gleam/discord/intents.gleam", 41). ?DOC(" Disable all the intents, use this if you want to receive no events.\n"). -spec none() -> intents(). none() -> {intents, false, false, false}.