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.

Metadata

Release files for nexobots 0.1.0

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.1.0
File Size Uploaded Provenance Actions
nexobots-0.1.0.tar.gz 3.3 kB Without provenance Details for nexobots-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 6.4 kB

Release files / nexobots-0.1.0.tar.gz

Download URL nexobots-0.1.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
26ab61ff65a09bf012b50af0fdcd96fc8cc301315367cf5dfa9ce851c5425b4b
BLAKE2b-256 checksum
How to use checksums
9ab6bf30ec7bead99a8f6abcbb6ca432e1f2267ed49ae1e115ed5ef633a3b979
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL nexobots-0.1.0-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b46211c0ffb35f3f927a8ade5ec1ef1a0aa9e80515d157d8dd2b24a30f4bfec5
BLAKE2b-256 checksum
How to use checksums
e1ad81e17e61a54363ea257124abf33e10c109fba4d39483b9a143827c77d7c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for nexobots 0.1.0

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