我正在尋求您的幫助。我正在嘗試發(fā)送一條消息,等待回復(fù),然后當用戶在時限內(nèi)答復(fù)時,它會發(fā)送另一條這樣的消息。我不知道你是否了解我。如果您需要更多信息,請不要回答。真摯地。我當前的代碼:const filter = m => m.author.id === message.author.id && m.author.id !== bot.user.id// CHOISIR LE NOM message.reply("S'il vous pla?t choisissez un nom pour le tournoi.").then(r => r.delete(10000)); message.channel.awaitMessages(filter, { max: 1, time: 10000 }).then(collected => { if(collected.first().content === "stop" || collected.first().content === "cancel"){ return message.reply("Création du tournoi annulé.") } let tournamentname = collected.first().content; db.collection("tournois").findOneAndUpdate({"tournamentInformations.status": "active"}, { $set: { "tournamentInformations.tournamentName": tournamentname }}, {upsert: true}, function(err,doc) { if (err) { throw err; } }); message.channel.send(":white_check_mark: | Vous avez défini le nom du tournoi à "+tournamentname); }).catch(err => { console.log(err) })// CHOISIR L'ORGANISATEUR message.reply("S'il vous pla?t choisissez le nom de l'organisateur.").then(r => r.delete(10000)); message.channel.awaitMessages(filter, { max: 1, time: 10000 }).then(collected => { if(collected.first().content === "stop" || collected.first().content === "cancel"){ return message.reply("Création du tournoi annulé.") } let organisateur = collected.first().content; db.collection("tournois").findOneAndUpdate({"tournamentInformations.status": "active"}, { $set: { "tournamentInformations.organizedBy": organisateur }}, {upsert: true}, function(err,doc) { if (err) { throw err; } });
在等待消息之后發(fā)送幾條等待消息
蕪湖不蕪
2021-05-12 17:29:53