-
Notifications
You must be signed in to change notification settings - Fork 8
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
pip install bot-hosting-wrapperclass Account()def __init__(auth_id)Initializes an Account object with the given auth id. Args: auth_id (str): The auth id of the account.
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}
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:
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.
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.
def sftp_pass()This will generate a new SFTP password
def claimable()Check if free coins are claimable and the time left
class Server()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.
def get_info(specific_info=None,
everything=False,
selected_server_id: str = None) -> dict | strFetches 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.
def show()Shows all your servers
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.
class Interactive()def __init__(auth_id)Initializes the interactive Class Args: auth_id (str): The auth id of the account.
def get_info() -> NoneFirst 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.
class Panel()def __init__(api_key, server_id=None)Initialize Panel class. Args: api_key (str): Bot-Hosting.net API key (https://control.bot-hosting.net/account/api) server_id (str): Optional, server ID for which to retrieve resources. Defaults to None.
def get_2fa_code()Generates a TOTP QR code image to allow the setup of 2FA
def enable_2fa(totp_code)Enables TOTP 2FA by sending a POST request to the provided URL.
Args: 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.
def disable_2fa(password)Enables TOTP 2FA by sending a POST request to the provided URL.
Args: 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.
def get_server_resources(server_id)Retrieves the current resource usage of a specified server.
Parameters: 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
@staticmethod
def get_auth_id() -> NonePrints a quick instruction on how to get the auth id Returns: None