-
Notifications
You must be signed in to change notification settings - Fork 102
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
Add fallback message handler #236
Comments
Another option would be to expose |
Using strip_prefix to check whether a message is a command would give false positives...
All these edge cases along with a nested call to the actual strip_prefix are handled in parse_invocation, and that function is public. So FYI if you're ok with that hacky solution, you can already do it now if you want |
Implemented in 1f0abfb. Feel free to try it in your bot via a cargo git dependency ^^ |
(As discussed on Discord)
My usecase requires potentially processing all non-command messages, and I found the only way to robustly do this was to add a general event handler and then parse all messages twice to check whether they are valid commands or not. It would be nice to have an exposed API to process any message that wasn't found to be a command, perhaps exposing the reason it failed to parse as a command—though that's beyond my own use case
The text was updated successfully, but these errors were encountered: