成功发送DM时回复

时间:2020-04-08 11:04:53

标签: javascript node.js discord discord.js

我有一个向某人发送DM的代码,但是如果用户禁用了DM,它将回复DM被禁用。

 mention.send("A message.").catch(() => message.reply("User has DM disabled, cannot send message."));

但是我希望机器人用Message has been sent之类的东西来回复。谢谢。

1 个答案:

答案 0 :(得分:1)

mention.send("A message.")
.then(() => message.reply("Message has been sent."))
.catch(() => message.reply("User has DM disabled, cannot send message."));