javascript - 为什么这个 Dm 命令不适用于某些 id ?不和谐的js
问题描述
const devs = [
'user1ID',
'user2ID',
'user3ID',
'user4ID'
]
if (devs.includes(message.author.id)) {
const target = client.users.cache.get(args[0]);
let payload = message.content.slice(8)
if (!target) return message.channel.send("User not found");
client.users.cache.get(target.id).send(payload)
message.channel.send("DM has been Sent :tick:")
.catch(() => message.lineReply("User has DMs closed or has no mutual servers with the bot"));
}
else {
message.channel.send("You don't have permission to use this command")
}
它说用户未找到某些 id 和其他它成功发送 dm 并且当它发送它时也发送 id。请帮我。
解决方案
推荐阅读
- google-chrome - Office.context.ui.messageParent 在 Chrome 和 Firefox 中不起作用
- c++ - 如何在不丢失 C++ 精度的情况下将字符串转换为双精度或浮点数
- python - 使用线程和队列将记录器消息重定向到 python 中的 tkinter 小部件
- nginx - nginx:是否有最大“client_max_body_size”?
- hapi-fhir - Hapi Fhir 查询与 AND / OR 与地图
- php - 调度队列作业(本地 Dev Mac)不工作
- java - 这个错误的原因是什么?那是因为连接从服务器端或客户端关闭吗?
- angular - Angular 帮助:下拉菜单,默认选中所有选项
- google-apps-script - 错误“无效参数:”使用 UrlFetchApp.fetch(url) 与 where date 'yyy-MM-dd'
- android - 每次滑动清除 ViewPager 中的片段数据