【发布时间】:2021-04-09 11:12:05
【问题描述】:
我的 discord.js 机器人中有一个 kick 命令,我想让机器人向被踢的人发送 DM。我不能这样做:
user.send(message)
target.kick(reason).then((m) => {
// do the other stuff here
});
使用此代码,不会发送 DM。 这就是我所做的:
user.send(message).then((msg) => {
target.kick(reason).then((m) => {
// do the other stuff here
});
});
现在的问题是,如果目标阻止了机器人,机器人就不能 DM 他们,导致踢他们的代码无法运行。 我该如何解决这个问题?
【问题讨论】:
标签: discord.js