Skip to main content

Wrapper for UnbelievaBoat API.

Project description

UnbelievaBoat API Python Wrapper

Discord Server Python Version PyPI Version PyPI Downloads

This is a Python wrapper for the UnbelievaBoat API, which provides access to the UnbelievaBoat Discord bot functionality. It allows you to interact with the API endpoints to retrieve guild information, user balances, leaderboard data, and more.

Requirements

  • Python 3.8 or higher

Installation

You can install the UnbelievaBoat API Python wrapper using pip. Open your terminal and run the following command:

pip install unbelievaboat

Usage

Here's an example of how to use the UnbelievaBoat API Python wrapper to interact with the UnbelievaBoat API:

from unbelievaboat import Client
import asyncio


async def main():
    # Initialize the client with your API token
    client = Client("your-api-token")

    # Retrieve guild information
    guild = await client.get_guild(guild_id)
    print(guild)

    # Retrieve user balance
    user = await client.get_user_balance(guild_id, user_id)
    print(user.total)

    # Set or update user balance
    user = await client.set_user_balance(guild_id, user_id, {"bank": 100})
    user = await client.update_user_balance(guild_id, user_id, {"bank": 100})
    # or
    user = await client.get_user_balance(guild_id, user_id)
    user = await user.set_balance({"bank": 100})
    user = await user.update_balance({"bank": 100})

    # Retrieve leaderboard data
    leaderboard = await client.get_leaderboard(guild_id)
    print(leaderboard.users)

    # Retrieve item shop data
    shop = await client.get_shop(guild_id)
    print(shop.items)

    # Close the client session
    await client.close()


asyncio.run(main())

Replace "your-api-token" with your actual API token. You can obtain an API token by logging into the UnbelievaBoat dashboard and generating a token for your bot.

Please note that the above example demonstrates a basic usage scenario. You can explore other available methods in the Client class to interact with different API endpoints. You can also find more examples in the examples directory. For more information about the UnbelievaBoat API (data/params), please refer to the official documentation.

Contributing

Contributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unbelievaboat-1.2.3.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

unbelievaboat-1.2.3-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file unbelievaboat-1.2.3.tar.gz.

File metadata

  • Download URL: unbelievaboat-1.2.3.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.6

File hashes

Hashes for unbelievaboat-1.2.3.tar.gz
Algorithm Hash digest
SHA256 e44e95a16cfadaa3c8ca8e4e5848914a21ed6be8dcfb631c88bba829601203a4
MD5 141ab84ad6a953664efd270e3fc5ed40
BLAKE2b-256 9327e1814d4e65f0d17beb16d4f6d353330cc1c2f6e33f6500e2989490ad8d72

See more details on using hashes here.

File details

Details for the file unbelievaboat-1.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for unbelievaboat-1.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c55c027b69f434b07451cc55d95bed2bf99abd5c16853e29330cd7e0ca410767
MD5 49dcb585b3149b4443a23d12a2a0ed78
BLAKE2b-256 c84ed3b111ff3d577918b6f329d206574aac071ea3216221dea7cb3b069baa97

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page