Models

All the public models for the API.

AnimalFacts

class somerandomapi.AnimalImageFact[source]

Represents an animal image

This class is not meant to be instantiated by the user. Instead, get it through the get_image_and_fact() method on the AnimalClient.

fact

The animal fact.

image

The animal image URL.

class somerandomapi.AnimalImageOrFact[source]

Represents an animal image or fact.

This class is not meant to be instantiated by the user. Instead, get it through the get_image_or_fact() method on the AnimalClient.

fact

The animal fact if available.

image

The animal image URL if available.

AnimuQuote

class somerandomapi.AnimuQuote[source]

Represents an animu quote.

This class is not meant to be instantiated by the user. Instead, access it through the random_quote() method of the AnimuClient class.

anime

The anime the quote is from.

id

The ID of the quote.

name

The name of the character who said the quote.

quote

The quote.

ChatbotResult

class somerandomapi.ChatbotResult[source]
message

The input message

response

The response message

EncodeResult

class somerandomapi.EncodeResult[source]

Represents the result of an encoding.

input

The input text.

name

The name of the encoding.

text

The encoded/decoded text.

property type

The type of the result.

Image

class somerandomapi.Image[source]

Represents a class for all image endpoints.

async file(cls, filename='image.png', **kwargs)[source]

Converts the image to a file-like object.

Parameters:
  • cls (FileLike) – The file-like object to convert the image to. E,g, discord.File (discord.py)

  • filename (str) – The filename to use.

Returns:

An instance of the file-like object.

Return type:

FileLike

async read(bytesio=True)[source]

Returns the image data.

Parameters:

bytesio (bool) – Whether to return the data as a io.BytesIO object. Defaults to True.

Returns:

The image data.

Return type:

Union[bytes, io.BytesIO]

property url

The image URL.

Type:

str

Lyrics

class somerandomapi.Lyrics[source]
artist

The artist of the song.

lyrics

The lyrics of the song.

thumbnail

The URL to the thumbnail of the song.

title

The title of the song.

url

The URL to more information about the song.

GenshinNamecard

class somerandomapi.GenshinNamecard[source]

Represents a genshin namecard.

avatar_url

The avatar URL of the user. Must be .png or .jpg.

Type:

str

birthday

The birthday, dd/mm/yyyy

description

The description

username

The username

Pokemon

Classes representing the different pokemon endpoints

WithName

WithName

class somerandomapi.WithName[source]

WithNameID

WithNameID

class somerandomapi.WithNameID[source]

WithNameIDAndEffects

class somerandomapi.WithNameIDAndEffects[source]

WithVersion

class somerandomapi.WithVersion[source]

WithVersionAndDescription

class somerandomapi.WithVersionAndDescription[source]

PokemonMove

class somerandomapi.PokemonMove[source]

Represents a Pokemon’s move.

name

The name of the move.

Type:

str

id

The ID of the move.

Type:

int

effects

The effects of the move.

Type:

str

generation

The generation of the move.

Type:

int

type

The type of the move.

Type:

str

category

The category of the move.

Type:

str

contest

The contest of the move.

Type:

str

pp

The PP of the move.

Type:

int

power

The power of the move.

Type:

int

accuracy

The accuracy of the move.

Type:

int

pokemon

A list of Pokemon’s that have this move.

Type:

List[str]

property descriptions

A list of descriptions with their version.

Returns:

  • An object with the following attributes

  • - ``version`` (str) – The version of the description.

  • - ``description`` (str) – The description of the move.

PokemonItem

class somerandomapi.PokemonItem[source]

Represents a Pokemon’s item.

name

The name of the item.

Type:

str

id

The ID of the item.

Type:

int

effects

The effects of the item.

Type:

str

cost

The cost of the item.

Type:

int

category

The category of the item.

Type:

str

sprite

The sprite of the item.

Type:

str

property descriptions

A list of descriptions with their version.

Returns:

  • An object with the following attributes

  • - ``version`` (str) – The version of the description.

  • - ``description`` (str) – The description of the item.

PokemonAbility

class somerandomapi.PokemonAbility[source]

Represents a Pokemon’s ability.

name

The name of the ability.

Type:

str

id

The ID of the ability.

Type:

int

effects

The effects of the ability.

Type:

str

generation

The generation of the ability.

Type:

int

description

The description of the ability.

Type:

str

property descriptions

A list of descriptions with their version.

Returns:

  • An object with the following attributes

  • - ``version`` (str) – The version of the description.

property pokemons

A list of Pokemon’s that have this ability.

Type:

List[PokemonAbilityPokemons]

PokemonAbilityPokemons

class somerandomapi.PokemonAbilityPokemons[source]

Represents a Pokemon’s ability.

pokemon

The name of the Pokemon.

Type:

str

hidden

Whether the ability is hidden or not.

Type:

bool

PokeDex

class somerandomapi.PokeDex[source]

Represents a Pokedex

name: str

The name of the Pokemon.

id: str

The id of the Pokemon.

type: List[str]

