DiscordBotList v0.1.0 DiscordBotList.Struct.User View Source

Module defining the Users and functions corresponding to them.

Link to this section Summary

Types

The admin status of the user.

The avatar hash of the user's avatar.

The banner image url of the user.

The bio of the user.

The certified status of the user.

The custom hex color of the user.

The cdn hash of the user's avatar if the user has none.

The discriminator of the user.

The id of the user.

The mod status of the user.

The social usernames of the user.

The supporter status of the user.

t()

The username of the user.

The website moderator status of the user.

Functions

Import a value from the string map to the atom struct. This is used when they have different names.

Import from string map values to the struct where the string key of the map is same as the atom key of the struct.

Create an empty struct corresponding to the specified map and called module.

Extract the struct from the map - struct pipeline.

Get the data about a user when supplying the user id.

Link to this section Types

The admin status of the user.

The avatar hash of the user's avatar.

The banner image url of the user.

The bio of the user.

Link to this type

certified_dev()

View Source
certified_dev() :: boolean()

The certified status of the user.

The custom hex color of the user.

Link to this type

def_avatar()

View Source
def_avatar() :: String.t()

The cdn hash of the user's avatar if the user has none.

Link to this type

discriminator()

View Source
discriminator() :: String.t()

The discriminator of the user.

The id of the user.

The mod status of the user.

The social usernames of the user.

Link to this type

supporter()

View Source
supporter() :: boolean()

The supporter status of the user.

Link to this type

t()

View Source
t() :: %DiscordBotList.Struct.User{
  admin: boolean(),
  avatar: String.t(),
  banner: String.t(),
  bio: String.t(),
  certified_dev: boolean(),
  color: String.t(),
  def_avatar: String.t(),
  discriminator: String.t(),
  id: String.t(),
  mod: boolean(),
  social: DiscordBotList.Struct.Social.t(),
  supporter: boolean(),
  username: String.t(),
  web_mod: boolean()
}
Link to this type

username()

View Source
username() :: String.t()

The username of the user.

The website moderator status of the user.

Link to this section Functions

Link to this function

add_data(arg, map_key, struct_key)

View Source
add_data(
  {map(),
   %DiscordBotList.Struct.User{
     admin: term(),
     avatar: term(),
     banner: term(),
     bio: term(),
     certified_dev: term(),
     color: term(),
     def_avatar: term(),
     discriminator: term(),
     id: term(),
     mod: term(),
     social: term(),
     supporter: term(),
     username: term(),
     web_mod: term()
   }},
  String.t(),
  atom()
) ::
  {map(),
   %DiscordBotList.Struct.User{
     admin: term(),
     avatar: term(),
     banner: term(),
     bio: term(),
     certified_dev: term(),
     color: term(),
     def_avatar: term(),
     discriminator: term(),
     id: term(),
     mod: term(),
     social: term(),
     supporter: term(),
     username: term(),
     web_mod: term()
   }}

Import a value from the string map to the atom struct. This is used when they have different names.

Link to this function

add_raws(arg, raws)

View Source
add_raws(
  {map(),
   %DiscordBotList.Struct.User{
     admin: term(),
     avatar: term(),
     banner: term(),
     bio: term(),
     certified_dev: term(),
     color: term(),
     def_avatar: term(),
     discriminator: term(),
     id: term(),
     mod: term(),
     social: term(),
     supporter: term(),
     username: term(),
     web_mod: term()
   }},
  [atom()]
) ::
  {map(),
   %DiscordBotList.Struct.User{
     admin: term(),
     avatar: term(),
     banner: term(),
     bio: term(),
     certified_dev: term(),
     color: term(),
     def_avatar: term(),
     discriminator: term(),
     id: term(),
     mod: term(),
     social: term(),
     supporter: term(),
     username: term(),
     web_mod: term()
   }}

Import from string map values to the struct where the string key of the map is same as the atom key of the struct.

Link to this function

create_empty!(map)

View Source
create_empty!(map()) ::
  {map(),
   %DiscordBotList.Struct.User{
     admin: term(),
     avatar: term(),
     banner: term(),
     bio: term(),
     certified_dev: term(),
     color: term(),
     def_avatar: term(),
     discriminator: term(),
     id: term(),
     mod: term(),
     social: term(),
     supporter: term(),
     username: term(),
     web_mod: term()
   }}

Create an empty struct corresponding to the specified map and called module.

Link to this function

extract_struct!(arg)

View Source
extract_struct!(
  {map(),
   %DiscordBotList.Struct.User{
     admin: term(),
     avatar: term(),
     banner: term(),
     bio: term(),
     certified_dev: term(),
     color: term(),
     def_avatar: term(),
     discriminator: term(),
     id: term(),
     mod: term(),
     social: term(),
     supporter: term(),
     username: term(),
     web_mod: term()
   }}
) :: %DiscordBotList.Struct.User{
  admin: term(),
  avatar: term(),
  banner: term(),
  bio: term(),
  certified_dev: term(),
  color: term(),
  def_avatar: term(),
  discriminator: term(),
  id: term(),
  mod: term(),
  social: term(),
  supporter: term(),
  username: term(),
  web_mod: term()
}

Extract the struct from the map - struct pipeline.

Link to this function

get_for_user(id \\ "", token \\ nil)

View Source
get_for_user(id :: String.t() | integer(), token :: String.t() | nil) :: t()

Get the data about a user when supplying the user id.