Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences here.
×
×
Cookie Preferences
We use Cookies to help personalize and improve Roll20. For more information on our use of non-essential Cookies, visit our Privacy Policy here.
I have a command, `!echo`, that I would like to run even if someone accidentally types `!Echo`. I'd rather not upload the same API twice, is it possible to write an API to listen for more than one command?
yes, it is - it's also possible to ignore the case in the text you are checking. If you post the line where you are checking the input text, we can show you how to modify it to avoid this issue.
I generally use a case-insensitive matching regular expression: if( /^!echo(\b\s|$)/i.test(msg.content) ) { but you could lowercase: if( msg.content.toLowerCase().startsWith("!echo") ) {