Skip to content

Latest commit

 

History

History
54 lines (37 loc) · 1.53 KB

README.md

File metadata and controls

54 lines (37 loc) · 1.53 KB

AenoX API

⚙️ Installation

Python 3.10 or higher is required

pip install aenox

🚀 Example Usage

To be able to perform your API query properly, replace [YOUR_API_KEY] with a valid API key.

To get an API Key, invite the bot (currently not available) to your discord server and simply run /api.

Example

from aenox import AenoXAPI

api = AenoXAPI(api_key="[YOUR_API_KEY]")

print(api.test())  # Returns "Success!" if it is installed correctly

🫧 Cooldown

You can send 20 queries per second to the API. If you attempt to send another request before this cooldown has passed, you will receive a aenox.errors.CooldownError.

Example

You cannot run this query twice within 2 seconds:

from aenox import AenoXAPI

api = AenoXAPI(api_key="[YOUR_API_KEY]")

api.get_user_stats(user_id=123)

In such cases, use try/except to handle the error. For example:

from aenox import CooldownError
from aenox import AenoXAPI

api = AenoXAPI(api_key="[YOUR_API_KEY]")

try:
    api.get_user_stats(user_id=123)
except CooldownError:
    print('Cooldown!')