dcsan / gitterbot

GitterBot / gitter chatbot with Wiki integration, and more!
https://gitter.im/dcsan/gitterbot
61 stars 83 forks source link

Fix thanks regex #142

Open abhisekp opened 9 years ago

abhisekp commented 9 years ago

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

dting commented 9 years ago

I think this might have been intentional for typos.

abhisekp commented 9 years ago

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

dting commented 9 years ago

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 commented 9 years ago

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

ArielLeslie commented 9 years ago

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 commented 9 years ago

@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 commented 9 years ago

May also want to catch thankyou with a missing space.

abhisekp commented 9 years ago

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

abhisekp commented 9 years ago

Thanks command doesn't run for this

ArielLeslie commented 9 years ago

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 commented 8 years ago

Thanks users with the following. Discovered by @brainyfarm