TextDynasty Posted November 15, 2017 Report Share Posted November 15, 2017 How can the bot send an offer according to the number people are asking Quote Link to comment Share on other sites More sharing options...
timgfx Posted November 15, 2017 Report Share Posted November 15, 2017 Bots filter the message sent to the specific number (with .replace, .split, whatever) Then convert the data type of that string containing a number to an actual number with parseInt, then it processes the trade with X items Quote Link to comment Share on other sites More sharing options...
TextDynasty Posted November 15, 2017 Author Report Share Posted November 15, 2017 Bots filter the message sent to the specific number (with .replace, .split, whatever) Then convert the data type of that string containing a number to an actual number with parseInt, then it processes the trade with X itemsYes, could you give me an example, so i can start configuring it? Thanks Quote Link to comment Share on other sites More sharing options...
Reason Posted November 18, 2017 Report Share Posted November 18, 2017 var message = '/command 5' var res = null; if (res = /^\/command ([0-9]*)/.exec(message)) { var = number = res[1]; console.log(number);// 5 } else { console.log("command not found"); } it should work i didn't test Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.