Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions content/libraries/python.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This is our official Python Library for top.gg, if you have any issues please su
### Install via pip (recommended)

```
pip install dblpy
pip install topggpy
```

### Install from source
Expand All @@ -32,12 +32,12 @@ Manual server count post every 30 minutes:
```py
from discord.ext import tasks

import dbl
import topgg

# This example uses tasks provided by discord.ext to create a task that posts guild count to top.gg every 30 minutes.

dbl_token = 'top.gg token' # set this to your bot's top.gg token
bot.dblpy = dbl.DBLClient(bot, dbl_token)
bot.dblpy = topgg.DBLClient(bot, dbl_token)

@tasks.loop(minutes=30)
async def update_stats():
Expand All @@ -53,13 +53,13 @@ update_stats.start()

Webhook
```py
import dbl
import topgg

# This example uses dblpy's webhook system.
# In order to run the webhook, at least webhook_port argument must be specified (number between 1024 and 49151).

dbl_token = 'top.gg token' # set this to your bot's top.gg token
bot.dblpy = dbl.DBLClient(bot, dbl_token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)
bot.dblpy = topgg.DBLClient(bot, dbl_token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)

@bot.event
async def on_dbl_vote(data):
Expand All @@ -74,12 +74,12 @@ async def on_dbl_test(data):

Automatically post server count every 30 minutes
```py
import dbl
import topgg

# This example uses dblpy's autopost feature to post guild count to top.gg every 30 minutes.

dbl_token = 'top.gg token' # set this to your bot's top.gg token
bot.dblpy = dbl.DBLClient(bot, dbl_token, autopost=True)
bot.dblpy = topgg.DBLClient(bot, dbl_token, autopost=True)

@bot.event
async def on_guild_post():
Expand Down