Skip to main content

nexobots

Post stats and check votes on Nexobots, the Discord bot directory.

pip install nexobots

Get your API token from your bot's page in the Nexobots dashboard, and keep it in your .env file.

Post your server count

import os

from discord.ext import tasks
from nexobots import Nexobots

@tasks.loop(minutes=30)
async def post_stats():
    async with Nexobots(os.environ["NEXOBOTS_TOKEN"], bot.user.id) as nexobots:
        await nexobots.post_stats(server_count=len(bot.guilds), shard_count=bot.shard_count)

The API allows one post per 5 minutes.

Check a vote

async with Nexobots(os.environ["NEXOBOTS_TOKEN"], bot.user.id) as nexobots:
    if await nexobots.has_voted(user.id):
        ...  # Thank them.

Receive vote webhooks

Pass the raw request body, before any JSON parsing.

from nexobots import parse_webhook

vote = parse_webhook(os.environ["NEXOBOTS_WEBHOOK_SECRET"], raw_body, request.headers.get("X-Nexo-Signature"))
if vote is None:
    return Response(status=401)
print(f"{vote['user']} voted")

Errors from the API are raised as NexobotsError, with status, code and message.

Uptime

Send a heartbeat every 5 minutes, and your bot's uptime counts on Nexobots without sharing a server with ours.

asyncio.create_task(client.run_heartbeat())

Metadata

Release files for nexobots 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nexobots 0.3.1
File Size Uploaded Provenance Actions
nexobots-0.3.1.tar.gz 4.3 kB Without provenance Details for nexobots-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nexobots 0.3.1
File Interpreter ABI Platform Actions
nexobots-0.3.1-py3-none-any.whl Python 3 none any Details for nexobots-0.3.1-py3-none-any.whl

Total release size: 7.9 kB

Release files / nexobots-0.3.1.tar.gz

Download URL nexobots-0.3.1.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7f7a0ad876b2d43dbd3f6a6d1ac861b91e85fd18235dbf731ef88f8bfc224205
BLAKE2b-256 checksum
How to use checksums
079f0f20ba938ae1d88578b2881e5c3407012ee0b753b7490c65cb48705f2feb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / nexobots-0.3.1-py3-none-any.whl

Download URL nexobots-0.3.1-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee7e0b1257fc58bc78eb758c5c411821b6da1dc5e548d0984b03f4246572bc90
BLAKE2b-256 checksum
How to use checksums
7f5166a6c224e8dd4b692791639ffa4a7b09ed83841d164b94d1f987cdcc013e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Security for nexobots 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page