let filter = m => m.author.id === message.author.id
const collector = message.channel.createMessageCollector({filter, time: 15000, max: 1});
//name
let name = message.author.username
gender()
//gender
function gender(){
embed = embed
.setTitle(`${message.author.username}'s About Me setup || Gender`)
.setDescription('Whats your gender/pronounce?')
.setColor("BLUE")
message.reply({embeds: [embed]})
collector.on('collect', m =>{
let gender = m.content
m.channel.send(`${gender}`)
age()
})
}
//age
function age(){
embed = embed
.setTitle(`${message.author.username}'s About Me setup || Age`)
.setDescription('How old are you?')
.setColor("BLUE")
message.reply({embeds: [embed]})
collector.on('collect', m =>{
let age = m.content
m.channel.send(`${age}`)
nationality()
})
}
//nationality
function nationality() {
embed = embed
.setTitle(`${message.author.username}'s About Me setup || Nationality`)
.setDescription('Where are you from?')
.setColor("BLUE")
message.reply({embeds: [embed]})
collector.on('collect', m =>{
let nationality = m.content
m.channel.send(`${nationality}`)
description()
})
}
//description
function description(){
embed = embed
.setTitle(`${message.author.username}'s About Me setup || Age`)
.setDescription('Describe yourself, tell others your favorite hobbies, favorite movies, ect. in less than 1500 characters')
.setColor("BLUE")
message.reply({embeds: [embed]})
collector.on('collect', m =>{
if(m.content.length > 1500){
embed = embed
.setTitle(':warning: Error! :warning:')
.setDescription('Your description can only be less than 1500 characters')
.setColor("BLUE")
message.reply({embeds: [embed]})
description()
}
let description = m.content
m.channel.send(`${description}`)
})
}
hey, so I'm trying to make an about me command where when users say "about me setup" it will run through the setup and ask for information like gender, age, desc, etc. (the message.channel.send is just a placeholder, once I get it to work ill put it in an actual database), but it doesn't seem to work like how I expected it to, here's what happens when I try to run the command
On line:
const collector = message.channel.createMessageCollector({filter, time: 15000, max: 1});
Your message collector is only collecting messages for 15 seconds, and it will only collect 1 message.
From the DiscordJS documentation, createMessageCollector accepts the following arguments:
time: Amount of time in milliseconds the collector should run formax: Number of messages to successfully pass the filtermaxProcessed: Number of messages encountered (no matter the filter result)You can fix this by adjusting those parameters in the creation of your message collector to match your needs, or by reworking your command to accept parameters for gender, age, and nationality and use those parameters to construct the final description response.
On a side note: it looks like you are triggering your bots commands with the L! prefix. This is no longer recommended, as Discord has introduced slash commands.
Bots that are in more than 75 servers will not be able to read message content (it's becoming privileged). I'd recommend switching to slash commands so that you're using the latest way of providing interactions for your bot. There's a great tutorial showing how to create a bot from scratch using slash commands here.