You can use "split" to convert the string to array and get the part you want. Example:
client.on('friendOrChatMessage', (senderID, message) => {
//Example Message: /bet 45
var arrmsg = message.split(" ") //arrmsg = ["/bet","45"]
var userNumber = arrmsg[1]
if (message.indexOf("/bet") == 0){
client.chatMessage(senderID, 'Your bet is: ' + userNumber);
}
});
You will have to add other things like be sure that input has /bet [number], verify the number can be used, etc