Skip to main content
toppy logo

An API wrapper made for discord.py or any forks for Discord Bot List, DiscordBotsGG, and Top.gg.

Documentation

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

Installation

Python 3.8 or higher is needed

$ pip install -U toppy-python

Example

import toppy
from discord.ext import commands


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

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


@bot.event
async def on_dbl_autopost_success():  # dbl/dbgg/topgg
    print('Server count posted')
    print(f'Server count: {len(bot.guilds)}')


@bot.event
async def on_dbl_autopost_error(error: toppy.HTTPException):  # dbl/dbgg/topgg
    print(f'Uh oh. An error occurred. Status: {error.resp.status}')



bot.run(...)

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-2.0.1.tar.gz (18.1 kB view details)

Uploaded Source

File details

Details for the file toppy-python-2.0.1.tar.gz.

File metadata

  • Download URL: toppy-python-2.0.1.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.2

File hashes

Hashes for toppy-python-2.0.1.tar.gz
Algorithm Hash digest
SHA256 398a1adb3f200bf85b6a67bfbac53ed9f026d381b9e6dfaf5ef7a8d9207dda4d
MD5 02f16b6f37f149c463680d4a81b80a7e
BLAKE2b-256 a1feccfa41a763f8b093d0c7e5316dbed87b703fb1e02577f4a0d6dc0b5d81c9

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.0.1 This release

1 file

2.0.0

1 file

1.5.1

1 file

1.5.0

1 file

1.4.1

1 file

1.4.0

1 file

1.3.7

1 file

1.3.6

1 file

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