Skip to content

Renn-Rivon/command-permission

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

command-permission

Discord server GitHub package.json version GitHub package.json version

Русский README

Installation

$ npm install command-permission
  • discord.js >= 12.0.0

Description

Easy to use command manager.
1.1. Checking the bot for the necessary rights to execute the command.
1.2. Checking the user for the necessary rights to call the command.
1.3. The bot owner can use any commands on any server, subject to paragraph 1.1.

Built-in commands: 
2.1. prefix - display prefixes,
2.2. help - list of commands
2.3. help [command] - information about the command.
2.4. Built-in commands are disabled in parameters: "commandHelp", "commandPrefix"

Example

index.js

const Discord = require("discord.js");
const client = new Discord.Client({ disableEveryone: true });

const permission = require("command-permission");
permission.command(client, {
    botOwner: ["botOwnerID"], //bot author id
    commands: "commands", //path to the commands folder, commands must be stored in one of the subfolders of this folder
    botPrefix: ["!", "*", ">"], //bot prefix
    commandDM: false, //true|false - on|off using commands in bot DM
    commandHelp: true, //true|false - on|off command help
    commandHelpDM: true, //true|false - on|off DM command help
    commandPrefix: true //true|false - on|off command prefix
    language: "en_EN" // language setting
});

client.login("Bot Token");

commands/info/test.js

module.exports = {
    name: "test", //command name
    aliases: [], //aliases
    category: "info", //the category in which the command file is located
    description: "Show avatar (your / user)", //description
    usage: "avatar [user]", //example of use
    clientPerm: ['ATTACH_FILES'], //list of bot rights for successful command execution
    memberPerm: [], //list of user rights for successful command execution
    onlyOwner: false, //true - the command can only be used by the owner of the bot
    run: async(client, message, args) => {
        
        //your code
        
    }
};

Language

Русский:     language: "ru_RU"
English:     language: "en_EN"
Українська:  language: "uk_UK"
Белорусский: language: "be_BE"
Polski:      language: "pl_PL"

Links

License

MIT

About

Easy to use discord bot rights checker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published