Skip to content
Deviant edited this page May 17, 2024 · 22 revisions

Main class:

Card() - The main class for generating character and profile cards. | Example

Argument:

  • lang - The language in which the data will be acquired. | Type: str | Languages Supported
  • character_art - Transfer artwork to be displayed on cards. | Type: dict | Example
  • character_id - List of character ids to be obtained | Type: str | Example
  • seeleland - Add information from the Seeleland website | Type: bool
  • user_font - Set Custom Font | Type: str | Example
  • save - Save Generated Cards | Type: bool | Doesn't work for animated ones
  • asset_save - Save Assets to Device | Type: bool
  • boost_speed - Loads character assets. | Type: bool | Fills up the device memory
  • remove_logo - Remove GitHub logo from cards | Type: bool
  • enka - Use EnkaNetwork API | Type: bool | MiHoMo API is used by default.
  • cashe - Set Cache Settings | Type: dict | Example
  • api_data - Pass your data received via: api.ApiMiHoMo | Type: MiHoMoApi | Example
  • user_agent - Custom User-Agent | Type: str
  • proxy - Proxy as a string | Type: str
  • color - Set a custom color for a character | Type: dict | Example

Warning

Parameter: boost_speed can fill your device's memory.

Functions: create_profile

  • create_profile() - Function for generating a user profile card. | Example

Argument:

  • uid - UID of the user in the game | Type: int
  • style - Card style. | Type: int | Defaults: 1
  • hide_uid - Hide UID. | Type: bool | Defaults: False
  • background - Link to custom card background. | Type: str | Example
  • force_update - Forced update of user data. | Type: bool | Defaults: False

Functions: create

  • create() - Function for generating character cards. | Example

Argument:

  • uid - UID of the user in the game | Type: int
  • style - Card style. | Type: int | Defaults: 1
  • hide_uid - Hide UID. | Type: bool | Defaults: False
  • force_update - Forced update of user data. | Type: bool | Defaults: False

Note

Subsequent functions must be called before the main functions: create() and create_profile()

Functions: set_lang

  • set_lang() - Function for generating character cards. | Example

Argument:

Functions: set_user_font

  • set_user_font() - Will install a custom font. | Example

Argument:

  • user_font - Font path or font name. | Type: str

Utils function:

Note

Additional functions will be provided here to help with development.

Function: get_link_image

  • get_link_image() - Allows you to save the user's image to the server and access it via a link | Example

Argument:

  • img - Link to image or image in format: base64 | Type: str
  • api_key - The API key was obtained here: https://api.imgbb.com/ | Defaults: None.

Function: is_valid_image

  • is_valid_image() - Check the image from the link or not | Example

Argument:

  • url - Link to image | Type: str
  • session - aiohttp or other session. | Type: session | Defaults: None.
  • allow_redirects - Allow redirection. | Type: bool | Defaults: True.

Important

This function also accepts other parameters related to requests.