Skip to main content

The official API SDK for botliy.online

Project description


botliy

Botliy Python SDK

The official API SDK for botliy.online. Easily communicate with our platform using Python to post your bot stats, check user votes, and authenticate webhooks seamlessly!

Installation

Install the package directly from PyPI:

pip install botliysdk

(Requires Python 3.6+ and requests)


🚀 Quick Start Example

Here is a simple example covering how to initialize the bot and use the SDK:

from botliysdk import Botliy

# 1. Initialize the client
client = Botliy(
    api_token="your_api_token_here", 
    bot_id="your_bot_id_here",
    webhook_secret="your_optional_webhook_secret_here"
)

# 2. Post Bot Stats
# (It's recommended to do this on a loop every 30 minutes in your bot code)
client.post_stats(server_count=1500, shard_count=1)

# 3. Check if a user voted for your bot!
response = client.check_vote("some_user_discord_id")
if response.get("voted") == 1:
    print("This user cast a vote!")
else:
    print("This user has not voted.")

📖 API Methods

client.post_stats(server_count: int, shard_count: int = 1)

Posts your bot's current server and shard numbers. Returns a dictionary mapping of the API's response.

client.get_stats()

Will return a dictionary of your bot's stats currently registered on Botliy's servers.

client.get_votes()

Will return a dictionary containing the last 1,000 votes for your bot.

client.check_vote(user_id: str)

Checks whether a specific user ID has voted for your bot in the last 12 hours. The returned dictionary will contain "voted": 1 if they have, or 0 if they have not.

client.verify_webhook(authorization_header: str)

Utility method to seamlessly verify Discord webhook requests you receive on your HTTP server (Flask, FastAPI, etc.). Compare the Authorization header request sent to you against your configured Webhook secret. Returns True if it successfully matches!


For detailed usage examples integrating discord.py and Flask, view our Full API Reference Documentation.

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

botliysdk-1.0.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

botliysdk-1.0.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file botliysdk-1.0.1.tar.gz.

File metadata

  • Download URL: botliysdk-1.0.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for botliysdk-1.0.1.tar.gz
Algorithm Hash digest
SHA256 735a8472d0c36024e848745b13f12358f4a62432694766dbaf516cf4e4f3876f
MD5 c478f2835513cb70cb8fa81fbbcdb678
BLAKE2b-256 82cef97ff633f6ec54e796bd0bf1f8b3a61d5deb42da8ff5a2f5c6e7d258fb21

See more details on using hashes here.

File details

Details for the file botliysdk-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: botliysdk-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for botliysdk-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fb8e480edd16c3b612b0867ac662344f633bd4856211ef9c1fcafc06949991a9
MD5 112f8907639558fba04bcf6aa0272f09
BLAKE2b-256 57596d4ea2a30562e4f8ce5bd237ee9b8751d8767cb5321282eee93574e0432e

See more details on using hashes here.

Supported by

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