dbl
The following section outlines the API of dblpy.
There are two main ways to query version information about the library.
version_info
A named tuple that is similar to sys.version_info.
Just like sys.version_info the valid values for releaselevel
are 'alpha', 'beta', 'candidate' and 'final'.
__version__
A string representation of the version. e.g. '0.1.0-alpha0'
.
Note
All of the following functions return their data as a JSON object (except widget generation)!
Client
on_dbl_vote(data)
Called when someone votes for your bot on discordbots.org
- param data
The data with vote info returned in dict object
Example: :
@bot.event
async def on_dbl_vote(data):
print(data)
# Will output the following:
# {
# 'type': "upvote",
# 'user': "247741991310327810",
# 'bot': "264811613708746752",
# 'isWeekend': False
# }
on_dbl_test(data)
Called when someone tests webhook system for your bot on discordbots.org
- param data
The data with test info returned in dict object
Example: :
@bot.event
async def on_dbl_test(data):
print(data)
# Will output the following:
# {
# 'type': "type",
# 'user': "247741991310327810",
# 'bot': "264811613708746752",
# 'isWeekend': True
# }
The following exceptions are thrown by the library.
DBLException
UnauthorizedDetected
InvalidAuthorization
ClientException
HTTPException
Unauthorized
Forbidden
NotFound
InvalidArgument
ConnectionClosed