Skip to content

DiamondDemon669/unbelievaboat.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

unbelievaboat.py

Unbelievaboat API for python

Docs

Getting started

  1. Download unbelievaboat.py
  2. Enter this code into your discord.py bot
from unbelievaboat import client
unbclient = client(API_TOKEN)

API functions

get_user_bal(string: guild_id, string: user_id)

Gets the users balance

Returns: {"rank": string: rank, "user_id": string: user_id, "cash": integer: cash_balance, "bank": integer: bank_balance, "total": integer: cash + bank}

set_user_bal(string: guild_id, string: user_id, integer: cash=0, integer: bank=0, string: reason=None)

Sets the users balance

Returns: {"user_id": string: user_id, "cash": integer: cash_balance, "bank": integer: bank_balance, "total": integer: cash + bank}

change_user_bal(string: guild_id, string: user_id, integer: cash=0, integer: bank=0, string: reason=None)

Changes user balance

Negative cash and bank values supported

Returns: {"user_id": string: user_id, "cash": integer: cash_balance, "bank": integer: bank_balance, "total": integer: cash + bank}

get_leaderboard(string: guild_id, string: sort='total', string: limit=None, string: offset='1', string: page=None)

Gets the guild leaderboard

sort and offset CANNOT be None

Returns list of get_user_bal() outputs

get_guild(string: guild_id)

Gets info about a guild

Returns: {"id": string: guild_id, "name": string: guild_name, "icon": string: icon_hash, "owner_id": string: guild_owner_id, "member_count": integer: num_of_members, "symbol": string: unbelievaboat_currency_symbol}

get_app_perms(string: guild_id)

Gets permissions for a guild

Returns 1 if you have permission and 0 if you dont

Exceptions

invalidData

The data you submitted is invalid, try again with valid data

invalidPermissions

Your API token is invalid, or you do not have permission to edit economy on this guild

internetForbidden

You do not have permission to access this URL, are you sure you entered in the right data?

unexpectedURL

This URL doesnt exist, are you sure you entered in the right data?

requestOverload

You are sending too many requests, too quickly

serverError

Unbelievaboat server error. try again later

Extensions

The extension includes functions not present in the base API

To use it, use this code instead

from unbelievaboat-ext import client
unbclient = client('API_TOKEN')

All functions from the main module work and you have to download the main module as well as unbelievaboat-ext.py

reset_economy(string: guild_id)

Sets all users balance to zero (bank and cash)

Doesn't return anything

change_bal_all(string: guild_id, integer: cash=0, integer: bank=0)

Changes all users balance

Doesn't return anything

set_bal_all(string: guild_id, integer: cash=0, integer: bank=0)

Sets all users balance

Doesn't return anything