Getting Started#

Unbelipy is a simple library to interact with UmbelievaBoat’s API asynchronously.

To start out generate your app token here. Don’t forget to also authorize your app in your servers.

To use, first import UnbeliClient from unbelipy and instantiate the client with your UnbelievaBoat API’s token. The client has these public methods:

Always remember to close the inner session before your program exists using UnbeliClient.close_session() this will prevent a lot of ugly errors from unclosed client session.

client = UnbeliClient(...)
# now use the client as you please
...
# before your program exits:
await unbeliclient.close_session()

Basic Use Example#

from unbelipy import UnbeliClient
UNB_API_TOKEN = "..."

# In a coroutine
guild_info = await unbeliclient.get_guild(guild_id)
guild_leaderboard = await unbeliclient.get_guild_leaderboard(guild_id)
user_balance = await unbeliclient.get_user_balance(
    guild_id=guild_id,
    user_id=member_id
)
edited_balance = await unbeliclient.edit_user_balance(
    guild_id=guild_id,
    user_id=member_id,
    cash=500,
    reason="showing off PATCH method"
)
new_balance = await unbeliclient.set_user_balance(
    guild_id=guild_id,
    user_id=member_id,
    cash=-500,
    reason="showing off PUT method"
)
await unbeliclient.close_session() # important to exit cleanly