DiscordBotList v0.1.0 DiscordBotList.Struct.VoteUser View Source

Module representing the type of user you get when you access the /bot/:id/vote endpoint. This is a subset of the DiscordBotList.Struct.User struct.

Link to this section Summary

Types

The avatar hash of the user's avatar.

The discriminator of the user.

The id of the user.

t()

The username 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 vote users for the bot with the specified token and id. See DiscordBotList.Struct.Bot.get_single/1 for more info arguments. This can maximally index 1000 users. Use webhooks if you want to track for more than 1000 users.

Link to this section Types

The avatar hash of the user's avatar.

Link to this type

discriminator()

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

The discriminator of the user.

The id of the user.

Link to this type

t()

View Source
t() :: %DiscordBotList.Struct.VoteUser{
  avatar: String.t(),
  discriminator: String.t(),
  id: String.t(),
  username: String.t()
}
Link to this type

username()

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

The username 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.VoteUser{
     avatar: term(),
     discriminator: term(),
     id: term(),
     username: term()
   }},
  String.t(),
  atom()
) ::
  {map(),
   %DiscordBotList.Struct.VoteUser{
     avatar: term(),
     discriminator: term(),
     id: term(),
     username: 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.VoteUser{
     avatar: term(),
     discriminator: term(),
     id: term(),
     username: term()
   }},
  [atom()]
) ::
  {map(),
   %DiscordBotList.Struct.VoteUser{
     avatar: term(),
     discriminator: term(),
     id: term(),
     username: 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.VoteUser{
     avatar: term(),
     discriminator: term(),
     id: term(),
     username: 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.VoteUser{
     avatar: term(),
     discriminator: term(),
     id: term(),
     username: term()
   }}
) :: %DiscordBotList.Struct.VoteUser{
  avatar: term(),
  discriminator: term(),
  id: term(),
  username: term()
}

Extract the struct from the map - struct pipeline.

Link to this function

get_for_bot(config \\ [])

View Source
get_for_bot(keyword()) :: [t()]

Get the vote users for the bot with the specified token and id. See DiscordBotList.Struct.Bot.get_single/1 for more info arguments. This can maximally index 1000 users. Use webhooks if you want to track for more than 1000 users.