Reputation: 11
how would I put the 2nd part of a command at the end of the bot's response.
example:
me: !example example.html
bot: example.com/example.html
another example:
me: !example example2.html
bot: example.com/example2.html
Upvotes: 1
Views: 16
Reputation: 4562
I hope this helps
function convert(me){
var transform = me.replace('!', '').split(' ');
transform[0] += '.com/';
var bot = transform.join('');
return bot
}
console.log(convert('!example example2.html'));
Upvotes: 1