Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Command Handling #2

Open
pixeldesu opened this issue Oct 13, 2018 · 0 comments
Open

Improve Command Handling #2

pixeldesu opened this issue Oct 13, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@pixeldesu
Copy link
Member

Command handling currently is causing a lot of database queries, which linearly scale up with the amount of commands for a specific event type from Discord.js.

Explanation:

  • Discord.Client sends us the event message
  • We have 8 commands with the the message event type
  • Once the CommandManager is created, we create a handler for each of the 8 commands on the message event (this.client.on('message'...)
  • In each of those handlers, before we execute the command, we check if command.name is enabled in the database, causing 8 queries with the arrival of a single message from Discord.

ToDo / Goals:

  • Find a way to drastically minimize database queries to as low as possible. (Caching/etc.?)
@pixeldesu pixeldesu added the enhancement New feature or request label Oct 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant