gunnbr / gthx

An IRC bot that tracks the status of another bot and takes over when the primary bot is down
GNU General Public License v2.0
6 stars 4 forks source link

Gthx replies to "google <something> for ..." when not specifically address #36

Closed gunnbr closed 7 years ago

gunnbr commented 7 years ago

Gthx should not reply to this unless specifically address. Otherwise phrases like:

"google artificial intelligence for an interesting read"

cause gthx to reply:

"an: http://lmgtfy.com/?q=artificial intelligence"

djhenjin commented 7 years ago

One potential fix for this would be to bind the end of the google regex to the end of string using '\s*$' as the last portion of the regex right before the closing quotation mark. This will eat any trailing whitespace, as well as make sure that it only matches if there is a singular word username at the end of the match

For example with the above addition: "google artificial intelligence for an interesting read" No longer triggers with the google regex. Whereas: "google artificial intelligence for DJHenjin
" Will trigger the regex no matter the whitespacing,

The above working example will trigger as response: "DJHenjin: http://lmgtfy.com/?q=artificial intelligence"

gunnbr commented 7 years ago

Accidentally closed this issue instead of #35.

djhenjin commented 7 years ago

This issue should be closed as corrected behavior is now exhibited by gthx in IRC channels, may need to retrain users on how to fire the google behavior, but easily enough done.

gunnbr commented 7 years ago

Closed by a fix from djhenjin at some point in the past.