knights-of-academia / horace

discord.js bot powering the Knights of Academia server with commands like info, AFK, and more
MIT License
23 stars 19 forks source link

Highlight Fixes - duplicate, empty embed, case sensitivity, word appearance instances #130

Closed Dendrobyte closed 4 years ago

Dendrobyte commented 4 years ago

Duplicate highlights can no longer be added. For users who have already added multiple highlights, the !highlights remove <word> command will remove all instances of that highlight. image

Case sensitivity handled toLowerCase() method has been added in both adding and removing highlights.

Words handled in a single instance The only use case worried about is when the word is alone, i.e. ignoring "bye" in "goodbye"

!highlights list doesn't throw an error The error was from an embed being sent with an empty field. If the list is empty, the user is now sent a message informing them as such image

ghost commented 4 years ago

Any updates on this?

Dendrobyte commented 4 years ago

@cosmiccdev Been working on Hackathon bot. Once I get that wrapped up I will e v e n t u a l l y change use cases so that first and last words are tracked. Not too hard of a fix, just something I've been putting off but is on my agenda :D

ghost commented 4 years ago

Epic, LMK if you need any help.

Dendrobyte commented 4 years ago

image Basic punctuation checks and whatnot. Update on PR coming up soon.

Checks now include:

Highlights no longer triggered by being within a word

Dendrobyte commented 4 years ago

Also updated a "hidden" argument of delete to work alongside remove in case someone's intuition says that works more efficiently.

ghost commented 4 years ago

Looks good! I might want one more review on this just to double check I'm not missing anything because it's a lot of code but 👍