Don't require commands be uppercase when using !cmd#1823
Don't require commands be uppercase when using !cmd#1823
!cmd#1823Conversation
when using `!cmd` IRC commands can be lowercase. Signed-off-by: Ferass El Hafidi <vitali64pmemail@protonmail.com>
Signed-off-by: Ferass El Hafidi <vitali64pmemail@protonmail.com>
Signed-off-by: Ferass El Hafidi <vitali64pmemail@protonmail.com>
Half-Shot
left a comment
There was a problem hiding this comment.
Seems reasonable aside from a lost test?
| `!cmd ${roomMapping.server} TOPIC ${newChannel} :some new fancy topic`, | ||
| `!cmd ${roomMapping.server} PART ${newChannel}`, | ||
| `!cmd ${roomMapping.server} STUPID COMMANDS`, | ||
| `!cmd rubbishserver SOME COMMAND`]; |
There was a problem hiding this comment.
we've lost the test for an invalid server here?
There was a problem hiding this comment.
With this change "rubbishserver" is now interpreted as a command rather than as a server.
There was a problem hiding this comment.
right...we still need to interpret servers here.
There was a problem hiding this comment.
They are interpreted correctly when valid, but rubbishserver matches the new regex.
Perhaps that could be replaced by rubbish^server! or something?
There was a problem hiding this comment.
Or we could have two servers configured to ensure that the first string needs to match a server.
I think it's okay to let this one slide though. We're not breaking anything anything except wrong usage of commands, and I don't think there's much of a risk of a server being called quit or something that could land a user in (minor) trouble.
| // rubbishserver should not be accepted | ||
| // 4 commands should be executed | ||
| const commands = [ | ||
| `!cmd ${roomMapping.server} JOIN ${newChannel}`, |
There was a problem hiding this comment.
We still need to test lower case though?
Split off from #1807, credit to @funderscore1