vasani-arpit / WBOT

A simple Web based BOT for WhatsApp™ in NodeJS 😜. Working as of 📅 Feb 4th, 2024
Other
987 stars 314 forks source link

Cover the case of noMatch in processMessages. Fixes #257 #268

Closed nikhilmaske-2001 closed 2 years ago

nikhilmaske-2001 commented 2 years ago

I have added an else statement to cover the case of noMatch. This way we can cover all the cases as well as we can refractor some code from the above lines. Now the logic for obtaining the response is pretty straight forward, it looks like:

if(exactMatch or partialMatch is found) {
    we have perfect response for it
} else {
    we have some default `noMatch` response
}
nikhilmaske-2001 commented 2 years ago

@tbs-arpit This PR is ready for the review. Do I need to run npm minor version here also?