# hershel

> 🤖 Modular and minimal Discord bot framework for Node.js

Latest version **3.0.0** (published 2020-08-20) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2020-08-20 |
| First published | 2018-07-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 39.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | HelloEdit |
| Maintainers | helloedit |
| Keywords | discord.js, framework, discord, bot |

## Links

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

## Dependencies (8)

- [ow](https://npm.io/package/ow.md) ^0.17.0
- [pino](https://npm.io/package/pino.md) ^6.5.1
- [avvio](https://npm.io/package/avvio.md) ^7.2.0
- [discord.js](https://npm.io/package/discord.js.md) ^12.3.1
- [@types/pino](https://npm.io/package/@types/pino.md) ^6.3.0
- [koa-compose](https://npm.io/package/koa-compose.md) ^4.1.0
- [abstract-logging](https://npm.io/package/abstract-logging.md) ^2.0.0
- [@types/koa-compose](https://npm.io/package/@types/koa-compose.md) ^3.2.5

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@atlaskit/theme](https://npm.io/package/@atlaskit/theme.md) — 402.0K weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2020-08-20
- 2.2.1 — 2019-10-28
- 2.2.0 — 2018-11-21
- 2.1.1 — 2018-09-13
- 2.1.0 — 2018-08-22
- 2.0.0 — 2018-07-19
- 1.0.3 — 2018-07-15
- 1.0.2 — 2018-07-14
- 1.0.1 — 2018-07-14

## README

<p align="center">
  <img src="https://raw.githubusercontent.com/hershel/hershel/master/media/hershel.png" />
</p>

<h2 align="center">Hershel</h2>

<p align="center">
  <em>A framework for modular and blazing fast Discord bots</em>
</p>

<p align="center">
  <a href="https://www.npmjs.com/package/hershel">
    <img alt="Hershel on npm" 
    src="https://img.shields.io/npm/v/hershel.svg">
  </a>
  <a href="https://travis-ci.com/hershel/hershel">
    <img alt="Travis CI" 
    src="https://travis-ci.com/hershel/hershel.svg?branch=master">
  </a>
  <a href="https://coveralls.io/github/hershel/hershel">
    <img alt="Coveralls"
    src="https://coveralls.io/repos/github/hershel/hershel/badge.svg?branch=master">
  </a>
  <a href="https://github.com/prettier/prettier">
    <img alt="Prettier"
    src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg">
  </a>
  <a href="https://github.com/hershel/hershel/blob/master/LICENSE">
    <img alt="MIT License"
    src="https://img.shields.io/badge/License-MIT-yellow.svg">
  </a>
</p>

---

![demo](https://raw.githubusercontent.com/hershel/hershel/master/media/demo.png)

Hershel is a small, highly modular Discord bots framework based on the fact that you don't need to embed unnecessary features / code in your bot project. Hershel allows you to write your own message processing logic or to use the packages at your disposal to build an awesome Discord bot.

## Install

```
npm i hershel
```

## Example

```js
// require Hershel's Client
const { Client } = require('hershel')

// instantiate it
const bot = new Client({
  logger: true,
})

bot.use(({ message, state }, next) => {
  if (message.author.bot) return

  state.permission = getPermissionFor(message.author)

  next() // call next middleware
})

bot.use(async ({ message, createReply, state }) => {
  // use Hershel's reply API
  const response = createReply()

  await response // response is an embed by default
    .setTitle('Echo... Echo... Echo...')
    .setAuthor(`${message.author} with perm ${state.permission.level}`)
    .setDescription(message.content)
    .setFooter('Powered by Hershel')
    .send() // returns a promise

  await response.setTitle('Update embed title 🙈').update()
})

bot.login(process.env.DISCORD_TOKEN)
```

Do you want to know more? Head to the <code><b>Getting Started</b></code>.

## Features

- **Modular:** Hershel supports plugin and decorator to make it extremely modular and extensible.
- **Logging:** We all like clean and clear logs. We use [Pino](https://github.com/pinojs/pino), a super fast, json logger.
- **Fast:** No more useless feature loading you don't use.

## Documentation

- <a href="./docs/getting-started.md"><code><b>Getting Started</b></code></a>
- <a href="./docs/plugin.md"><code><b>Plugin</b></code>
- <a href="./docs/middleware.md"><code><b>Middleware</b></code>
- <a href="./docs/reply.md"><code><b>Reply</b></code>
- <a href="./docs/decorator.md"><code><b>Decorator</b></code>
- <a href="./docs/logging.md"><code><b>Logging</b></code>

## Related

- [hershel/dispatcher](https://github.com/hershel/dispatcher) - Command dispatcher for Hershel
- [hershel/plugin](https://github.com/hershel/plugin) - Plugin helper for Hershel
- [hershel/examples](https://github.com/hershel/examples) - Example of integration with Hershel

## Thanks

Thanks to Algorythmis for his corrections of the code. Thanks also to Bit My Code for their support and their 💖.

Hershel uses part of [Fastify](https://github.com/fastify/fastify)'s theoretical logic & documentation layout, a fast and low overhead web framework for Node.js.

## License

MIT

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