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

Introduce passive mode #107

Merged
merged 1 commit into from
Jul 15, 2024
Merged

Conversation

michael-kenzel
Copy link
Contributor

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.

Copy link
Member

@jeremy-rifkin jeremy-rifkin left a 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) {
Copy link
Member

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.

Copy link
Contributor Author

@michael-kenzel michael-kenzel Jul 14, 2024

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?

Copy link
Contributor Author

@michael-kenzel michael-kenzel Jul 14, 2024

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.

Copy link
Member

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

Copy link
Member

@jeremy-rifkin jeremy-rifkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@jeremy-rifkin jeremy-rifkin merged commit 6c10710 into TCCPP:main Jul 15, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants