Skip to main content

A simple API wrapper for statcord.com to connect your bot and get your bot stats.

Project description

statcord.py

A simple API wrapper for statcord.com to connect your bot and get your bot stats.


Installation

Install via pip (recommended)

python3 -m pip install statcord.py

Features

  • AUTOMATIC server & user counts updating.
  • AUTOMATIC commands & active users updating.
  • AUTOMATIC resource usage posting.
  • AUTOMATIC custom function usage.
  • Support provided via discord

Posting Server & User Counts, Active Users and Popular Commands.

Example Cogs System

from discord.ext import commands

import statcord


class StatcordPost(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        self.key = "statcord.com-ADDYOURKEYHERE"
        self.api = statcord.Client(self.bot,self.key,custom1=self.custom1,custom2=self.custom2)
        self.api.start_loop()
        

    @commands.Cog.listener()
    async def on_command(self,ctx):
        self.api.command_run(ctx)

    async def custom1(self):
        # Do Things Here
        return "10" # Return a string.

    async def custom2(self):
        # Do Things Here
        return "10" # Return a string.


def setup(bot):
    bot.add_cog(StatcordPost(bot))

Example non-cogs system.

import discord
from discord.ext import commands
import statcord 

bot = commands.Bot(command_prefix='!')

async def custom1(self):
    # Do Things Here
    return "10" # Return a string.

async def custom2(self):
    # Do Things Here
    return "10" # Return a string.

key = "statcord.com-ADDYOURKEYHERE"
api = statcord.Client(bot,key,custom1=custom1,custom2=custom2)
api.start_loop()

@bot.event
async def on_command(ctx):
    api.command_run(ctx)




bot.run(TOKEN)

Configuration

To turn Memory tracking off, statcord.Client(bot,key,mem = False) To turn CPU tracking off, statcord.Client(bot,key,cpu = False) To activate a custom graph, statcord.Client(bot,key,custom1 = function)

Contributing

Contributions are always welcome!
Take a look at any existing issues on this repository for starting places to help contribute towards, or simply create your own new contribution to the project.

When you are ready, simply create a pull request for your contribution and we will review it whenever we can!

Donating

You can also help me and the project out by sponsoring me through a donation on PayPal.

Discussion, Support and Issues

Need support with this project, have found an issue or want to chat with others about contributing to the project?

Please check the project's issues page first for support & bugs!

Not found what you need here?

  • If you have an issue, please create a GitHub issue here to report it, include as much detail as you can.
  • Alternatively, You can join our Discord server to discuss any issue or to get support for the project.:
Discord

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

statcord.py-beta-3.1.0.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

statcord.py_beta-3.1.0-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file statcord.py-beta-3.1.0.tar.gz.

File metadata

  • Download URL: statcord.py-beta-3.1.0.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for statcord.py-beta-3.1.0.tar.gz
Algorithm Hash digest
SHA256 d7c47c18a4ceb8b7ffe4c3e0bf9f5b6563df547748d78dcb8cd8a37126431b44
MD5 be876889ab34fff342e2d79d0b6d8e63
BLAKE2b-256 9c7e879c68d59eea536d919769ace6b628ad7f6e5ef66258dea89496c188bf9d

See more details on using hashes here.

File details

Details for the file statcord.py_beta-3.1.0-py3-none-any.whl.

File metadata

  • Download URL: statcord.py_beta-3.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for statcord.py_beta-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0fdfbbd96f218a72c3f2e3b59a7e6143fa2d6712d84ba5b20cb1b429ae528206
MD5 d201fa7b547b69786161824a5f0d49e6
BLAKE2b-256 76f4a1edc0ddb26efefbcd55b8deb8d1de5468cdf508ddefd599b647d667a1fc

See more details on using hashes here.

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