Giter Club home page Giter Club logo

botlist.py's Introduction

Botlist.py

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.

Basics

BotList.py’s actions are handled via BotClients. A BotClient holds all the methods, required
to use the API:

Creating a BotClient

A BotClient is easily created:

from botlistpy import BotClient
botlist_client = BotClient(client_id,api_token)

Your first request

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)

Updating Bot Stats

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!
server_count = 10
shard_count=1
await botlist_client.setStats(server_count,shard_count)

AutoPosting

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

SyncBotClient

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:
from botlistpy.helpers import SyncBotClient
botlist_client = SyncBotClient(client_id,api_token)

botlist.py's People

Contributors

stift007 avatar

Stargazers

ZeroTwo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.