Image generation¶
This module represents the image generation interface.
Note
All images retrieved with this module are placed in system default temporary folder. If the system doesn’t have a temporary folder images are placed in a current directory. Please note that you should practice file deletion after usage.
Image file object¶
To simplify file manipulation here is a weebapi.data_objects.ImageFile
object.
This also integrates nicely with discord.py
Note
By accessing the discord_file
property you can get discord.File
object.
-
class
weebapi.data_objects.
ImageFile
(file_path: str)[source]¶ Represents a image file object usually retrieved from image generation.
-
discord_file
¶ discord.File
– If discord.py is installed it returns adiscord.File
object, else raises an exception.
- Raises
weebapi.errors.DiscordPyNotInstalled
– Raised if discord.py is not installed, butdiscord.File
object is requested.
-
Generators¶
Here is the list and the description of all available generators.
Note
Thus this is represented as a separate class, it’s loaded automatically into the weebapi.Client
.
If we assume that your client object is weeb = Client(token="SomeToken123")
then you access simple
image generator like this: generator = await weeb.img_gen.get_simple("won")
.
-
class
weebapi.img_gen.
ImgGen
(client)[source]¶ -
discord_status
(status: str = 'online', avatar: str = None) → weebapi.data_objects.ImageFile[source]¶ This function is a coroutine.
Generates a discord status image.
- Available types:
online
idle
dnd
streaming
offline
- Parameters
- Returns
-
get_simple
(img_type: str, face_color: str = None, hair_color: str = None) → weebapi.data_objects.ImageFile[source]¶ This function is a coroutine.
Generates simple image.
- Available types:
awooo
eyes
won
- Parameters
- Returns
-
license
(title: str, avatar: str, badges: list = [], widgets: list = []) → weebapi.data_objects.ImageFile[source]¶ This function is a coroutine.
Generates a spook license.
- Parameters
- Returns
-
love
(avatar1: str, avatar2: str) → weebapi.data_objects.ImageFile[source]¶ This function is a coroutine.
Generates a love image.
- Parameters
- Returns
-