Seeing the evolution of Discord's decisions regarding the bot ecosystem, I am no longer interested in contributing to the creation and maintenance of Discord bots. More informations here
A framework for modular and blazing fast Discord bots
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.
npm i hershel
// 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 Getting Started.
- Modular: Hershel supports plugin and decorator to make it extremely modular and extensible.
- Logging: We all like clean and clear logs. We use Pino, a super fast, json logger.
- Fast: No more useless feature loading you don't use.
- hershel/dispatcher - Command dispatcher for Hershel
- hershel/plugin - Plugin helper for Hershel
- hershel/examples - Example of integration with Hershel
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's theoretical logic & documentation layout, a fast and low overhead web framework for Node.js.
MIT