Here is my code. I am wondering if there is a way to prompt the user to try to input a title again if they fail to meet the requirement of being less than 200 characters long. Thanks for any help!
message.author.send(
'Lets get to work!\nPlease enter the title of your event. (Must be shorter than 200 characters)'
);
message.channel
.awaitMessages(
(response) =>
response.author.id === message.author.id && response.content.length < 200,
{
max: 1,
time: 10000,
errors: ['time'],
}
)
.then((collected) => {
message.author.send(`I collected the message : ${collected.first().content}`);
let title = collected.first().content;
})
.catch(() => {
message.author.send('No message collected after 10 seconds.');
});