Skip to content

infinitysky/DBL-Python-Library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DBL Python Library

View on PyPi v0.1.3 Documentation Status

A simple API wrapper for discordbots.org written in Python

Installation

Install via pip (recommended)

pip install dblpy

Install from source

git clone https://github.com/DiscordBotList/DBL-Python-Library
cd DBL-Python-Library
pip install -R requirements.txt

Documentation

Documentation can be found here

Working

  • POST server count
  • GET bot info, server count, upvote count, upvote info
  • GET all bots
  • GET user info
  • GET widgets (large and small) including custom ones. See discordbots.org/api/docs for more info.

Not Working / Implemented

  • Searching for bots via the api

Example

import dblpy
from dblpy import Client
import asyncio
import aiohttp
import json

dbl = dblpy.Client()

botid = 264811613708746752  # your bots user id (client id on newer bots)
token = 'abcxyz'            # DBL Bot Token. Obtainable from https://discordbots.org/api

class Example:
    def __init__(bot):
        bot = bot
        session = aiohttp.ClientSession(loop=bot.loop)

    async def poststats():
        await dblpy.post_server_count(botid, dbltoken, 65)

    async def getstats():
        resp = await dblpy.get_server_count(botid)
        print(json.dumps(resp))

About

A simple API wrapper for discordbots.org written in Python

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Python 100.0%