Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

stayberri/weeb.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

weeb.py

PyPI PyPI

An API wrapper in Python for weeb.sh!

Weeb.sh is a private, invite only API for bot developers. In order to use this wrapper, you must have access to the API yourself. If you have access, make sure to replace all instances of "token" with your actual token, such as Bearer <token> or Wolke <token>, dependent on your token type. Bearer for BearerTokens and Wolke for WolkeTokens.

Please note that the generate_image, generate_status, generate_waifu_insult and generate_license functions are locked to certain permission nodes. If you have never asked for these, you probably do not have them.

Installation

pip install weeb.py

Documentation

Normal docs
Image gen docs

Note that all these functions must be awaited, and thus can only be used inside of an async function.

Get all Types

import weeb

sh_client = weeb.Client(token="token", user_agent="Weeb.py/1.1.0")
                                    # User agent is formatted as NAME/VERSION

async def async_thing():
    types = await sh_client.get_types()  # returns a list
    print(types)

Get all Tags

import weeb

sh_client = weeb.Client(token="token", user_agent="Weeb.py/1.1.0")
                                    # User agent is formatted as NAME/VERSION

async def async_thing():
    tags = await sh_client.get_tags()  # returns a list
    print(tags)

Get Random Image

import weeb

sh_client = weeb.Client(token="token", user_agent="Weeb.py/1.1.0")
                                    # User agent is formatted as NAME/VERSION

async def async_thing():
    img = await sh_client.get_image(imgtype='bite', nsfw=False, filetype="gif")
    print(img[0])  # prints the image url
    print(img[1])  # prints the image ID
    print(img[2])  # prints the file type

Generate an Image (Requires simple Image-Gen scope)

import weeb

sh_client = weeb.Client(token="token", user_agent="Weeb.py/1.1.0")
                                    # User agent is formatted as NAME/VERSION

async def async_thing():
    # requires simpleimage gen scope. can be awooo, won, or eyes (awooo allows for hair and face as parameters to colour them)
    with open('./path/to/images/file.png', 'wb') as f:
        f.write(await sh_client.generate_image(imgtype='won'))
        # this saves to the path you set it to, even if 'file.png' doesn't exist

Generate a Discord Status Mock (Requires simple Image-Gen scope)

import weeb

sh_client = weeb.Client(token="token", user_agent="Weeb.py/1.1.0")
                                    # User agent is formatted as NAME/VERSIONN

async def async_thing():
    with open('./path/to/images/file.png', 'wb') as f:
        f.write(await sh_client.generate_status(status='online', avatar='https://cdn.discordapp.com/avatars/267207628965281792/f2f0b2f75710e334095132f33e15bce0.png'))
        # this saves to the path you set it to, even if 'file.png' doesn't exist

Generate a Waifu Insult (Requires Waifu-Image Scope)

import weeb

sh_client = weeb.Client(token="token", user_agent="Weeb.py/1.1.0")
                                    # User agent is formatted as NAME/VERSIONN

async def async_thing():
    with open('./path/to/images/file.png', 'wb') as f:
        f.write(await sh_client.generate_waifu_insult(avatar='https://cdn.discordapp.com/avatars/267207628965281792/f2f0b2f75710e334095132f33e15bce0.png'))
        # this saves to the path you set it to, even if 'file.png' doesn't exist

Generate a License (Requires License Scope)

import weeb

sh_client = weeb.Client(token="token", user_agent="Weeb.py/1.1.0")
                                    # User agent is formatted as NAME/VERSIONN

async def async_thing():
    with open('./path/to/images/file.png', 'wb') as f:
        f.write(await sh_client.generate_license(title="Spook License", avatar="https://imgur.com/zPn0DYT.png", badges=["https://imgur.com/zPn0DYT.png", "https://imgur.com/zPn0DYT.png", "https://imgur.com/zPn0DYT.png"], widgets=["1", "2", "3"]))
        # this saves to the path you set it to, even if 'file.png' doesn't exist

Generate a Love Ship (Requires Love Ship Scope)

import weeb

sh_client = weeb.Client(token="token", user_agent="Weeb.py/1.1.0")
                                    # User agent is formatted as NAME/VERSIONN

async def async_thing():
    with open('./path/to/images/file.png', 'wb') as f:
        f.write(await sh_client.generate_love_ship(target_one="https://cdn.discordapp.com/avatars/267207628965281792/f2f0b2f75710e334095132f33e15bce0.png", target_two="https://cdn.discordapp.com/avatars/132584525296435200/8c7423df35ef1258db65451a011d63ca.png"))
        # this saves to the path you set it to, even if 'file.png' doesn't exist

About

An API wrapper in Python for weeb.sh!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages