Skip to main content

A simple API wrapper for discordbots.org written in Python

Project description

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

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))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dblpy-0.1.2.tar.gz (7.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page