rbrapi


Namerbrapi JSON
Version 0.6 PyPI version JSON
download
home_pageNone
SummaryUnofficial Python Client for Rocket Bot Royale Game API
upload_time2024-06-20 08:39:17
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords rocket bot royale game api unofficial api python library
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Unofficial Client for RocketBotRoyale Game API

[![Downloads](https://static.pepy.tech/badge/rbrapi)](https://pepy.tech/project/rbrapi)

**⚠️️ For Educational Use Only!**

This is an unofficial Python client for the Rocket Bot Royale game API. It allows users to interact with the game API, including authenticating, retrieving account details, collecting timed bonuses, sending friend requests, and purchasing crates.

## Installation

Install the package using pip:

```
pip install -U rbrapi
```

## Usage

### Initialization

Initialize a `RocketBotRoyale` instance with an email and password:

```python
from rbrapi import RocketBotRoyale
from rbrapi.errors import AuthenticationError

# Initialize with email and password
client = RocketBotRoyale(email="email@example.com", password="your_password")
```

### Authentication

Authenticate with the RocketBotRoyale API using provided credentials:

> **Note:** It auto-authenticates when `RocketBotRoyale` is initialized. Use this only for regenerating the session token.

```python
try:
    client.authenticate()
    print("Authentication successful!")
except AuthenticationError as e:
    print(f"Authentication failed: {e}")
```

### Account Details

Retrieve account details:

```python
try:
    account_details = client.account()
    print(f"Account ID: {account_details.custom_id}")
    print(f"Username: {account_details.user["username"]}")
    print(f"Gems: {account_details.wallet["gems"]}")
    print(f"Coins: {account_details.wallet["coins"]}")
except AuthenticationError as e:
    print(f"Authentication failed: {e}")
```

### Collect Timed Bonus

Collect a timed bonus:

```python
from rbrapi.errors import CollectTimedBonusError

try:
    success = client.collect_timed_bonus()
    if success:
        print("Timed bonus collected successfully!")
    else:
        print("Failed to collect timed bonus.")
except AuthenticationError as e:
    print(f"Authentication failed: {e}")
except CollectTimedBonusError as e:
    print(f"Failed to collect timed bonus: {e}")
```

### Send Friend Request

Send a friend request to another user:

```python
from rbrapi.errors import FriendRequestError

friend_code = "c2829d50"

try:
    success = client.send_friend_request(friend_code)
    if success:
        print("Friend request sent successfully!")
    else:
        print("Failed to send friend request.")
except AuthenticationError as e:
    print(f"Authentication failed: {e}")
except FriendRequestError as e:
    print(f"Failed to send friend request: {e}")
```

### Convert Friend Code to User ID

Convert a friend's code to their user ID:

```python
from rbrapi.errors import AuthenticationError, userNotExistError

friend_code = "c2829d50"

try:
    user_id = client.friend_code_to_id(friend_code)
    print(f"User ID: {user_id}")
except AuthenticationError as e:
    print(f"Authentication failed: {e}")
except userNotExistError as e:
    print(f"User does not exist: {e}")
```

### Purchase Crate

Purchase a crate (regular or elite):

```python
from rbrapi.errors import LootBoxError

try:
    crate_details = client.buy_crate(elite=False)  # Set elite=True for elite crate
    print("Crate purchased successfully!")
    print(f"Crate details: {crate_details}")
except AuthenticationError as e:
    print(f"Authentication failed: {e}")
except LootBoxError as e:
    print(f"Failed to purchase crate: {e}")
```

### Sign Up New User

Make a new account with the RocketBotRoyale API:

```python
from rbrapi.errors import SignUpError

email = "new_user@example.com"
password = "new_password"
username = "new_username"

try:
    success = RocketBotRoyale.signup(email, password, username)
    if success:
        print(f"User {username} signed up successfully!")
    else:
        print("Failed to sign up user.")
except SignUpError as e:
    print(f"Failed to sign up user: {e}")
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "rbrapi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "Rocket Bot Royale, game API, Unofficial API, Python library",
    "author": null,
    "author_email": "VWH <vwhe@proton.me>",
    "download_url": "https://files.pythonhosted.org/packages/ed/10/5b4fe804e85cbe63e98837cfddc612fb468b4015c5767062db803e2a1cba/rbrapi-0.6.tar.gz",
    "platform": null,
    "description": "# Unofficial Client for RocketBotRoyale Game API\n\n[![Downloads](https://static.pepy.tech/badge/rbrapi)](https://pepy.tech/project/rbrapi)\n\n**\u26a0\ufe0f\ufe0f For Educational Use Only!**\n\nThis is an unofficial Python client for the Rocket Bot Royale game API. It allows users to interact with the game API, including authenticating, retrieving account details, collecting timed bonuses, sending friend requests, and purchasing crates.\n\n## Installation\n\nInstall the package using pip:\n\n```\npip install -U rbrapi\n```\n\n## Usage\n\n### Initialization\n\nInitialize a `RocketBotRoyale` instance with an email and password:\n\n```python\nfrom rbrapi import RocketBotRoyale\nfrom rbrapi.errors import AuthenticationError\n\n# Initialize with email and password\nclient = RocketBotRoyale(email=\"email@example.com\", password=\"your_password\")\n```\n\n### Authentication\n\nAuthenticate with the RocketBotRoyale API using provided credentials:\n\n> **Note:** It auto-authenticates when `RocketBotRoyale` is initialized. Use this only for regenerating the session token.\n\n```python\ntry:\n    client.authenticate()\n    print(\"Authentication successful!\")\nexcept AuthenticationError as e:\n    print(f\"Authentication failed: {e}\")\n```\n\n### Account Details\n\nRetrieve account details:\n\n```python\ntry:\n    account_details = client.account()\n    print(f\"Account ID: {account_details.custom_id}\")\n    print(f\"Username: {account_details.user[\"username\"]}\")\n    print(f\"Gems: {account_details.wallet[\"gems\"]}\")\n    print(f\"Coins: {account_details.wallet[\"coins\"]}\")\nexcept AuthenticationError as e:\n    print(f\"Authentication failed: {e}\")\n```\n\n### Collect Timed Bonus\n\nCollect a timed bonus:\n\n```python\nfrom rbrapi.errors import CollectTimedBonusError\n\ntry:\n    success = client.collect_timed_bonus()\n    if success:\n        print(\"Timed bonus collected successfully!\")\n    else:\n        print(\"Failed to collect timed bonus.\")\nexcept AuthenticationError as e:\n    print(f\"Authentication failed: {e}\")\nexcept CollectTimedBonusError as e:\n    print(f\"Failed to collect timed bonus: {e}\")\n```\n\n### Send Friend Request\n\nSend a friend request to another user:\n\n```python\nfrom rbrapi.errors import FriendRequestError\n\nfriend_code = \"c2829d50\"\n\ntry:\n    success = client.send_friend_request(friend_code)\n    if success:\n        print(\"Friend request sent successfully!\")\n    else:\n        print(\"Failed to send friend request.\")\nexcept AuthenticationError as e:\n    print(f\"Authentication failed: {e}\")\nexcept FriendRequestError as e:\n    print(f\"Failed to send friend request: {e}\")\n```\n\n### Convert Friend Code to User ID\n\nConvert a friend's code to their user ID:\n\n```python\nfrom rbrapi.errors import AuthenticationError, userNotExistError\n\nfriend_code = \"c2829d50\"\n\ntry:\n    user_id = client.friend_code_to_id(friend_code)\n    print(f\"User ID: {user_id}\")\nexcept AuthenticationError as e:\n    print(f\"Authentication failed: {e}\")\nexcept userNotExistError as e:\n    print(f\"User does not exist: {e}\")\n```\n\n### Purchase Crate\n\nPurchase a crate (regular or elite):\n\n```python\nfrom rbrapi.errors import LootBoxError\n\ntry:\n    crate_details = client.buy_crate(elite=False)  # Set elite=True for elite crate\n    print(\"Crate purchased successfully!\")\n    print(f\"Crate details: {crate_details}\")\nexcept AuthenticationError as e:\n    print(f\"Authentication failed: {e}\")\nexcept LootBoxError as e:\n    print(f\"Failed to purchase crate: {e}\")\n```\n\n### Sign Up New User\n\nMake a new account with the RocketBotRoyale API:\n\n```python\nfrom rbrapi.errors import SignUpError\n\nemail = \"new_user@example.com\"\npassword = \"new_password\"\nusername = \"new_username\"\n\ntry:\n    success = RocketBotRoyale.signup(email, password, username)\n    if success:\n        print(f\"User {username} signed up successfully!\")\n    else:\n        print(\"Failed to sign up user.\")\nexcept SignUpError as e:\n    print(f\"Failed to sign up user: {e}\")\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Unofficial Python Client for Rocket Bot Royale Game API",
    "version": "0.6",
    "project_urls": {
        "Homepage": "https://github.com/rocket-bot-royale/api",
        "Issues": "https://github.com/rocket-bot-royale/api/issues"
    },
    "split_keywords": [
        "rocket bot royale",
        " game api",
        " unofficial api",
        " python library"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3c413ac37131435af6b5c91d82ab8dd2f779aa6eda612e2bb9a88578fb81f50c",
                "md5": "f799ed678c17dcb892769d0ae9ad18fc",
                "sha256": "ca4a69acee56d631d12f92c2877d30f18e47d77f68d8711e609b15d38707745f"
            },
            "downloads": -1,
            "filename": "rbrapi-0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f799ed678c17dcb892769d0ae9ad18fc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 7274,
            "upload_time": "2024-06-20T08:39:16",
            "upload_time_iso_8601": "2024-06-20T08:39:16.197185Z",
            "url": "https://files.pythonhosted.org/packages/3c/41/3ac37131435af6b5c91d82ab8dd2f779aa6eda612e2bb9a88578fb81f50c/rbrapi-0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ed105b4fe804e85cbe63e98837cfddc612fb468b4015c5767062db803e2a1cba",
                "md5": "7a93da5fc8e727a9235cbff252c160e0",
                "sha256": "dc9998b36b29d412c79217df81540ec09fcd9ce6b050fe525604b2d570d9b0ab"
            },
            "downloads": -1,
            "filename": "rbrapi-0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "7a93da5fc8e727a9235cbff252c160e0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 7385,
            "upload_time": "2024-06-20T08:39:17",
            "upload_time_iso_8601": "2024-06-20T08:39:17.720458Z",
            "url": "https://files.pythonhosted.org/packages/ed/10/5b4fe804e85cbe63e98837cfddc612fb468b4015c5767062db803e2a1cba/rbrapi-0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-20 08:39:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rocket-bot-royale",
    "github_project": "api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "rbrapi"
}
        
Elapsed time: 1.11374s