Skip to main content

A simple API wrapper for Discord Bot List and Top.gg

Project description

A simple API wrapper for Top.gg and Discord Bot List made in Python. Specifically meant for discord.py and some forks.

Documention

https://toppy-python.readthedocs.io/en/latest/

Installation

Python 3.8 or higher is needed

$ pip install -U git+https://github.com/chawkk6404/toppy

Example

from discord.ext import commands
import toppy
import aiohttp


dbl_token = 'Your Discord Bot List token here'
topgg_token = 'your Top.gg token here'

bot = commands.Bot('!')  # or discord.Client()
toppy_client = toppy.Client(
    bot, dbl_token=dbl_token,
    topgg_token=topgg_token
)


@bot.event
async def on_dbl_autopost_success():  # or on_topgg_autopost_success
    print('Server count posted')
    print(f'Server count: {len(bot.guilds)}')


@bot.event
async def on_dbl_autopost_error(error: aiohttp.ClientResponseError):  # or on_topgg_autopost_error
    print(f'Uh oh. An error occurred: {error.message}')



bot.run(...)

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

toppy-python-1.3.6.tar.gz (14.1 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