codebuddies / greetbot

Slackbot for greeting new codebuddies users
MIT License
9 stars 14 forks source link

A bogus command returns all resources instead of empty #90

Open stain88 opened 6 years ago

stain88 commented 6 years ago

This shouldn't really happen

stain88 commented 6 years ago

Oh, I see: no default case in the sortArguments, so it's not filtering by anything, so everything is kept.

mndominguez commented 5 years ago

I can work on this @stain88

stain88 commented 5 years ago

All yours @mndominguez

mndominguez commented 5 years ago

@stain88 do you think that the default case should include a push for each type of argument? If not, then I think the function should be broken down and refactored in four, one for languages, one for levels and so on.

stain88 commented 5 years ago

I think a generic default could work: if you ask for something that "isn't there", regardless of whether it is language, level, type, then nothing should be returned. Of course, that would mean being extremely harsh with typos, or other spellings.

mndominguez commented 5 years ago

Agreed. I just opened a PR.

peoray commented 5 years ago

When I type any language, even anyone that doesn't exist like vbmvb, it returns resources for python?

stain88 commented 5 years ago

yeah this isn't complete yet, I'll rename the title