我制作了每个前缀命令和一个帮助命令

时间:2021-04-15 09:39:04

标签: javascript discord.js

在我的帮助命令上有 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)
            }
        }
    };

0 个答案:

没有答案
相关问题