Repository navigation
allow mention commands - #216
Merged
Merged
Conversation
ngtv2409
force-pushed
the
mention-command
branch
from
August 9, 2026 07:57
7910eda to
e3d671d
Compare
|
| // returns false if the message was not a wheatley command | ||
| private async handle_text_command(message: Discord.Message, prev_command_obj?: TextBasedCommand) { | ||
| const match = message.content.match(CommandHandler.command_regex); | ||
| const cmd = message.content.replace(new RegExp(String.raw`^\s*<@${this.wheatley.client.user?.id}>\s*`), ""); |
Member
There was a problem hiding this comment.
Suggested change
| const cmd = message.content.replace(new RegExp(String.raw`^\s*<@${this.wheatley.client.user?.id}>\s*`), ""); | |
| const command_text = message.content.replace(new RegExp(`^\s*<@!?${id}>\s*`), ""); |
| return; | ||
| } | ||
| if (message.content.startsWith("!")) { | ||
| const cmd = message.content.replace(new RegExp(String.raw`^\s*<@${this.wheatley.client.user?.id}>\s*`), ""); |
Member
There was a problem hiding this comment.
It'd be best to pull out the repeated regex
ngtv2409
force-pushed
the
mention-command
branch
from
September 20, 2026 00:15
25a64fd to
50eacc0
Compare
ngtv2409
force-pushed
the
mention-command
branch
from
September 20, 2026 00:51
50eacc0 to
a585480
Compare
|
jeremy-rifkin
approved these changes
Oct 25, 2026
jeremy-rifkin
left a comment
Member
There was a problem hiding this comment.
Thanks again! I think we should be good to move (I'll apply one suggestion above)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Allow messages with content beginning with a mention to wheatley to be recognized as a command. #182