SkillAgentSearch skills...

AxonCore

The best fully featured discord bot framework for javascript (eris, discordjs or detritusjs)!

Install / Use

/learn @Khaaz/AxonCore

README

<div align="center"> <br /> <p> <a href="https://khaaz.github.io/AxonCore"> <img src="_images/axoncore_banner.png" width="546" alt="AxonCore" /> </a> </p> <p> <a href="https://github.com/Khaaz/AxonCore/releases"> <img src="https://img.shields.io/github/release/Khaaz/AxonCore.svg?style=flat" alt="Release" /> </a> <a href="https://www.npmjs.com/package/axoncore"> <img src="https://img.shields.io/npm/v/axoncore.svg?maxAge=3600" alt="NPM version" /> </a> <a href="https://www.npmjs.com/package/axoncore"><img src="https://img.shields.io/npm/dt/axoncore.svg?maxAge=3600" alt="NPM downloads" /></a> <a href="https://discord.gg/QZ6B5US"> <img src="https://discordapp.com/api/guilds/365236789855649814/embed.png" alt="Discord server" /> </a> </p> <p> <a href="https://github.com/Khaaz/AxonCore/actions"> <img src="https://github.com/Khaaz/AxonCore/workflows/Test/badge.svg" alt="Test status" /> </a> <a href="https://github.com/Khaaz/AxonCore/actions"> <img src="https://github.com/Khaaz/AxonCore/workflows/Docgen/badge.svg" alt="Docgen status" /> </a> <a href="https://github.com/Khaaz/AxonCore/deployments"> <img alt="GitHub deployments" src="https://img.shields.io/github/deployments/khaaz/axoncore/github-pages?label=gh-pages" /> </a> <a href="https://www.codefactor.io/repository/github/khaaz/axoncore"><img src="https://www.codefactor.io/repository/github/khaaz/axoncore/badge" alt="CodeFactor" /></a> <a href="https://david-dm.org/khaaz/khaaz"><img src="https://img.shields.io/david/khaaz/axoncore.svg?maxAge=3600" alt="Dependencies" /></a> </p> <p> <a href="https://nodei.co/npm/axoncore/"> <img src="https://nodei.co/npm/axoncore.png?downloads=true&stars=true" alt="NPM info" /> </a> </p> </div>

AxonCore

Complete, Stable, Fast, Universal
The best all-in-one framework for discord bots. The power of a fully featured framework, the simplicity of a predictable API.

AxonCore is an all in one framework, built to make bot development fast and easy. Focus only on what matters: creating commands for your users. AxonCore handles all the hard and annoying work for you. Take advantage of its stability and robustness to fasten your development.
AxonCore is opiniated to enforce good code practice and has all features you could possibly want in a framework, from command and event handlers, to full Database support, more details further down.
AxonCore is lib agnostic, which mean you can use it indifferently with Eris, Discord.js or Detritusjs.

When to use AxonCore:

  • If you want power and stability in your bots.
  • Creating simple bots fast and easy with many customisation options.
  • Creating large stable bots designed to scale.

When not to use AxonCore:

  • If you prefer to create your own client for your specific needs.
  • If you prefer an unopiniated solution or don't want to use the features AxonCore offers.
  • If you don't want a Database at all or prefer other ways to interact with a DB.

Main Features

  • Client - Extendable custom client with an advanced permission system.
  • Command Handler - Easy and fast fully customisable command creation with advanced permission and options system, command throttling and subcommands.
  • Event Handler - Setup and react to discord events.
  • Library agnostic - Work with any javascript discord library (eris, discordjs, detritusjs).
  • Modular - Separate your bot into several modules to entirely encapsulate your application.
  • Extendable - Extend anything that you want on top of the framework.
  • Controlable execution flow - Control every step from client initialisation to command execution.
  • Database - Built in database support (extendable to any database type - SQL, NoSQL).
  • Advanced error management - Advanced context management and error tracking for easy bug-hunting.
  • Hooks - Execute functions and actions on events (inhibitor hooks, pre/post-execute hooks, finalizers hooks). [TODO]
  • Translations - Built-in support for translation and message management system.
  • Logging - Built-in custom logging.
  • Tracking - Easily track and debug command usage, events and errors with custom events emitted by AxonCore.
  • Typescript support - Full typescript and intellisense support

