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.

Source Distribution

discordrouter-0.0.2.tar.gz (1.7 kB view hashes)

Uploaded Source

Built Distribution

discordrouter-0.0.2-py3-none-any.whl (2.2 kB view hashes)

Uploaded Python 3

Supported by

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