Skip to main content

Decorator for chat bots

Project description

Discord Router

A simple router decorator for chat bots.


pip3 install discordrouter


from discordrouter import Router, message

class ChatBot(discord.Client):
  router = Router('!test')

  async def on_ready(self):
    print(f'Logged in as {}')

  async on_message(self, message):
    await self.router(message)

  @message(router, "new <name>")
  async _test1(self, items, message):
    name = items['name']

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for discordrouter, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size discordrouter-0.0.4.tar.gz (1.7 kB) File type Source Python version None Upload date Hashes View
Filename, size discordrouter-0.0.4-py3.7.egg (4.1 kB) File type Egg Python version 3.7 Upload date Hashes View
Filename, size discordrouter-0.0.4-py3-none-any.whl (2.3 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page