DiscordBotList v0.1.0 DiscordBotList.Struct.Bot View Source

Struct representing the Bot object.

Link to this section Summary

Types

The avatar hash of the bot's avatar.

The certified status of the bot.

The date when the bot was approved.

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

The discriminator of the bot.

The guild id for the donatebot setup.

The link to the github repo of the bot.

The guilds featured on the bot page.

The id of the bot.

The custom bot invite url of the bot

The library of the bot.

The long description of the bot. Can contain HTML and/or Markdown.

The owners of the bot. First one in the array is the main owner.

The amount of upvotes the bot has this month.

The prefix of the bot.

The short description of the bot.

The support server invite code of the bot.

t()

The tags of the bot.

The username of the bot.

The vanity url of the bot.

The website url of the bot.

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 info about multiple bots. You can use custom parameters here to get the wanted info.

Get info about a single bot. Returns DiscordBotList.Struct.Bot struct. If you had not supplied the application already or want to override the token and id for a single call, you can suplly it here.

Link to this section Types

The avatar hash of the bot's avatar.

Link to this type

certified_bot()

View Source
certified_bot() :: boolean()

The certified status of the bot.

The date when the bot was approved.

Link to this type

def_avatar()

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

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

Link to this type

discriminator()

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

The discriminator of the bot.

Link to this type

donatebot_guild_id()

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

The guild id for the donatebot setup.

The link to the github repo of the bot.

The guilds featured on the bot page.

The id of the bot.

The custom bot invite url of the bot

The library of the bot.

Link to this type

longdesc()

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

The long description of the bot. Can contain HTML and/or Markdown.

The owners of the bot. First one in the array is the main owner.

The amount of upvotes the bot has this month.

The prefix of the bot.

Link to this type

shortdesc()

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

The short description of the bot.

The support server invite code of the bot.

Link to this type

t()

View Source
t() :: %DiscordBotList.Struct.Bot{
  avatar: String.t(),
  certified_bot: boolean(),
  date: DateTime.t(),
  def_avatar: String.t(),
  discriminator: String.t(),
  donatebot_guild_id: String.t(),
  github: String.t(),
  guilds: [String.t()],
  id: String.t(),
  invite: String.t(),
  lib: String.t(),
  longdesc: String.t(),
  monthly_points: integer(),
  owners: [String.t()],
  points: integer(),
  prefix: String.t(),
  shortdesc: String.t(),
  support: String.t(),
  tags: [String.t()],
  username: String.t(),
  vanity: String.t(),
  website: String.t()
}

The tags of the bot.

Link to this type

username()

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

The username of the bot.

The vanity url of the bot.

The website url of the bot.

Link to this section Functions

Link to this function

add_data(arg, map_key, struct_key)

