发送DM,然后在新用户加入后对消息做出反应

时间:2020-04-04 14:32:14

标签: javascript node.js discord discord.js

因此,每次有新用户加入时,我都会使用

向用户发送一条消息
client.on ("guildMemberAdd", member => {

member.send("WELCOME")})

现在,机器人有什么办法响应该消息? 谢谢!

2 个答案:

答案 0 :(得分:1)

您需要在变量中包含member.send(),然后在其上使用.react()方法。

所以您的解决方案是:

const msg = await member.send("WELCOME")
await msg.react("?");

答案 1 :(得分:1)

类似于Syntle的答案,但是使用了promises。 (我的首选用途)

   member.send("WELCOME").then(function(msg){
       msg.react("?");
   }
相关问题