I'm currently making a bot for some reason, i wanted to add a command that will do math when some user typed <command> 1 + 2
and bot will answers 3
. And when it's <command> 2 * 3
, it will reply 6
. (Let's just use textbox for this case, if I typed 1 + 2 in textbox, theres an alert that shows "3").
My question is, is it possible, by any chance to make this kind of command? If so, I'd like to know how. Since I've learned a little about JavaScript RegEx and i think if i use it, it'll work out.