这是我的代码。我想知道是否有一种方法可以在用户不满足长度小于200个字符的要求时提示用户再次尝试输入标题。谢谢你的帮助!
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.');
});
慕哥9229398
相关分类