A list of the Pokemon’s types.

species: List[str]

A list of the Pokemon’s species.

abilities: List[str]

A list of the Pokemon’s abilities.

height: str

The height of the Pokemon.

base_experience: str

The base experience of the Pokemon.

gender: List[str]

List of genders for the Pokemon.

egg_groups: List[str]

List of egg groups for the Pokemon.

description: str

The description of the Pokemon.

generation: str

The generation of the Pokemon.

property family

The family of the Pokemon.

Type:

PokeDexFamily

property sprites

The sprites of the Pokemon.

Type:

PokeDexSprites

property stats

The stats of the Pokemon.

Type:

PokeDexStats

PokeDexFamily

class somerandomapi.PokeDexFamily[source]

Represents a Pokemon’s family.

evolution_stage

The evolution stage of the Pokemon.

Type:

int

evolution_line

A list of the Pokemon’s evolution line.

Type:

List[str]

PokeDexStats

class somerandomapi.PokeDexStats[source]

Represents a Pokemon’s stats.

hp

The HP of the Pokemon.

Type:

str

attack

The attack of the Pokemon.

Type:

str

defense

The defense of the Pokemon.

Type:

str

special_attack

The special attack of the Pokemon.

Type:

str

special_defence

The special defence of the Pokemon.

Type:

str

speed

The speed of the Pokemon.

Type:

str

total

The total of the Pokemon.

Type:

str

PokeDexSprites

class somerandomapi.PokeDexSprites[source]

Represents a Pokemon’s sprites.

normal

The normal sprite of the Pokemon.

Type:

str

animated

The animated sprite of the Pokemon.

Type:

str

Rankcard

class somerandomapi.Rankcard[source]

Represents a rank card.

avatar_url

The avatar URL of the user. Must be .png or .jpg.

background_color

The custom background color of the rank card. Tier 1+ key required.

Can put “random” to get a random color.

This cannot be used with background.

background_url

The custom background of the rank card as url. Tier 2+ key required.

This cannot be used with background_color.

current_xp

The current XP of the user.

current_xp_color

The color of the current XP as hex.

Can put “random” to get a random color.

discriminator

The discriminator of the user.

Will be stripped if equal to 0

level

The current level of the user.

needed_xp

The needed XP to level up.

template

The template to use. Must be a number between 1 and 9.

Added in version 0.1.0.

text_color

The custom text color of the rank card as hex.

Can put “random” to get a random color.

username

The username of the user. Max 32 characters.

username_color

The color of the username as hex.

Can put “random” to get a random color.

Added in version 0.1.0.

xp_bar_color

The color of the XP bar as hex.

Can put “random” to get a random color.

RGB

class somerandomapi.RGB[source]

Represents an RGB color.

property as_tuple

Returns the RGB values as a tuple.

b

The blue value of the color.

g

The green value of the color.

r

The red value of the color.

Tweet

class somerandomapi.Tweet[source]

Represents a tweet.

avatar_url

The avatar URL of the user. Must be .png or .jpg.

Type:

str

display_name

The display name of the user. Max 32 characters.

Type:

str

likes

The amount of likes the tweet is supposed to have.

Type:

Optional[int]

replies

The amount of replies the tweet is supposed to have.

Type:

Optional[int]

retweets

The amount of retweets the tweet is supposed to have.

Type:

Optional[int]

text

The text of the tweet. Max 1000 characters.

Type:

str

theme

The theme of the tweet. Defaults to LIGHT.

Type:

TweetTheme

username

The username of the user. Max 15 characters.

Type:

str

YoutubeComment

class somerandomapi.YoutubeComment[source]

Represents a Youtube Comment.

avatar_url

The avatar URL of the user. Must be .png or .jpg.

text

The text of the comment. Max 1000 characters.

username

The username of the user. Max 25 characters.

Welcome

Classes to generate a welcome image.

WelcomeFree

class somerandomapi.WelcomeFree[source]

Represents a free welcome image.

avatar_url

The avatar URL of the user. Must be .png or .jpg.

background

The background.

discriminator

The discriminator of the user.

Will be stripped if equal to 0

font

The font from a predefined list. Choose a number between 0 and 7.

Changed in version 0.1.0: This takes a range of 0-7 now instead of 0-10.

member_count

The member count.

server_name

The server name.

template

The template from a predefined list. Choose a number between 1 and 7.

text_color

The text color.

type

The type.

username

The username of the user.

WelcomePremium

class somerandomapi.WelcomePremium[source]

Represents a premium welcome image.

avatar_url

The avatar URL of the user. Must be .png or .jpg.

background_url

The background image URL.

discriminator

The discriminator of the user.

Will be stripped if equal to 0

font

The font from a predefined list. Choose a number between 0 and 7.

Changed in version 0.1.0: This takes a range of 0-7 now instead of 0-8.

member_count

The member count.

server_name

The server name.

template

The template from a predefined list. Choose a number between 1 and 7.

text_color

The text color.

type

The type.

username

The username of the user.