Im trying to make a madlib with a discord bot and somehow i have to assign a variable to each line of the user's message...
here's my code so far:
client.on('message', message=>{//madlib
var lib1 = [
' ',//<--(X)
'VERB',
'ADJECTIVE',
'NOUN (PLURAL)',
'ADJECTIVE',
'VERB ENDING IN "ING"',
'VERB',
'NUMBER',
'ADJECTIVE',
'NOUN (PLURAL)',
'NOUN (PLURAL)',
'NOUN (PLURAL)',
'RELATIVE (PLURAL)',
'ADJECTIVE',
'ADJECTIVE',
'NOUN (PLURAL)',
]
if (message.content == '!madlib'){
var rand = Math.floor(Math.random() * 2) + 1;
if (rand == '1'){
message.reply(lib1);
}
if (rand == '2'){
//im gonna put another madlib right here as another option and more random options.
}
}
})
not sure how the user is gonna insert the variables... does somebody know how to?