# @yamdbf/command-usage

> YAMDBF plugin for logging command usage and command usage statistics

Latest version **1.0.0-indev.a1a9483b1020966ac4549f824ee6375618080744** (published 2020-12-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @yamdbf/command-usage
pnpm add @yamdbf/command-usage
yarn add @yamdbf/command-usage
bun add @yamdbf/command-usage
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-indev.a1a9483b1020966ac4549f824ee6375618080744 |
| Published | 2020-12-27 |
| First published | 2020-12-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 16.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Zackary Campbell |
| Maintainers | zajrik |
| Keywords | discord, bot, yamdbf, node |

## Links

- npm: https://www.npmjs.com/package/@yamdbf/command-usage
- Repository: https://github.com/zajrik/yamdbf-command-usage
- Homepage: https://github.com/zajrik/yamdbf-command-usage#readme
- Issues: https://github.com/zajrik/yamdbf-command-usage/issues
- npm.io page: https://npm.io/package/@yamdbf/command-usage

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.0.0-indev.a1a9483b1020966ac4549f824ee6375618080744 (latest) — 2020-12-27
- 1.0.0-indev.015df655afa1186175f72c634ad9736a33853c9f (indev) — 2020-12-27

## README

# command-usage
`command-usage` is a plugin for Discord bots that are written with YAMDBF+Discord.js
that gives the ability to have commands logged to a specified channel and to view
command usage statistics via a `usagestats` command.

# Usage
Install the package via `npm`:
```
npm install --save @yamdbf/command-usage
```
or to install the indev version:
```
npm install --save yamdbf/command-usage#indev
```

>Note: This plugin depends on YAMDBF >3.0.0, so obviously make sure `yamdbf` is installed

There are two ways to use the plugin after installing. The first is a simple automatic
import by passing `'command-usage'` to your YAMDBF Client options `plugins` array field:
```js
const { Client } = require('@yamdbf/core');

const client = new Client({
	...
	plugins: ['command-usage']
});
```
>Using the plugin this way does not allow for command logging to Discord

The second is via a manual import, which will give access to command logging via a specified
guild text channel. You must import `commandUsage` from the package and pass it to your
YAMDBF Client options `plugins` array field with the channel ID of the channel you want
commands to be logged to:
```js
const { Client } = require('@yamdbf/core');
const { commandUsage } = require('@yamdbf/command-usage');

const client = new Client({
	...
	plugins: [commandUsage('channelID')]
});
```

If you find any problems or have any suggestions, don't hesitate to open up an issue.

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