@abdevs/console-manager 中文文档教程

发布于 3年前 浏览 20 项目主页 更新于 3年前

Console Manager

banner

一个用于管理和添加控制台命令的库。 您可以轻松地从命令行获取命令和参数。

Support

加入我们的 Discord Server 以获取任何与支持相关的查询。

Setup

使用 npm i @abdevs/console-manager 安装库。

const { addCommand, init } = require('@abdevs/console-manager');

addCommand({
  command: 'do-something',
  handler: async (args, command) => {
    //Do Something
  },
  description: 'This command does something',
  aliases: ['something-do'],
  completers: [['1', '2'], ['add', 'sub'], async () => ['yes', 'no']],
});

init({
  //Options
});

Option Properties

Property NameDefaultDescription
isHelpCommandfalseAdd a default help command

Command Properties

Property NameDefaultDescription
command*Command for the handler to execute
handler*Function that will be execute on command
descriptionNo description providedString Description of the command
aliases[]String Array of as aliases
completersFunction => string[] | string[][]Array of function(s) that returns a string array or an array of string arrays

* 属性是必需的

Terms and Conditions

此存储库仅可用于代码查找和个人使用。

您不得从该存储库中窃取代码。

Console Manager

banner

A library to manage and add console commands. You can easily take command and arguments from command line.

Support

Join our Discord Server for any support related queries.

Setup

Install the library with npm i @abdevs/console-manager.

const { addCommand, init } = require('@abdevs/console-manager');

addCommand({
  command: 'do-something',
  handler: async (args, command) => {
    //Do Something
  },
  description: 'This command does something',
  aliases: ['something-do'],
  completers: [['1', '2'], ['add', 'sub'], async () => ['yes', 'no']],
});

init({
  //Options
});

Option Properties

Property NameDefaultDescription
isHelpCommandfalseAdd a default help command

Command Properties

Property NameDefaultDescription
command*Command for the handler to execute
handler*Function that will be execute on command
descriptionNo description providedString Description of the command
aliases[]String Array of as aliases
completersFunction => string[] | string[][]Array of function(s) that returns a string array or an array of string arrays

* Property is required

Terms and Conditions

This Repository only available for code look up and personal use.

You are not allowed to steal the code from this repository.

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文