Package: discordlists.py
discordlists.pyA simple API wrapper for botblock.org providing server count posting to all bot lists and fetching bot information from all.InstallationInstall via pip (recommended)python3-mpipinstalldiscordlists.py-UFeaturesPOST server countAUTOMATIC server count updatingALL bot lists' APIs includedGET bot information from all bot lists and DiscordExample Discord.py CogsPosting Server Countfromdiscord.extimportcommandsimportdiscordlistsclassDiscordListsPost(commands.Cog):def__init__(self,bot):self.bot=botself.api=discordlists.Client(self.bot)# Create a Client instanceself.api.set_auth("bots.ondiscord.xyz","dsag38_auth_token_fda6gs")# Set authorisation token for a bot listself.api.set_auth("discordbots.group","qos56a_auth_token_gfd8g6")# Set authorisation token for a bot listself.api.start_loop()# Posts the server count automatically every 30 minutes@commands.command()asyncdefpost(self,ctx:commands.Context):"""Manually posts guild count using discordlists.py (BotBlock)"""try:result=awaitself.api.post_count()exceptExceptionase:awaitctx.send("Request failed: `{}`".format(e))returnawaitctx.send("Successfully manually posted server count ({:,}) to{:,}lists.""\nFailed to post server count to{:,}lists.".format(self.api.server_count,len(result["success"].keys()),len(result["failure"].keys())))defsetup(bot):bot.add_cog(DiscordListsPost(bot))Getting Bot Infofromdiscord.extimportcommandsimportdiscordlistsclassDiscordListsGet(commands.Cog):def__init__(self,bot):self.bot=botself.api=discordlists.Client(self.bot)# Create a Client instance@commands.command()asyncdefget(self,ctx:commands.Context,bot_id:int=None):"""Gets a bot using discordlists.py (BotBlock)"""ifbot_idisNone:bot_id=self.bot.user.idtry:result=(awaitself.api.get_bot_info(bot_id))[1]exceptExceptionase:awaitctx.send("Request failed: `{}`".format(e))returnawaitctx.send("Bot:{}#{}({})\nOwners:{}\nServer Count:{}".format(result['username'],result['discriminator'],result['id'],", ".join(result['owners'])ifresult['owners']else"Unknown","{:,}".format(result['server_count'])ifresult['server_count']else"Unknown"))defsetup(bot):bot.add_cog(DiscordListsGet(bot))ContributingContributions are always welcome to this project!Take a look at any existing issues on this repository for starting places to help contribute towards, or simply create your own new contribution to the project.Please make sure to follow the existing standards within the project such as code styles, naming conventions and commenting/documentation.When you are ready, simply create a pull request for your contribution and I will review it whenever I can!DonatingYou can also help me and the project out by sponsoring me throughGitHub Sponsors(preferred), contributing through adonation on PayPalor by supporting me monthly on myPatreon page.Discussion, Support and IssuesNeed support with this project, have found an issue or want to chat with others about contributing to the project?Please check the project's issues page first for support & bugs!Not found what you need here?If you have an issue, please create a GitHub issue here to report the situation, include as much detail as you can!or,You can join our Slack workspace to discuss any issue, to get support for the project or to chat with contributors and myself: