PyDBL
PyDBL is a DiscordBots API wrapper made using Python.
This was written to allow easier writing of bots or chat logs. Make sure to familiarise yourself with the API using the documentation.
Installing
To install the library, you can just run the following command:
python3 -m pip install -U pydbl
To install the development version, do the following:
python3 -m pip install -U https://github.com/JustMaffie/PyDBL/archive/master.zip
or the more long winded from cloned source:
$ git clone https://github.com/JustMaffie/PyDBL
$ cd PyDBL
$ python3 -m pip install -U .
Please note that on Linux installing voice you must install the following packages via your favourite package manager (e.g. apt
, yum
, etc) before running the above command:
- libffi-dev (or
libffi-devel
on some systems) - python-dev (e.g.
python3.5-dev
for Python 3.5)
Quick Example
from dbl import DBLClient
import asyncio
loop = asyncio.get_event_loop()
token = "token"
client = DBLClient(token=token)
async def test():
res = await client.get_bot(id=251930037673132032)
print(res.description.__dict__)
try:
loop.run_until_complete(test())
finally:
loop.close()
You can find examples in the examples directory.
Requirements
- Python 3.5+
-
aiohttp
library -
ujson
library (Optional, this will be for faster JSON parsing) Usuallypip
will handle these for you.