【发布时间】:2020-05-24 10:10:00
【问题描述】:
我正在制作一个机器人,当您执行 !train 时,它会在公告中说一些内容,还会向作者发送消息,并告诉他在完成训练后输入完成,然后编辑表示训练正在进行的消息或发送通知中的新消息。
case 'train':
if (message.member.roles.has('649756129240547348')) {
const user60 = message.author.username;
bot.channels.get("649756880314302464").send('<@&673125623463673857>');
bot.channels.get("649756880314302464").send('Subway Security Trainings!! \n Are you still awaiting tryout? Then come along to this training.\n (Slock in 10-15 minutes)\n https://www.roblox.com/games/4582202027/Subway-Security-Tryout-Centre\n https://discord.gg/bvYgmDe');
bot.channels.get("649756880314302464").send('Training underway, hosted by ' + user60);
message.author.send('Tell me when you have finished(say Finished)');
const collector = new Discord.MessageCollector(message.channel, m => m.author.id === message.author.id, {
time: 100000
});
collector.on('collect', message => {
if (message.content == 'Finished') {
bot.channels.get("649756880314302464").send('Training has finished. Hosted by ' + user60);
message.channel.sendMessage('Thanks!')
} else if (message.content == 'finished') {
bot.channels.get("649756880314302464").send('Training has finished. Hosted by ' + user60);
message.channel.sendMessage('Thanks!')
}
})
} else {
message.channel.sendMessage('You do not have the permission to do this command')
}
break;
【问题讨论】:
-
不,它没有,所以如果有人知道如何请帮助。一切正常,直到等待回复
-
请更具体地提出您的问题,现在还不清楚您到底想要什么以及在哪个地方。
标签: javascript visual-studio discord discord.js