Skip to content

Latest commit

 

History

History
103 lines (64 loc) · 2.12 KB

api.rst

File metadata and controls

103 lines (64 loc) · 2.12 KB

dbl

API Reference

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'.

Client

Note

All of the following functions return their data as a JSON object (except widget generation)!

Client

Event reference

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
# }

Exceptions

The following exceptions are thrown by the library.

DBLException

UnauthorizedDetected

InvalidAuthorization

ClientException

HTTPException

Unauthorized

Forbidden

NotFound

InvalidArgument

ConnectionClosed