javascript - “ReferenceError:未定义命令”
问题描述
您好,我正在 Visual Studio Code 上制作 Discord 机器人。 我有一个错误出现:
ReferenceError:未定义命令。
这是我的代码(对不起,机器人的答案是法语,因为我是。),
我指定我放的代码只是“help.js” 我还有另一个“index.js”文件
const Discord = require('discord.js'),
config = require('../config.json')
var prefix = ("+");
module.exports = {
run: (message, args, client) => {
if (args[0]) {
const command = client.commands.get(args[0].toLowerCase())
if (!command || !command.help) return message.channel.send(' \' .'),
message.channel.send(new Discord.MessageEmbed()
.setDescription(`*** : ${command.name}***\n\n${command.help.description}\n\n : \`${config.prefix}${command.name}${command.help.syntax ? ` ${command.help.syntax}` : ''}\``)
.setColor('RANDOM'))
}
else if(message.content === prefix + "help"){
message.channel.send(new Discord.MessageEmbed()
.setDescription(" __ __**__Voici toutes les commandes disponible grâce au magnifique Pinocchio.__**")
.setThumbnail('https://i66.servimg.com/u/f66/20/08/95/81/intero10.png')
.addField("⛏ Modération :", `${command.name}`)
.addField(`${client.commands.filter(command => command.help).map(command => `\`${config.prefix}${command.name}\``).join(' ')}\n\n ' , \`${config.prefix}ℎ [nom de la commande]\``)
.addField(" Utilitaires :", "`poll`, `8ball`, `say`, `embed`,")
.addField(" Musique :", "`BIENTÔT`")
.setColor("#728cd9")
.setTimestamp()
.setFooter('Develop by Tomatee#0010', 'https://cdn.discordapp.com/attachments/853692920737824778/854420356591648778/fifi.jpg+help'))
}
},
name: 'help',
help: {
description: ' \' \'.',
syntax: '[nom de la commande]'
}
}
你能帮助我吗? 如果您需要更多信息文件,这是一张照片
解决方案
推荐阅读
- c# - TelegramBot 中的 WaxJS 交易
- python - Python OAuth 客户端凭据授予类型返回 400,[错误:不支持的授予]类型,但 Curl 工作正常
- react-native - 长文本上的水平自动滚动反应原生
- python - 运行外部串行软件的并行实例
- c++ - 无法在 linux 上使用 vcpkg
- rest - Dot Net Core 计划作业的最佳实践,用于在封闭的 On Premise 环境中进行点对点集成
- machine-learning - 使用 catboost 提高 CNN 模型的准确性
- javascript - Mapbox API:如何获取给定邮政编码下的地址列表?
- bundler - bundle exec rake:在 Ubuntu 20.04 docker 主机上找不到命令
- date - 显然相同的日期未通过等效性测试