Skip to main content

A Python wrapper for the DisStat API.

Project description


Disstat is a Python package for computing dissimilarity statistics for wrapping the Disstat API.


Use the package manager pip to install disstat.

pip install disstat


from discord import Intents, Interaction
from discord.ext import commands
from disstat import DisstatClient

class Bot(commands.Bot):
    def __init__(self):
        super().__init__(command_prefix="!", intents=Intents.default())
        self.disstat = DisstatClient(self, "DISSTAT API KEY HERE")

    async def on_ready(self):
        await self.disstat.start_auto_post()

    async def on_command_completion(
        self, ctx: commands.Context
    ):  # For using prefix commands
        await self.disstat.post_command(
            guild_id=( if ctx.guild else None),

    async def on_app_command_completion(
        self, interaction: Interaction
    ):  # For using slash commands
        await self.disstat.post_command(
            guild_id=( if interaction.guild else None),

    async def on_disstat_post(self, payload):
        print("Posted stats to Disstat.")

    async def on_disstat_post_command(self, payload):
        print(f"Posted command {payload['command']} to Disstat.")

bot = Bot()"TOKEN")

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

disstat-1.0.3.tar.gz (4.3 kB view hashes)

Uploaded Source

Supported by

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