Skip to content

Function Documentation

suspectedesp edited this page Apr 10, 2025 · 3 revisions

Bot Hosting Wrapper - Function Documentation

This wiki page provides an overview of all functions available in the bot-hosting-wrapper module. NOTE: This wiki page was automatically created by a module called pydoc-markdown

Installation

pip install bot-hosting-wrapper

Table of Contents

bot_hosting_wrapper

*

*

*

*

webbrowser

get_auth_id

def get_auth_id() -> None

Prints a quick instruction on how to get the auth id

Returns:

None

bot_hosting_wrapper.about

requests

Fore

datetime

timezone

Any

urls

server_urls

Account Objects

class Account()

__init__

def __init__(auth_id)

Initializes an Account object with the given auth id.

Arguments:

  • auth_id str - The auth id of the account.

coins_amount

def coins_amount() -> (Any | dict[str, str] | str)

Gets the total amount of your coins.

Returns:

The coin amount or a dictionary with an error message and status code if the request failed. {Error, Message}

affiliate_data

def affiliate_data() -> (dict[str, Any] | str)

Returns affiliate data (coins/referral, uses and your link)

Returns:

If status code is 200 and no error occurs:

about

def about()

Will give you a quick overview of your account. Returns a dictionary with account details or an 'error' message if something goes wrong.

id_check

def id_check(about=False)

Checks if your Auth ID is valid. Params: about (bool): If True, print user info in the console. Default is False.

sftp_pass

def sftp_pass()

This will generate a new SFTP password

claimable

def claimable()

Check if free coins are claimable and the time left

Server Objects

class Server()

__init__

def __init__(auth_id)

change_language

def change_language(language=None, server_id: str = None)

Changes the programming language of a specified server.

Params: language (str, required): The programming language to switch to (java, python, nodejs, lua, deno, nodemon). server_id (str, required): The server ID.

Returns:

  • dict - Success or error message.

get_info

def get_info(specific_info=None,
             everything=False,
             selected_server_id: str = None) -> dict | str

Fetches details about a selected server. Params: specific_info (str, optional): The specific info to retrieve (e.g., "cpu", "ram"). everything (bool, optional): Whether to return all server info. selected_server_id (str, optional): The server ID to query.

Returns:

dict or str: A dictionary with server info if everything=True, or a specific info string. Returns a dictionary with an error message in case of failure.

show

def show()

Shows all your servers

delete

def delete(server_id: int)

This function gets all your server ids and on your request deletes a certain one (only with your confirmation) If server_id is provided, deletes that server directly; otherwise, prompts user for server selection.

bot_hosting_wrapper.interactive

requests

sys

datetime

timezone

os_name

system

Interactive Objects

class Interactive()

__init__

def __init__(auth_id)

Initializes the interactive Class

Arguments:

  • auth_id str - The auth id of the account.

cls

@staticmethod
def cls()

get_info

def get_info() -> None

First gets all your servers, then you can select a certain one, and it shows you the specific info about it Such as: Renewal, Identifier, Server ID, if its suspended, etc.

bot_hosting_wrapper.panel

json

requests

Panel Objects

class Panel()

__init__

def __init__(api_key, server_id=None)

Initialize Panel class.

Arguments:

get_serverlist

def get_serverlist(page=1)

get_server_uuid

def get_server_uuid(identifier=None, name=None)

get_server_identifier

def get_server_identifier(uuid=None, name=None)

get_server_name

def get_server_name(uuid=None, identifier=None)

get_directory

def get_directory(server_id=None, directory: str = None)

check_permissions

def check_permissions()

check_account

def check_account()

get_2fa_code

def get_2fa_code()

Generates a TOTP QR code image to allow the setup of 2FA

enable_2fa

def enable_2fa(totp_code)

Enables TOTP 2FA by sending a POST request to the provided URL.

Arguments:

  • totp_code str - The Time-based One-Time Password (TOTP) generated from GET /account/two-factor or the get_2fa_code function.

Returns:

dict or str: The JSON response if successful, or an error message with the status code and content.

disable_2fa

def disable_2fa(password)

Enables TOTP 2FA by sending a POST request to the provided URL.

Arguments:

  • password str - Existing Password | there is no info on how to get it lol

Returns:

bool or dict: true if successful, or an error message with the status code and content.

Info: There is currently no way to obtain the password from the panel.

get_server_resources

def get_server_resources(server_id)

Retrieves the current resource usage of a specified server.

Arguments:

  • server_id str - The unique identifier of the server. If not provided, the server_id attribute of the Panel instance will be used.

Returns:

  • dict - A dictionary containing the formatted resource usage information. If an error occurs, it returns a dictionary with an "Error" key set to True.

    The returned dictionary has the following structure: { "Memory MB": "Memory usage GB", "Memory GB": "Memory usage in MB", "Network Inbound": "Inbound network traffic in MB", "Network Outbound": "Outbound network traffic in MB", "Disk Usage MB": "Disk usage in MB", "Disk GB": "Disk usage in GB" } Every value inside of the dictionary is currently a string

bot_hosting_wrapper.vasync.about

aiohttp

Fore

datetime

timezone

Any

urls

server_urls

Account Objects

class Account()

__init__

def __init__(auth_id)

Initializes an Account object with the given auth id.

Arguments:

  • auth_id str - The auth id of the account.

coins_amount

async def coins_amount() -> (Any | dict[str, str] | str)

Gets the total amount of your coins.

Returns:

The coin amount or a dictionary with an error message and status code if the request failed. {Error, Message}

affiliate_data

async def affiliate_data() -> (dict[str, Any] | str)

Returns affiliate data (coins/referral, uses and your link)

Returns:

If status code is 200 and no error occurs:

about

async def about()

Will give you a quick overview of your account. Returns a dictionary with account details or an 'error' message if something goes wrong.

id_check

async def id_check(about=False)

Checks if your Auth ID is valid. Params: about (bool): If True, print user info in the console. Default is False.

sftp_pass

async def sftp_pass()

This will generate a new SFTP password

claimable

async def claimable()

Check if free coins are claimable and the time left

Server Objects

class Server()

__init__

def __init__(auth_id)

change_language

async def change_language(language=None, server_id: str = None)

Changes the programming language of a specified server.

Params: language (str, required): The programming language to switch to (java, python, nodejs, lua, deno, nodemon). server_id (str, required): The server ID.

Returns:

  • dict - Success or error message.

get_info

async def get_info(specific_info=None,
                   everything=False,
                   selected_server_id: str = None) -> dict | str

Fetches details about a selected server. Params: specific_info (str, optional): The specific info to retrieve (e.g., "cpu", "ram"). everything (bool, optional): Whether to return all server info. selected_server_id (str, optional): The server ID to query.

Returns:

dict or str: A dictionary with server info if everything=True, or a specific info string. Returns a dictionary with an error message in case of failure.

show

async def show()

Shows all your servers

delete

async def delete(server_id=None)

This function gets all your server ids and on your request deletes a certain one (only with your confirmation) If server_id is provided, deletes that server directly; otherwise, prompts user for server selection.