-
Notifications
You must be signed in to change notification settings - Fork 21
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
Introduce passive mode #107
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, one quick commend and then I think this is good to go
src/wheatley.ts
Outdated
@@ -948,6 +956,9 @@ export class Wheatley { | |||
// command edit/deletion | |||
|
|||
register_text_command(trigger: Discord.Message, command: TextBasedCommand, deletable = true) { | |||
if (this.passive) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure this is the right place to do this. Maybe instead this could be checked in handle_text_command
/handle_slash_comand
? It may also be important to do this in on_interaction
, depending on goals.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do this not here but later on, wouldn't that mean that the commands are still registered though? I don't think we want it to fill the list of slash commands with inoperational duplicates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I guess you meant to only do this for text commands? I'll update the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked on discord, thanks for resolving
b87c34e
to
582f69b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
In passive mode, Wheatley will not advertise or react to commands, and only load components that are marked as passive. This is to allow additional secondary instances of the bot to coexist with a running primary instance on the same server without interference, e.g., for testing new features.