javascript - 为什么使用命令时我的代码无法访问?
问题描述
from let answer = message.content
to Hiring status: ${message.content}
) 代码无法访问这里是完整的代码:
module.exports = {
name: "status",
category: "status check",
description: "Checks the status of the pm manager.",
aliases: [],
usage: "status",
userperms: ["ADMINISTRATOR"],
botperms: [],
run: async (client, message, args) => {
return message.channel.send(`what is your hiring status?`);
let answer = message.content;
return message.channel.send(`Status of ${message.author}:\n` + `Hiring status: ${message.content}`);
},
};
解决方案
删除所有return
fromrun
函数。
module.exports = {
name: 'status',
category: 'status check',
description: 'Checks the status of the pm manager.',
aliases: [],
usage: 'status',
userperms: ['ADMINISTRATOR'],
botperms: [],
run: async (client, message, args) => {
message.channel.send(`what is your hiring status?`)
let answer = message.content
message.channel.send(`Status of ${message.author}:\n` +
`Hiring status: ${message.content}`)
}
}
推荐阅读
- apache-kafka - cli 模式下的 Quarkus Kafka
- python - 如何在 Python 中按字母顺序对文件进行排序
- javascript - 如何在 nodeValue 中插入 span 元素
- c++ - 无法在 C++ 中初始化静态成员
- c++ - C++:创建模板结构的 C++ 向量
- typescript - 如何在 TypeScript 中使用模板文字类型作为返回类型属性
- crystal-reports - Crystal Reports 的额外页面
- python - 如何将带有法国口音和表情符号的 CSV 上传到 Google 表格?
- codeigniter - 将单行字段更改为 1,将所有其他字段更改为零代码点火器
- python - 使用参数 Python fsolve 求解方程