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.
pip install weeb.py
Note that all these functions must be awaited, and thus can only be used inside of an async function.
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)
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)
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
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
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
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
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
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