View Source Nostrum.Struct.User.Flags (Nostrum v0.6.1)

Struct representing the flags a user account can have

Link to this section Summary

Types

Bug Hunter (Level 1)

Bug Hunter (Level 2)

Early Supporter

HypeSquad Balance

HypeSquad Bravery

HypeSquad Brilliance

HypeSquad Events

Discord Partner

Discord Employee

System user

t()

Team User

Verified bot

Verified developer

Functions

Constructs a flag struct based on an integer from the Discord API (either public_flags or flags).

Convert a flag struct to an integer value.

Link to this section Types

Specs

bug_hunter_level_1() :: boolean()

Bug Hunter (Level 1)

Specs

bug_hunter_level_2() :: boolean()

Bug Hunter (Level 2)

Specs

early_supporter() :: boolean()

Early Supporter

Specs

flags() :: %Nostrum.Struct.User.Flags{
  bug_hunter_level_1: bug_hunter_level_1(),
  bug_hunter_level_2: bug_hunter_level_2(),
  early_supporter: early_supporter(),
  hypesquad_balance: hypesquad_balance(),
  hypesquad_bravery: hypesquad_bravery(),
  hypesquad_brilliance: hypesquad_brilliance(),
  hypesquad_events: hypesquad_events(),
  partner: partner(),
  staff: staff(),
  system: system(),
  team_user: team_user(),
  verified_bot: verified_bot(),
  verified_developer: verified_developer()
}

Specs

hypesquad_balance() :: boolean()

HypeSquad Balance

Specs

hypesquad_bravery() :: boolean()

HypeSquad Bravery

Link to this type

hypesquad_brilliance()

View Source

Specs

hypesquad_brilliance() :: boolean()

HypeSquad Brilliance

Specs

hypesquad_events() :: boolean()

HypeSquad Events

Specs

partner() :: boolean()

Discord Partner

Specs

staff() :: boolean()

Discord Employee

Specs

system() :: boolean()

System user

Specs

t() :: flags()

Specs

team_user() :: boolean()

Team User

Specs

verified_bot() :: boolean()

Verified bot

Specs

verified_developer() :: boolean()

Verified developer

Link to this section Functions

Link to this function

from_integer(flag_value)

View Source

Specs

from_integer(integer()) :: t()

Constructs a flag struct based on an integer from the Discord API (either public_flags or flags).

Examples

iex> Nostrum.Struct.User.Flags.from_integer(131842)
%Nostrum.Struct.User.Flags{
  bug_hunter_level_1: false,
  bug_hunter_level_2: false,
  early_supporter: true,
  hypesquad_balance: true,
  hypesquad_bravery: false,
  hypesquad_brilliance: false,
  hypesquad_events: false,
  partner: true,
  staff: false,
  system: false,
  team_user: false,
  verified_bot: false,
  verified_developer: true
}

Specs

to_integer(t()) :: integer()

Convert a flag struct to an integer value.

Examples

iex> my_flags = %Nostrum.Struct.User.Flags{
...>  bug_hunter_level_1: false,
...>  bug_hunter_level_2: false,
...>  early_supporter: true,
...>  hypesquad_balance: true,
...>  hypesquad_bravery: false,
...>  hypesquad_brilliance: false,
...>  hypesquad_events: false,
...>  partner: true,
...>  staff: false,
...>  system: false,
...>  team_user: false,
...>  verified_bot: false,
...>  verified_developer: true
...> }
iex> Nostrum.Struct.User.Flags.to_integer(my_flags)
131842