Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/463.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 我做了每个前缀命令和一个帮助命令_Javascript_Discord.js - Fatal编程技术网

Javascript 我做了每个前缀命令和一个帮助命令

Javascript 我做了每个前缀命令和一个帮助命令,javascript,discord.js,Javascript,Discord.js,在我的帮助命令中有前缀not,但我想把它放在服务器前缀中,就像如果有人在帮助命令中更改服务器中我的机器人的前缀,它应该是他们服务器的前缀,如果可能的话,我需要帮助 const { MessageEmbed } = require("discord.js"); const { readdirSync } = require("fs"); const { stripIndents } = require("common-tags&qu

在我的帮助命令中有前缀not,但我想把它放在服务器前缀中,就像如果有人在帮助命令中更改服务器中我的机器人的前缀,它应该是他们服务器的前缀,如果可能的话,我需要帮助

const { MessageEmbed } = require("discord.js");
    const { readdirSync } = require("fs");
    const { stripIndents } = require("common-tags");
    const { embedcolor } = require("../../configs/config.json");
    const { default_prefix } = require("../../configs/config.json")
    const config = require('../../configs/config.json');

    module.exports = {
        config: {
            name: "help",
            aliases: ["h"],
            usage: "[command name] (optional)",
            category: "info",
            description: "",
            accessableby: "everyone"
        },
        run: async (client, message, args) => {

            const embed = new MessageEmbed()
                .setColor(embedcolor)
                .setAuthor(`${message.guild.me.displayName}`, message.guild.iconURL())
                .setThumbnail(client.user.displayAvatarURL())

            if (!args[0]) {

                embed.setDescription(`Soune's Prefix Is \`${default_prefix}\``)
                embed.setFooter(`${message.guild.me.displayName} | Total Commands - ${client.commands.size - 1} Loaded`, client.user.displayAvatarURL());
                embed.addField(`util [7] - `, '`dm`, `fullembed`, `help`, `poll`, `say`, `snipe`, `prefix`')
                embed.addField(`Fun [5] - `, '`cute`,`cat`, `dog`, `meme`, `ping`,')
                embed.addField(`Mod [13] - `, '`ban`, `clear`, `give-roles`, `kick`, `mute`, `nuke`, `slowmode`, `unmute`, `warn`, `lock`, `remove-roles`, `unban`, `unlock`')
                embed.addField(`info [6] - `, '`bot-info`, `server-info`, `total-bans`, `user-info`, `profile`, `uptime`')
                embed.addField(`giveaway [4] - `, '`giveaway`, `reroll`, `edit`, `end`')
                   
           
                embed.setFooter(`Antra My Owner`)
              
                embed.setTimestamp()

                return message.channel.send(embed)
            } else {
                let command = client.commands.get(client.aliases.get(args[0].toLowerCase()) || args[0].toLowerCase())
                if (!command) return message.channel.send(embed.setTitle("**Invalid Command!**").setDescription(`**Do \`${default_prefix}help\` For the List Of the Commands!**`))
                command = command.config

                embed.setDescription(stripIndents`**Prefix Is \`${default_prefix}\`**\n
                ** Command -** ${command.name.slice(0, 1).toUpperCase() + command.name.slice(1)}\n
                ** Description -** ${command.description || "No Description provided."}\n
                ** Usage -** ${command.usage ? `\`${default_prefix}${command.name} ${command.usage}\`` : "No Usage"}\n
                ** Needed Permissions -** ${command.accessableby || "everyone can use this command!"}\n
                ** Aliases -** ${command.aliases ? command.aliases.join(", ") : "None."}`)
                embed.setFooter(message.guild.name, message.guild.iconURL())

                return message.channel.send(embed)
            }
        }
    };

您需要设置一个数据库来跟踪前缀,欢迎使用StackOverflow。我建议对您的数据库使用。快乐编码!Thx这么多,如果我不明白,我会看到一个yt教程和idk如何保持跟踪前缀它很难与mongodb?