View Source
add_data(
  {map(),
   %DiscordBotList.Struct.Bot{
     avatar: term(),
     certified_bot: term(),
     date: term(),
     def_avatar: term(),
     discriminator: term(),
     donatebot_guild_id: term(),
     github: term(),
     guilds: term(),
     id: term(),
     invite: term(),
     lib: term(),
     longdesc: term(),
     monthly_points: term(),
     owners: term(),
     points: term(),
     prefix: term(),
     shortdesc: term(),
     support: term(),
     tags: term(),
     username: term(),
     vanity: term(),
     website: term()
   }},
  String.t(),
  atom()
) ::
  {map(),
   %DiscordBotList.Struct.Bot{
     avatar: term(),
     certified_bot: term(),
     date: term(),
     def_avatar: term(),
     discriminator: term(),
     donatebot_guild_id: term(),
     github: term(),
     guilds: term(),
     id: term(),
     invite: term(),
     lib: term(),
     longdesc: term(),
     monthly_points: term(),
     owners: term(),
     points: term(),
     prefix: term(),
     shortdesc: term(),
     support: term(),
     tags: term(),
     username: term(),
     vanity: term(),
     website: 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.Bot{
     avatar: term(),
     certified_bot: term(),
     date: term(),
     def_avatar: term(),
     discriminator: term(),
     donatebot_guild_id: term(),
     github: term(),
     guilds: term(),
     id: term(),
     invite: term(),
     lib: term(),
     longdesc: term(),
     monthly_points: term(),
     owners: term(),
     points: term(),
     prefix: term(),
     shortdesc: term(),
     support: term(),
     tags: term(),
     username: term(),
     vanity: term(),
     website: term()
   }},
  [atom()]
) ::
  {map(),
   %DiscordBotList.Struct.Bot{
     avatar: term(),
     certified_bot: term(),
     date: term(),
     def_avatar: term(),
     discriminator: term(),
     donatebot_guild_id: term(),
     github: term(),
     guilds: term(),
     id: term(),
     invite: term(),
     lib: term(),
     longdesc: term(),
     monthly_points: term(),
     owners: term(),
     points: term(),
     prefix: term(),
     shortdesc: term(),
     support: term(),
     tags: term(),
     username: term(),
     vanity: term(),
     website: 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.Bot{
     avatar: term(),
     certified_bot: term(),
     date: term(),
     def_avatar: term(),
     discriminator: term(),
     donatebot_guild_id: term(),
     github: term(),
     guilds: term(),
     id: term(),
     invite: term(),
     lib: term(),
     longdesc: term(),
     monthly_points: term(),
     owners: term(),
     points: term(),
     prefix: term(),
     shortdesc: term(),
     support: term(),
     tags: term(),
     username: term(),
     vanity: term(),
     website: 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.Bot{
     avatar: term(),
     certified_bot: term(),
     date: term(),
     def_avatar: term(),
     discriminator: term(),
     donatebot_guild_id: term(),
     github: term(),
     guilds: term(),
     id: term(),
     invite: term(),
     lib: term(),
     longdesc: term(),
     monthly_points: term(),
     owners: term(),
     points: term(),
     prefix: term(),
     shortdesc: term(),
     support: term(),
     tags: term(),
     username: term(),
     vanity: term(),
     website: term()
   }}
) :: %DiscordBotList.Struct.Bot{
  avatar: term(),
  certified_bot: term(),
  date: term(),
  def_avatar: term(),
  discriminator: term(),
  donatebot_guild_id: term(),
  github: term(),
  guilds: term(),
  id: term(),
  invite: term(),
  lib: term(),
  longdesc: term(),
  monthly_points: term(),
  owners: term(),
  points: term(),
  prefix: term(),
  shortdesc: term(),
  support: term(),
  tags: term(),
  username: term(),
  vanity: term(),
  website: term()
}

Extract the struct from the map - struct pipeline.

Link to this function

get_multi(config \\ [])

View Source
get_multi(keyword()) :: %{
  bots: [t()] | nil,
  count: integer() | nil,
  limit: integer() | nil,
  offset: integer() | nil,
  total: integer() | nil
}

Get info about multiple bots. You can use custom parameters here to get the wanted info.

## Parameters

  • token :: String.t(), usage: token: your_token.
  • limit :: integer() usage: limit: 10 (default is 50, maximum is 500).
  • offset :: integer() usage: offset: 10.
  • search :: keyword() usage: search: [username: "my_name"].
  • sort :: String.t() usage: sort: "id".

    Examples

    iex> get_multi() iex> get_multi(limit: 25, offset: 5, search: [username: "Poke"]) iex> get_multi(limit: 10, sort: "id")

Link to this function

get_single(config \\ [])

View Source
get_single(config :: keyword()) :: t()

Get info about a single bot. Returns DiscordBotList.Struct.Bot struct. If you had not supplied the application already or want to override the token and id for a single call, you can suplly it here.

## Parameters

  • token :: String.t(), usage: token: your_token
  • id :: String.t() usage: id: your_id

    Examples

    iex> get_single() iex> get_single(token: your_token, id: your_id) iex> get_single(token: your_token) iex> get_single(id: your_id)