Lullabot / lubot

1 stars 0 forks source link

[#7] Allow factoids to be word case agnositc. #26

Closed eojthebrave closed 1 year ago

eojthebrave commented 9 years ago

Allows for factoids to not care about case, as per #7.

Example:

[21:36:22] <@eojthebrave>   lubot: joe is awesome
[21:36:22] <lubot>  eojthebrave: Okay!
[21:36:25] <@eojthebrave>   Joe?
[21:36:25] <lubot>  Joe is awesome
[21:36:28] <@eojthebrave>   Joe!
[21:36:28] <lubot>  Joe is awesome
[21:36:32] <@eojthebrave>   joe!
[21:36:32] <lubot>  joe is awesome
[21:36:49] <@eojthebrave>   JOE?
[21:36:50] <lubot>  JOE is awesome
[21:36:52] <@eojthebrave>   joE
[21:36:59] <@eojthebrave>   delete factoid JoE
[21:36:59] <lubot>  eojthebrave: Okay!
[21:37:02] <@eojthebrave>   joe?

Resolves #7

justafish commented 9 years ago

Does this also remove any uppercase letters from the factoid itself?

eojthebrave commented 9 years ago

Yeah, it does. Which I suppose is probably not ideal.

Maybe what we need to do is figure out how to make the mongodb query case-insensitive.

q0rban commented 9 years ago

Couldn't we just remove the matches[2].toLowerCase() on line 29?

eojthebrave commented 9 years ago

Yes. Totally.