Discord 因此,我的机器人的这一部分工作得很好,除了它在发送此消息之前等待时间下降

Discord 因此,我的机器人的这一部分工作得很好,除了它在发送此消息之前等待时间下降,discord,discord.js,bots,Discord,Discord.js,Bots,因此,我的机器人的这一部分工作得很好,除了它在发送嵌入和“挂起的ping…”消息之前等待时间。我不确定如何解决这个问题,同时给用户足够的时间键入他们的响应: 谢谢你的阅读,我现在迷路了 bot.on('message', (message)=>{ if (message.content === '!host') { message.reply('please send join code, map, server region, and imposter count. (Ex

因此,我的机器人的这一部分工作得很好,除了它在发送嵌入和“挂起的ping…”消息之前等待时间。我不确定如何解决这个问题,同时给用户足够的时间键入他们的响应:

谢谢你的阅读,我现在迷路了

bot.on('message', (message)=>{
  if (message.content === '!host') {
    message.reply('please send join code, map, server region, and imposter count. (Ex. **REOSJQ The_Skeld North_America 2** ). \n**Once the game lobby is full, react to the active game embed with a :x: reaction.**');
                    message.channel.awaitMessages(m => m.author.id == message.author.id,
                            {max: 4, time: 75000})
                            .then(collected => {
                              splitmsg = collected.first().content.split(' ')
                                Code = splitmsg[0]
                                Maplocation =splitmsg[1].split('_').join(' ')
                                Region = splitmsg[2].split('_').join(' ')
                                Imposters = splitmsg[3]
                              // Check if we got a message before moving on
                              if (collected.first().content.split(' ').length === 4) {
                                var embed = new Discord.RichEmbed()
                                .setAuthor(message.author.username, message.author.avatarURL)
                                .setDescription(`Join code: ${Code}\nMap: ${Maplocation}\nServer Region: ${Region}\nImposter Count: ${Imposters}\n \n(If there is a :x: reaction at the bottom by the host, the game lobby is full. Please do not react unless you are the lobby host.)`)
                                .setTimestamp(new Date())
                                .setColor('0x7346EE');
                              DChannel.send(embed);
                              DChannel.send('<@&760366986563420200>');
                               message.channel.send('Pending ping..');
                            } else {
                              message.channel.send('Please try again in the correct format.');
                            }
                          }).catch(() => {
                            message.reply('it appears there is an error or timeout, please try again. If this continues, please ping admin.');
  });
}
});
bot.on('message',(message)=>{
如果(message.content=='!host'){
message.reply('请发送加入代码、地图、服务器区域和冒名顶替者计数。(例如。**REOSJQ The_Skeld North_America 2**)。\n**一旦游戏大厅满了,用:x:reaction.*'对活动游戏做出反应);
message.channel.awaitMessages(m=>m.author.id==message.author.id,
{max:4,time:75000})
。然后(收集=>{
splitmsg=collected.first().content.split(“”)
代码=splitmsg[0]
Maplocation=splitmsg[1]。拆分(“”)。连接(“”)
Region=splitmsg[2]。拆分(“”)。连接(“”)
冒名顶替者=splitmsg[3]
//在继续之前,检查我们是否收到消息
if(collected.first().content.split(“”).length==4){
var embed=newdiscord.RichEmbed()
.setAuthor(message.author.username、message.author.avatarURL)
.setDescription(`Join code:${code}\nMap:${Maplocation}\n服务器区域:${Region}\n海报计数:${Imposters}\n\n(如果主机底部有:x:反应,游戏大厅已满。除非您是大厅主机,否则请不要反应。)`)
.setTimestamp(新日期())
.setColor('0x7346EE');
数据通道发送(嵌入);
数据通道发送(“”);
message.channel.send('Pending ping..');
}否则{
message.channel.send('请以正确的格式重试');
}
}).catch(()=>{
message.reply('出现错误或超时,请重试。如果此情况继续,请ping admin');
});
}
});

学习如何提出一个好问题