BotList.Py is a quick, asynchronous Wrapper around Botlist.me’s API Using BotList.Py is easy. I will give you a small Introduction how to use this Library.
BotList.py’s actions are handled via BotClients. A BotClient holds all the methods, required
to use the API:
to use the API:
A BotClient is easily created:
from botlistpy import BotClient
botlist_client = BotClient(client_id,api_token)
Let’s start by creating an EMBED for your Bot:
img = await botlist_client.generate_embed()
with open("embed.png","wb") as f:
f.write(img)
The main part why you’re using this Library, is propably because you
want to set your Bot’s Stats. Well, BotList.py makes this especially easy!
want to set your Bot’s Stats. Well, BotList.py makes this especially easy!
server_count = 10
shard_count=1
await botlist_client.setStats(server_count,shard_count)
An essential part of the Library is the AutoPoster, a class that automatically updates Stats once per minute (or a custom interval)
from botlistpy.helpers import AutoPoster
from mycoolbot import bot
poster = AutoPoster(botlist_client,bot,interval=45)
await poster.start()
All of the Above Examples were ASYNC. However, async tasks are hard to handle
in Python, so I gave it a shot and made the SyncBotClient - it works just like the BotClient,
but it’s not async:
in Python, so I gave it a shot and made the SyncBotClient - it works just like the BotClient,
but it’s not async:
from botlistpy.helpers import SyncBotClient
botlist_client = SyncBotClient(client_id,api_token)