A simple API wrapper for botsfordiscord.com written in Python
Project description
bfd.py
A simple API wrapper for botsfordiscord.com written in Python.
Installation
Install via pip (recommended)
pip install bfd.py
Features
- POST server count
- AUTOMATIC server count updating
- GET bot info
- GET global bot list
- GET bot list for a specific user
- GET widgets url
- SEARCH for bots
Example Discord.py Rewrite cog
import bfd
import discord
from discord.ext import commands
class BotsForDiscord:
def __init__(self, bot):
self.bot = bot
self.token = 'token' # set this to your BFD token
self.bfd = bfd.Client(self.bot, self.token) # Create a Client instance
self.bfd.start_loop() # Posts the server count every 30 minutes
@commands.command()
async def botinfo(self, ctx, bot: discord.User): # unfiltered botinfo demo
info = await self.bfd.get_bot(bot.id)
if info is None:
await ctx.send("Can't find this bot on BFD")
return
embed = discord.Embed(title="BotInfo")
for key, value in info.as_dict().items():
if key == "" or value == "":
continue
embed.add_field(name=key, value=str(value))
await ctx.send(embed=embed)
def setup(bot):
bot.add_cog(BotsForDiscord(bot))
Discussion, Support and Issues
For general support and discussion of this project, please join the Discord server: https://discord.gg/qyXqA7y
To check known bugs and see planned changes and features for this project, please see the GitHub issues.
Found a bug we don't already have an issue for? Please report it in a new GitHub issue with as much detail as you can!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bfd.py-1.0.1.tar.gz
(18.2 kB
view details)
Built Distributions
bfd.py-1.0.1-py3.6.egg
(8.4 kB
view details)
File details
Details for the file bfd.py-1.0.1.tar.gz
.
File metadata
- Download URL: bfd.py-1.0.1.tar.gz
- Upload date:
- Size: 18.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b54ce4ed0a2454c630c969931546a3b0b57b76b41a1e29c4929761fdf1d6b775 |
|
MD5 | 45313d6053fd2082ecf8a75b3a428665 |
|
BLAKE2b-256 | 1ee6a7469416749215af159b0d9acbec5e924cf366bb0d22560049e679871e9e |
File details
Details for the file bfd.py-1.0.1-py3.6.egg
.
File metadata
- Download URL: bfd.py-1.0.1-py3.6.egg
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4860d4a5bf7134f479be2b90b18e4d27340373fa22251b7c54c54a719e41696f |
|
MD5 | d202006c699a39f7d4856f1d6fedc6d9 |
|
BLAKE2b-256 | b057e8e03278c499879ea5d3ae5b927973d60174cb9cbba49a009ab306e199de |
File details
Details for the file bfd.py-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: bfd.py-1.0.1-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90497c512a5cfc34766d6556e78c9fac91194a24c57778b44c5e8a4fa847620e |
|
MD5 | b01d5a671ee633b79e660cde3d686000 |
|
BLAKE2b-256 | 648eab7f866cda54f639873fe57f53e022694eb458be89aeb4707c198e4a3ef2 |