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 thanks regex #142

Open
abhisekp opened this issue Aug 18, 2015 · 11 comments
Open

Fix thanks regex #142

abhisekp opened this issue Aug 18, 2015 · 11 comments

Comments

@abhisekp
Copy link
Collaborator

Current RegEx: https://regex101.com/r/hH5cN7/7
Proposed RegEx: https://regex101.com/r/hH5cN7
Repo file: https://github.com/dcsan/gitterbot/blob/master/nap/data/rooms/RoomMessages.js#L47

Replies to unwanted words such as tank and tanks must not be listened to

Thanks

Don't listen to username with the regex pattern matching thanks.


Also thank on writing the following

  • ty
  • thanky
  • thanksy
  • thanxy
  • thnq
  • tq

@dting
Copy link
Collaborator

dting commented Aug 20, 2015

I think this might have been intentional for typos.

@abhisekp
Copy link
Collaborator Author

I think people never make typos such as tank instead of thnks or thnx, etc. So regex must be modified accordingly.

@dting
Copy link
Collaborator

dting commented Aug 20, 2015

I don't feel like people talk about tanks too often I would just leave this in and add the others if you think they are needed. At the same time I don't have any strong feelings about this issue.

@abhisekp
Copy link
Collaborator Author

@dting hence this issue is a Priority 3 and small issue. 😄
This is not a big thing to worry about.

@ArielLeslie
Copy link

Addressing alternative words (do you want to recognize 'gracias', etc), as well as a more stable/extendable option, I would suggest creating a dictionary of regex patterns rather than making one monster pattern.

@abhisekp
Copy link
Collaborator Author

abhisekp commented Sep 1, 2015

@ArielLeslie, @dcsan have to decide whether to include thanks in other languages.
But for now, english is way to go. The bot is in beta currently.

@ArielLeslie
Copy link

May also want to catch thankyou with a missing space.

@abhisekp
Copy link
Collaborator Author

Another regex thanks bug. @dj8923 types in Hindi. The regex matches the word tak.

@abhisekp
Copy link
Collaborator Author

abhisekp commented Nov 4, 2015

Thanks command doesn't run for this

@ArielLeslie
Copy link

Adding a ! to the first alternative of the last group will fix that, but maybe it should just be any non-word instead of an ever-growing list of punctuation?

@abhisekp
Copy link
Collaborator Author

Thanks users with the following. Discovered by @brainyfarm


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

No branches or pull requests

3 participants