【发布时间】:2020-07-29 14:48:44
【问题描述】:
所以我无法理解如何定义消息,我已经搜索了很多并尝试了一些东西,但它不会工作。我是初学者,所以我可能只是忘记了我必须在哪里或如何做。
client.on("guildMemberAdd", async member => {
try {
await member.send(`Hello ${member}, welcome to the PotatoHost Server!
I want to help you and so my question is: Do you want to buy a server or do you need more informations first? \n
A: I want to buy a server
B: I need more informations first \n
Please react to this message with A or B.`)
.then(function (message) {
message.react("????")
message.react("????")
});
message.awaitReactions((reaction, user) => user.id == message.author.id && (reaction.emoji.name == '????' || reaction.emoji.name == '????'),
{ max: 1}).then(collected => {
if (collected.first().emoji.name == '????') {
message.reply('Ok, so you want to buy a server. Let me recommend you to visit <#699374469977735208>.');
client.destroy();
}
else
message.reply('Ok, so you need more informations first. Let me recommend you to visit <#699374469977735208>.');
})
} catch (err) {
console.log(err)
}
})
client.login(token);
【问题讨论】:
标签: javascript bots discord.js message