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.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nexobots-0.2.0.tar.gz | 3.8 kB | Without provenance | Details for nexobots-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nexobots-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for nexobots-0.2.0-py3-none-any.whl |
Total release size: 7.2 kB
Release files / nexobots-0.2.0.tar.gz
| Download URL | nexobots-0.2.0.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
90f104395dd35ac46047ee1adbc27f61b54a5a84e5c78d6b0000145f9b6a80f9
|
|
BLAKE2b-256 checksum How to use checksums |
e21c63958e97cc32b7aa6b5a5c47de09753461cd0b54371da643d283fdaedb99
|
| 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.2.0-py3-none-any.whl
| Download URL | nexobots-0.2.0-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
438051d9d55407dae189025f350c974b6876ca7929814645d661712b4ba24657
|
|
BLAKE2b-256 checksum How to use checksums |
2a667b4cd2348128e86340f03be926a0965b755efc4ccb52352dc38341024abc
|
| 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.2.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.