# dbcm

> Discord Bot Commands Manager(dbcm) is project to support discord bot command control in a few lines.

Latest version **1.3.2** (published 2020-03-01) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install dbcm
pnpm add dbcm
yarn add dbcm
bun add dbcm
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.3.2 |
| Published | 2020-03-01 |
| First published | 2019-09-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 58.5 KB |
| Known vulnerabilities | 0 (+5 in 3 direct dependencies) |
| Install scripts | no |
| Author | 제로ㅣBrazil |
| Maintainers | zero734kr |
| Keywords | discord, discordjs-bot, botjs, cmd, command, 디스코드.js, discord.js |

## Links

- npm: https://www.npmjs.com/package/dbcm
- Repository: https://github.com/Zero-Brazil734/dbcm
- Homepage: https://github.com/Zero-Brazil734/dbcm#readme
- Issues: https://github.com/Zero-Brazil734/dbcm/issues
- npm.io page: https://npm.io/package/dbcm

## Dependencies (5)

- [fs](https://npm.io/package/fs.md) ^0.0.1-security
- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [request](https://npm.io/package/request.md) ^2.88.0
- [mongoose](https://npm.io/package/mongoose.md) ^5.7.7
- [discord.js](https://npm.io/package/discord.js.md) ^11.5.1

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.3.2 (latest) — 2020-03-01
- 1.3.1 — 2019-11-12
- 1.3.0 — 2019-11-03
- 1.2.9 — 2019-10-20
- 1.2.8 — 2019-10-15
- 1.2.7 — 2019-10-15
- 1.2.6 — 2019-10-01
- 1.2.5 — 2019-09-28
- 1.2.4 — 2019-09-28
- 1.2.3 — 2019-09-27
- 1.2.2 — 2019-09-26
- 1.2.1 — 2019-09-24
- 1.2.0 — 2019-09-23
- 1.1.9 — 2019-09-22
- 1.1.8 — 2019-09-15
- … 17 more at https://npm.io/package/dbcm/versions

## README

<center>
<h1>⚠️WARNING️ This package is now deprecated.</h1> 
</center>

<h1 align="center">Discord Bot Commands Manager🤖</h1>
<p>
  <a href="https://www.npmjs.com/package/dbcm" target="_blank">
    <img alt="Version" src="https://img.shields.io/npm/v/dbcm.svg">
  </a>
  <a href="https://github.com/Zero-Brazil734/dbcm/graphs/commit-activity" target="_blank">
    <img alt="Maintenance" src="https://img.shields.io/badge/Maintained%3F-no-red.svg" />
  </a>
  <a href="https://github.com/Zero-Brazil734/dbcm/blob/master/LICENSE" target="_blank">
    <img alt="License: MIT" src="https://img.shields.io/github/license/Zero-Brazil734/dbcm" />
  </a>
  <a href="https://npmcharts.com/compare/dbcm?minimal=true" target="_blank">
    <img alt="Downloads" src="https://img.shields.io/npm/dm/dbcm.svg">
  </a>
</p>
<div><center><a href="https://nodei.co/npm/dbcm"><img src="https://nodei.co/npm-dl/dbcm.png"></a></div>

> Discord Bot Commands Manager(dbcm) is project to support discord bot command control in a few lines.

## Install

- NPM:
```sh
npm install dbcm --save
```

- Yarn
```sh
yarn add dbcm
```

## Usage

```js
const Discord = require("discord.js")
const dbcm = require("dbcm")
const client = new dbcm.Client({
    dev: "Dev ID" || ["Dev ID", "Dev ID"], //That will ignore cooldown and blacklist.
    lang: "en-US", //This also can be setted by locale. (default: english) Supported languages: kr(korean), en(english) and pt(portuguese-brazil)
    disableEveryone: true, //discord.js client options are also valid.
    ignoresCooldown: ["User1", "User2"], //Specifying users to ignore cooldowns
    ignoreCooldownIfIsAdmin: true, //This will cause them to ignore cooldowns if they have admin permission
    cooldown: {
        time: 3000, //3 seconds
        msg: "%{message.author}, you're in cooldown to use the commands."
        /**
          * %{message.author} - mentions the author of msg
          * %{message.author.id} - The message author's user ID
          * %{message.guild.name} - The guild name
          * %{message.guild.id} - The id of guild
          * %{cmd.cooldown} - The cooldown of cmd in seconds. WARNING: That will appear in String type. Please use client.cooltime to get in Number type
        */
    },

    blacklist: {
        list: ["User ID"],
        msg: "%{message.author}, you're on blacklist."
        /**
          * %{message.author} - mentions the author of msg
          * %{message.author.id} - The message author's user ID
          * %{message.guild.name} - The guild name
          * ${message.guild.id} - The id of guild
        */
    }
})


//Registering the commands
client.registerCommands(require.resolve("./commands"), { createSample: true, jsFilter: true }) 
/*
If you type only client.registerCommands(require.resolve("./commands")), 
the two settings above will remain true which is the default.
*/


//Running the commands
client.on("message", async message => {
    //... your if(...) return options

    const args = message.content.slice("PREFIX".length).trim().split(/ +/g)
    const command = args.shift().toLowerCase()
    /*
    Some ways to get the command, such as message.content.split(" ") and a 
    few more lines, may not work because the command itself is contained in 
    the array. To solve this problem if even trying const command = <MessageArray>.shift() 
    doesn't work out, throw in the issues(https://github.com/Zero-Brazil734/dbcm/issues) 
    that check what the problem is.
    */

    //Running
    client.runCommand(command, msg, args, { dbpassword: "asdf1234", dbuser: "Anonymous" }) 
    /*
    Your own handling data, you can get it by placing it 
    in the object after args. (And of course you will need 
    to change the original exports.run to 
    exports.run = (client, message, args, yourdata) => { <CommandCode> })
    */
        .then(runned => {
            if(runned === true) return //do something
        })
        .catch(err => {
            throw new Error(err)
        })
    //The default is cooldown disabled

    //Utilities
    if(command === "discordStatus") { 
        utils.discordStatus("summary" || "status" || "unresolved_incidents" || "all_incidents" || "upcoming_maintenances" || "active_maintenances" || "all_maintenances", data => { //callback of the datas found
            console.log(data) 
        //Show this data in object form
        })
    }

    if(command === "reverse") { 
        msg.channel.send(utils.reverse(msg.content)) //Sending message with the message reversed of what you sent.
        /**
         * > utils.reverse("test")
         * > tset
        */
    }

    if(command === "numberFilter") {
        msg.reply(utils.numberFilter(args.join(" "), { toNumber: false }) //toNumber's default: false
        //Filter only the numbers in the message content and return it
    }

    //Other methods you may discover through IntelliSense
})
```

## Example

Please visit [dbcm-example](https://github.com/Zero-Brazil734/dbcm-example)

## Author

👤 **제로ㅣBrazil**

* Github: [@Zero-Brazil734](https://github.com/Zero-Brazil734)
* Discord: 제로ㅣBrazil#5005
* Email: zero734kr@gmail.com

## 🤝 Contributing

Contributions, issues and feature requests are **very** welcome!<br />Feel free to check [issues page](https://github.com/Zero-Brazil734/dbcm/issues).

## Show your support

Give a ⭐️ if this project helped you!

## 📝 License

Copyright © 2019 [제로ㅣBrazil](https://github.com/Zero-Brazil734).<br />
This project is [MIT](https://github.com/Zero-Brazil734/dbcm/blob/master/LICENSE) licensed.

***
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_

---
_Source: https://npm.io/package/dbcm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
