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

Fix word boundaries on commands #41

Open
liam-mitchell opened this issue May 26, 2017 · 1 comment
Open

Fix word boundaries on commands #41

liam-mitchell opened this issue May 26, 2017 · 1 comment
Labels

Comments

@liam-mitchell
Copy link
Owner

'level id for a frankly unbelievable amount of doors' returns the 0th rankings overall since it includes the word 'rank'... should probably limit that to commands that explicitly include 'rank' or 'rankings'. Ditto for 'stats' and 'statistics', probably others.

@edelkas
Copy link
Contributor

edelkas commented Feb 2, 2019

I addressed this issue in a couple of ways in the commit edelkas@bcebbd8. First, I separated the strictly global functions (those that are never going to reference explicit levels or players, like rankings or histories), so they will never be called accidentally by level names.

On the others, which can't be separated (because I'm using the NAME_PATTERN to filter them out), I addressed all problematic level names individually, both by adding word boundaries, and when that's not enough, by excluding other words of the level names, e.g., the level "list of inapropriate words" will no longer trigger the method "send_list".

All in all, there's very few of this cases, so the code has barely been complicated. I've tried to make it as minimal as possible too, with as few restrictions, e.g., I haven't added but the necessary word boundaries to avoid all accidents, so that the string is still matched by as many misprinted inputs as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants