Wrapper for the moonbots api
Project description
Wrapper for the moonbots api
Wrapper for the moonbots api with webhook and auto post data supporting
How to install?
From pip:
pip install mbc
From source:
pip install git+https://github.com/VadyChel/MoonbotsClient
Examples
Simple usage:
from mbc import MoonbotsClient, HTTPException
from discord.ext import commands, tasks
class MBCExample(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.mclient = MoonbotsClient(
bot=self.bot,
api_key="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
autopost=False
)
self.post_stat_loop.start()
@tasks.loop(hours=3)
async def post_stat_loop(self):
await self.bot.wait_until_ready()
try:
await self.mclient.post_stat()
except HTTPException:
print("Failed to post bot stat")
def setup(client):
client.add_cog(MBCExample(client))
Other examples you can see in examples directory
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
mbc-0.4.6.tar.gz
(4.7 kB
view details)
File details
Details for the file mbc-0.4.6.tar.gz
.
File metadata
- Download URL: mbc-0.4.6.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f3f6bde78f910797dc96d9c3d424844da65682e0c95a2b5414f4e74e6b1269c |
|
MD5 | 5181b351e8d33902b617741c37d0860d |
|
BLAKE2b-256 | ec803e4c68a0ba3040a70a852558ab77b4bcbe8e45fa6c797e04cb1d541fba33 |