TextDynasty Posted November 15, 2017 Report Posted November 15, 2017 How can the bot send an offer according to the number people are asking Quote
timgfx Posted November 15, 2017 Report 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
TextDynasty Posted November 15, 2017 Author Report 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
Reason Posted November 18, 2017 Report 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
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.