Skip to main content API Wrapper in Python

Project description - The official Python API Wrapper for the GBL API



This is the official API wrapper for written in Python and published to PyPi.


To install, run this command in a terminal:

$ pip install gblpyapi



gblpyapi now has a webhook server! Create an instance of the WebhookServer module and pass the required parameters. Get when a user votes with the event below!

Event Name Parameters
on_glenn_vote data


Method Action
post_guild_count() (note: requires authentication) POST guild count
fetch_user_info(user_id) GET user info
fetch_has_voted(user_id) (note: required authentication) GET if a user has voted
fetch_bot_votes() (note: requires authentication) GET bot votes
fetch_bot_stats(bot_id) GET bot stats
fetch_vote_count() (note: requires authentication) GET bot vote count


To easily combine all examples, all examples will be shown in a discord.ext.commands.Cog

from glennbotlist import GBL
from glennbotlist import WebhookServer
import discord
from discord.ext import commands, tasks

class GlennBotList(commands.Cog):
    def __init__(self, bot): = bot
        self.glenn = GBL(, token=config.gbl, logging=True) # Replace "GBL TOKEN" with your GBL Token. True enables logging.
        self.server = WebhookServer( # Initiate Webhook Server
        self.postservers.start() # Starts the postservers task

    async def on_glenn_vote(self, data): # Triggered whenever a user votes

    @tasks.loop(hours = 1)
    async def postservers(self):
        await self.glenn.post_guild_count() # Post you server count and shard count. If logging is enabled, it will print a success message

    async def user_info(self, ctx, user: discord.Member):
            return await ctx.send("This user is not a bot")

        guser = await self.glenn.fetch_user_info( # Returns a glennbotlist.User object
        await ctx.send(f"Name: {}. Bio: {}") # Sends the users name and bio. For all User attributes, print the directory of glennbotlist.User

    async def has_voted(self, ctx, user: discord.Member):
            return await ctx.send("This user is not a bot")

        voted = await self.glenn.fetch_has_voted( # Returns a bool of whether the user has voted
        await ctx.send(f"{user}'s vote status: {voted}")

    async def votes(self, ctx):
        votes = await self.glenn.fetch_bot_votes() # Gets a dict of votes
        await ctx.send(votes)

    async def botinfo(self, ctx, user: discord.Member):
        if not
            await ctx.send("This is not a bot!")

        bot = await self.glenn.fetch_bot_stats( # Returns a glennbotlist.Bot object
        await ctx.send(f"Name: {}. Prefix: {bot.prefix}") # Sends the bots name and prefix. For all Bot attributes, print the directory of glennbotlist.Bot

    async def vote_count(self, ctx):
        votes = await self.glenn.fetch_vote_count() # Gets all time and monthly votes
        await ctx.send(f"I have {votes['monthly']} votes this month!") # Sends amount of votes for the current month

def setup(bot):


Made with ❤️ by A Trash Coder#0214 and A Discord User#1173.


Join the Discord for more help on this module.

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

gblpyapi-0.3.1.tar.gz (6.2 kB view hashes)

Uploaded source

Built Distribution

gblpyapi-0.3.1-py3-none-any.whl (8.0 kB view hashes)

Uploaded py3

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