我有一个向某人发送DM的代码,但是如果用户禁用了DM,它将回复DM被禁用。
mention.send("A message.").catch(() => message.reply("User has DM disabled, cannot send message."));
但是我希望机器人用Message has been sent
之类的东西来回复。谢谢。
答案 0 :(得分:1)
mention.send("A message.")
.then(() => message.reply("Message has been sent."))
.catch(() => message.reply("User has DM disabled, cannot send message."));