Skip to main content

MeerkatBot is an extra layout to discord py

Project description

MEERKATBOT LIBRARY

It is an extra layout 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

If you're not sure about the file name format, learn more about wheel file names.

meerkatbot-0.1.0.5-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file meerkatbot-0.1.0.5-py3-none-any.whl.

File metadata

  • Download URL: meerkatbot-0.1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.5

File hashes

Hashes for meerkatbot-0.1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e9656308be50687b2b9c614257ebb00d92231e53d14a8ba5ce7f60fc68ddc7ab
MD5 f19b9211a800507f9d042d8abf9a29fe
BLAKE2b-256 2e251c9573a06bcb3958b9b71f59a7282d3b09055838999c4bbe08018ecdeac8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page