# shardclient

> ShardClient is an easy to use discord.js extension that creates a client and handles commands, events, and message components.

Latest version **1.2.4** (published 2024-08-08) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.4 |
| Published | 2024-08-08 |
| First published | 2023-09-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 37.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ShardProductions |
| Maintainers | xsaoul |
| Keywords | discord.js, shard, shardclient, shard-client, client, bot, Discord, JavaScript, library, API, development, chat, chatbot, discord.js extension, framework, Node.js |

## Links

- npm: https://www.npmjs.com/package/shardclient
- Repository: https://github.com/xSaoul/ShardClient
- Homepage: https://github.com/xSaoul/ShardClient#readme
- Issues: https://github.com/xSaoul/ShardClient/issues
- npm.io page: https://npm.io/package/shardclient

## Dependencies (5)

- [chalk](https://npm.io/package/chalk.md) ^4.1.2
- [dotenv](https://npm.io/package/dotenv.md) ^16.3.1
- [mongoose](https://npm.io/package/mongoose.md) ^7.5.3
- [cli-table](https://npm.io/package/cli-table.md) ^0.3.11
- [discord.js](https://npm.io/package/discord.js.md) ^14.13.0

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.2.4 (latest) — 2024-08-08
- 1.2.3 — 2024-08-08
- 1.2.1 — 2024-05-22
- 1.1.2 — 2023-12-26
- 1.1.1 — 2023-10-12
- 1.1.0 — 2023-09-30
- 1.0.1 — 2023-09-28
- 1.0.0 — 2023-09-20

## README

# ShardClient - Custom Discord.js Client Package

Welcome to ShardClient, a powerful extension for Discord.js that enhances your bot development experience. This package provides a feature-rich custom client with extra utilities, methods, and streamlined structures for commands, events, components, and interaction context.

## Features

### Commands
- **Category & Help Display**: Organize commands into categories and display helpful information.
- **Command ID Handling**: Automatically attaches the Discord commandId and file path to each command object for later reference.
- **Main & Subcommands**: Easily define main commands and subcommands for later use.
- **Modularization**: Split commands and subcommands into separate files for better organization.
- **Native**: Pre-built reload command to test changes on the fly without interrupting your bot usage. This can be disabled during client creating.

```javascript
const { ShardClient, ClientOptions } = require('shardclient')
const bot = new ShardClient(
  new ClientOptions(
    .setNativeReloadCommand(false)
    ))
bot.login();
```

> **[Command Documentation](./example/commands/readme.md)**

### Events
- **Custom Events**: Custom events for each interaction type for greater control over your bot.
- **Flexible Event Naming**: Optional event naming for your convenience.
- **Native**: Commands, components, and modals are already handled for you! If you'd like to use your own events, you can disable ours during client creation.

```javascript
const { ShardClient, ClientOptions } = require('shardclient')
const bot = new ShardClient(
  new ClientOptions(
  .setNativeCommandEvent(false)
  .setNativeComponentEvent(false)
  .setNativeModalEvent(false)
  ))
bot.login();
```
> **[Event Documentation](./example/events/readme.md)**

### Components
- **Component Interactions**: Move message component interactions into separate files for organization.
- **Optional Naming**: Name your interactions as you see fit.

> **[Component Documentation](./example/components/readme.md)**

### Context
- **Command & Interaction Context**: Creates a command and interaction context object for easy access to all parameters.
- **Destructuring Support**: Combines all parameters into one `ctx` variable for simpler code.

### Automatic Handling
- **Effortless Setup**: All handlers are built into the package, making setup a breeze.
- **Dynamic File Sweeping**: Automatically scans and processes all necessary files within your directory structure.

## Installation

To install ShardClient using npm:

```bash
npm install shardclient
```
## Usage

Here's a basic example of how to set up your custom Discord.js client using ShardClient:

```javascript
const { ShardClient, ClientOptions } = require('shardclient')
const bot = new ShardClient(new ClientOptions())
bot.login();
```
For detailed usage and examples, please refer to the [example](./example/) folder.

## Contributing

Contributions to this project are welcome! If you have suggestions, bug reports, or feature requests, please open an issue or submit a pull request.

## License

ShardClient is licensed under the [MIT License](./LICENSE).

## Acknowledgements

Special thanks to the [Discord.js](https://discord.js.org/) community for their amazing work and inspiration.

## Support

Unfortunately we do not have any direct support lines open. In the future, we will have a Discord server ready to help whenever its needed!

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