Jump to content
McKay Development

Lobadzip

Member
  • Posts

    1
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Lobadzip reacted to SunriseM in How can I get data from the user?   
    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
×
×
  • Create New...