Philosophy

AxonCore was built with specific aims. At it's core, it makes developing a bot fast and easy, particularly for developers that want to create small and specific bots for communities (singe server, small set of servers). However, this framewok is also designed for scaling, and creating a big public bot is super easy and fast thanks to all features embeded in the framework and its stability.

Primarily designed to work with Eris, all the library implementation was abstracted to make the framework library agnostic, which means you can use it with other existing JS libraries, like Discord.js, Eris or Detritusjs).

It was built with an OOP approach and uses predictable abstraction while keeping the power and speed of javascript prototypal nature. Separation of concerns makes sure everything is correctly encapsulated, maintainable and extendable. The framework is fully modular (AxonCore uses Modules that holds set of commands, events, etc...). It also comes with a lot of features for all possible usages and needs. AxonCore will handle everything, leaving only one job to you: creating the bot. It does however still allow you to edit and customise anything you want with a full extendable approach and total control over the initialisation and execution flow.

Setup

Examples
To get your application started easily, you can use the create-app boilerplate: create-axoncore-app.
Here's how to use it:
yarn create axoncore-app --lib <library> --type <module management type> <destination>
npm init axoncore-app --lib <library> --type <module management type> <destination>

  • Available libraries: eris, discordjs.
  • Available module types: commonjs, esm, ts.

AxonCore has FULL typescript support.
When you install the package the first time, you can choose the library you are using, and the package will automatically link the library typings. That will allow you to have full and complete typings for your typescript project or for using intllisense.
Note: AxonCore creates a .axoncorerc file with the default configuration. Editing or deleting this file will change the typings link on the next install.

Features Overview

Because it is built with the correct level abstraction, using AxonCore feels natural and powerful. Everything is easily accessible, extendable and customisable. AxonCore takes full benefits of promises while having a strong and complete error management system. Events are emitted on command execution (on success / failure / error) with a full context information.
It also takes advantage of the lastest ECMAScript and Node features (Node12, ECMAScript 2019...). It also uses ESM to fully profit of ES6 modules (import / export syntax).

Guild configs are abstracted in a specific cache, which allows easy access and data management and switching to other types of caches later on (eg: LRUCache, redis...).

There's also a built-in help command that you can easily override if you want to.

Commands

You can create commands by extending Command, CommandPermissions and CommandOptions.

Listeners

You can also create listeners by extending Listener.
A Listener is a function that is run when a Discord-specific event occurs. Many listeners can be bound to one Discord event.
A Handler is an object responsible of running all listeners for a specific Discord event.

Databases support

All database interactions are done by AxonCore via an ADBProvider.
There are specific providers for each type of Database, such as:

The only thing you will handle is a GuildConfig and an AxonConfig object. Those are stored in the GuildConfigCache.

Translation support

TODO

Logging support

Client lifecycle

Schema TODO

Command lifecycle - Hooks

Schema TODO

Execution context, error management, usage tracking

A Command always should returns a Promise wrapping a CommandResponse. Either explicitely by creating a CommandResponse and wrapping it in a Promise (CommandResponse.resolve()), or implicitely via sendMessage, sendSuccess or sendError. CommandResponse in these last cases is filled with appropriate information regarding command execution.

The framework will then build a CommandContext object after each command execution.
Two types of events will then be emitted, depending on the scenario:

  • The command was executed entirely and successfully. A commandExecution event is emitted by AxonClient with status = true.
  • The command was called but something blocked the execution and it was not successfully executed. This can be due to a missing permission, inv

Related Skills

View on GitHub
GitHub Stars71
CategoryDevelopment
Updated7mo ago
Forks16

Languages

JavaScript

Security Score

92/100

Audited on Aug 21, 2025

No findings