MeerkatBot is an extra layer to discord py
Project description
MEERKATBOT LIBRARY
It is an extra layer to discord.py library, writen to improve the discord bots architecture.
A Simple Example
from meerkatbot import MeerkatBot
token = input('YOUR DISCORD BOT TOKEN IS ... ')
meerkat = MeerkatBot(
token=token,
prefix="@",
# * The meerkat has a logger as well, but you can send
# * a custom one to MeerkatBot instance -> logger = logger(color, text): void
#logger=lambda color, text: print(text)
)
# * Example - Commands
async def helloCommand(context):
await context.send('Hi!, how are you?')
async def byeCommand(context):
await context.send('See you!')
# * Example - EVENTS
async def onReadyEvent():
meerkat.logger('bold', 'IT IS READY')
async def onMessageEvent(message):
meerkat.logger('warning', 'MESSAGE - {}'.format(message.content))
# ? Two ways to do the same
# meerkat.use('hello', helloCommand).use('bye', byeCommand)
meerkat.bulkUse([
('hello', helloCommand),
('bye', byeCommand)
])
# ? Two ways to do the same
# meerkat.on('ready', onReadyEvent).on('message', onMessageEvent)
meerkat.bulkOn([
('ready', onReadyEvent),
('message', onMessageEvent)
])
# * With this command, the meerkat can start digging!
meerkat.run()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for meerkatbot-0.1.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce42a647d45950bed55a896cf9a8dd7bc4cd9e804c148b739691e4f79da041a6 |
|
MD5 | 5f2f65d919888abae3013bbfe19e65a4 |
|
BLAKE2b-256 | 381b6ff54e2659972362a201a1c27c591a56d21be47daf0ca68a63a9b222e0b0 |