Skip to content

Welcome (Free)

Sayad Uddin Tahsin edited this page Apr 9, 2023 · 3 revisions

class WelcomeLeaveFree

Make Welcome or Leave image for free!

Parameters

  • template_no (int): The Template Integer. The theme integer must be within 1 - 7
  • background (str): The Background Image name
  • type (str): Type for the Image
  • username (str): Username of the User
  • avatar_url (str): User Avatar URL (Format must be .jpg or .png)
  • discriminator (str): User discriminator
  • guildName (str): Guild Name
  • memberCount (int): Guild Member Count
  • textcolor (str): Text Color
  • key (str): The API Key (no need to be valid)
  • font_no (int, optional): Font Number Integer
  • Filename(str, optional): The File name
Returns
  • str: Base64 Encoded text

Exceptions

  • InvalidTemplate: Raised when an invalid template integer is given. The theme integer must be within 1 - 7.

  • InvalidBackground: Raised when an invalid background is given. The valid options for background are stars, stars2, rainbowgradient, rainbow, sunset, night, blobday, blobnight, space, gaming1, gaming2, gaming3 or gaming4. Make sure to choose one of these options as background.

  • InvalidFont: Raised when an invalid font integer is given. The font integer must be within 1 - 10.

  • InvalidType: Raised when an invalid Type is given. Type must be join or leave.

  • InvalidTextColor: Raised when an invalid Text Color is given. Text Color must be red, orange, yellow, green, blue, indigo, purple, pink, black or white.

  • InvalidAvatarURL: Raised when the Avatar URL with unsupported file format is given rather than .jpg or .png.

  • InvalidFileFormat: Raised when an unsupported file format is given.

  • ImageRetrieveError: Raised when fails to load the image.

  • ImageNotFound: Raised when fails to save the image.

Example

from sra import welcome

# Discord Avatar
avatar_url = "https://res.cloudinary.com/dvx7o1atn/image/upload/v1680858950/Tahsin_AVATR_astronaut_yannbh.png"

# Save the Image
welcome.WelcomeLeaveFree(5, 'gaming4', 'join', 'Tahsin', avatar_url, '0242', "Random Server", 900, 'indigo', key="API_KEY")
Clone this wiki locally