nyx
is an OOP framework for building feature-complete Discord bots.
The core idea of nyx is to be easy to modify and extend, with no hardcoded implementations, meaning that all the default objects can be completely replaced by your own if desired.
The original template that nyx is based on was greatly inspired by Modbot.
nyx has two documentation sources:
All of these features are built upon interfaces (@nyx-discord/core
), and nyx only includes default, recommended
implementations @nyx-discord/framework
.
This means that you can build from scratch or extend each object and plug it into nyx with no problems, as long as they satisfy the respective interface.
CommandMiddlewares
(for general filtering) or CommandFilters
(for command-specific filtering).CommandExecutionMeta
to provide metadata to your commands from your filter, middleware or subscriber.CommandEventBus
like command runs.ErrorHandler
.EventBus
and EventSubscriber
based event handling.EventBuses
.EventDispatcher
to change the way subscribers are called. By default, either:AsyncEventDispatcher
which allows a concurrency limit.SyncEventDispatcher
which allows a sync timeout limit before calling the next subscriber.EventMiddlewares
(for general filtering) or SubscriberFilters
(for subscriber-specific filtering).ErrorHandler
.Schedules
as needed.@nyx-discord/core
package.Middlewares
, which are checked for every feature executed, for example, the CommandManager
's CommandMiddleware
is called on every command called. Allows appending your custom ones.Filter
, which is provided and checked once a specific object is called, for example, when your UserInfoCommand
is called.nyx is licensed under the MIT License.
If you don't understand it or don't want to bother reading it all, here's what you need to know:
✅ You can: Modify the software for your personal or public usage, distribute it freely or commercially.
❌ You can't: Change the license, though you can include it inside a proyect with a more restrictive license, but the original code stays licensed under MIT.
📝 You need: To include the copyright (LICENSE
file) inside the modified code.
You don't need to explicitly give credit to this repository (all the credit is inside LICENSE
already), but I'll be
grateful if you do so 💙.
Built-in DB related objects are not included. This is mostly due to compatibility reasons, since there's no easy way to make a structure for handling databases that fits every developers and databases' needs, allowing the flexibility that nyx aims for.
You're welcome to open an issue or a PR if you have an idea on how to tackle this issue, but for now, making an external object, using declaration merging, or making a plugin for it is advised.
There are no plans for built-in message command support. There are many reasons including the reasonable lack of
support from Discord, difficult way to parse them into convenient objects like the CommandInteractionOptionResolver
,
among others.
If you need it, you're welcome to add it by making an external object, using declaration merging, or making a plugin for it.