An API wrapper made for discord.py or any forks for Discord Bot List, DiscordBotsGG, and Top.gg.
Documentation
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)
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
398a1adb3f200bf85b6a67bfbac53ed9f026d381b9e6dfaf5ef7a8d9207dda4d
|
|
| MD5 |
02f16b6f37f149c463680d4a81b80a7e
|
|
| BLAKE2b-256 |
a1feccfa41a763f8b093d0c7e5316dbed87b703fb1e02577f4a0d6dc0b5d81c9
|