【发布时间】:2020-07-16 16:05:36
【问题描述】:
所以每次有新用户加入时,我都会使用
向用户发送消息client.on ("guildMemberAdd", member => {
member.send("WELCOME")})
现在,机器人有什么方法可以对该消息做出反应? 谢谢!
【问题讨论】:
标签: javascript node.js discord discord.js
所以每次有新用户加入时,我都会使用
向用户发送消息client.on ("guildMemberAdd", member => {
member.send("WELCOME")})
现在,机器人有什么方法可以对该消息做出反应? 谢谢!
【问题讨论】:
标签: javascript node.js discord discord.js
您需要在变量中包含member.send(),然后对其使用.react() 方法。
所以你的解决方案是:
const msg = await member.send("WELCOME")
await msg.react("?");
【讨论】:
与 Syntle 的答案类似,但使用了 Promise。 (我的首选)
member.send("WELCOME").then(function(msg){
msg.react("?");
}
【讨论】: