簡體   English   中英

發送 DM,然后在新用戶加入后對消息做出反應

[英]Send a DM and then reacts to the message once a new user joins

所以每次有新用戶加入時,我都會使用

client.on ("guildMemberAdd", member => {

member.send("WELCOME")})

現在,機器人有什么方法可以對該消息做出反應? 謝謝!

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

所以你的解決方案是:

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

類似於 Syntle 的答案,但使用了 Promise。 (我的首選用途)

   member.send("WELCOME").then(function(msg){
       msg.react("😀");
   }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM