mirror of
https://github.com/SrIzan10/handler.git
synced 2026-05-01 10:45:17 +00:00
e71b63d261d86b17ddc05fbee999f63623d8c6d1
* feat: remove unit testing * feat: make command modules return Awaitable void | unknown * feat: more clear error for access message or interaction * feat: make TextCommand and SlashCommand return more specific arg type * feat: make TextCommand and SlashCommand return more specific arg type * fix: Remove type reduction to never in onReady.ts * feat: narrow typings for args Text and SlashCommand x3 * feat: make description optional, default is '...' * feat: add sern events natively register in sern.init * feat: remove jest.config.ts * fix: forget to add SernEvent to Wrapper declaration * feat: Make name and description defined when making plugins! * Update README.md * docs: Highly encourage to use cli * chore: Improved package.json * feat: Add .edit method and let .reply accept string * fix: intellij warnings * build: update discord.js to latest * chore(deps): Removed typedoc Removed typedoc dependency due we won't use it anymore * fix: Fixed typo at SECURITY.md file * feat: remove edit context method for future * feat: remove docs folder * feat: loading strategy slightly changed, does not throw error on finding no module in file * feat: change typings of sern emitter * feat: add generic to readFile.ts buildData, adding different event loading strategies * feat: add events.ts for more customizable event handling * refactor: type changes to adjust to event commands * feat: revamp module types to support event plugins * feat: rolling out more event loading support * style: Improved plugin.ts comments * style: Improved plugin.ts comments * style: Improved readyEvent.ts comments * feat: more support for event loading!! * fix: re add import after rebase * feat: more event handling progress * feat: Cleaning up types * refactor: Cleaning up and adding docs * feat: Changing types of wrapper for external and sern emitter * refactor: Adding some type aliases * feat: switch to match expression, add docs * feat: more progress on event handling * fix: complying to djs v14 build * feat: Add basic event handling, no plugins checked yet! * fix: Crash on interactionCreate event * build(package.json): bump version * build: bump to 1.0.4-beta * feat: move new things to top level import * feat: Separating events from command modules, leads separation of responsibility * feat: add enum for event modules * feat: Add more typings for event modules * feat: Add more plugin definitions * refactor: add asyncResolveArray.ts to resolve Awaitables easier * feat: throw error on plugin usage for event listeners * feat: throw error on plugin usage for event listeners * feat: change from client -> wrapper * style: eslint * style: add comment * feat: add absPath into commandPlugins! * build: remove 'tests' exclude * build: delete test.yml, change .prettierignore * build: bump version to 1.1.0-beta * docs(sern.ts): add comments for addExternal * fix: forgot to add required type property in comment * fix: load external event emitters correctly * chore: rebased api update branch (#65) Co-authored-by: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com> Co-authored-by: xxDeveloper <77380166+Murtatrxx@users.noreply.github.com> Co-authored-by: xxDeveloper <77380166+Murtatrxx@users.noreply.github.com> Co-authored-by: Evo <85353424+EvolutionX-10@users.noreply.github.com>
SernHandler
A customizable, batteries-included, powerful discord.js framework to automate and streamline your bot development.
Installation
npm install @sern/handler
yarn add @sern/handler
pnpm add @sern/handler
Basic Usage
index.js (CommonJS)
const { Client, GatewayIntentBits } = require('discord.js');
const { Sern } = require('sern-handler');
const { defaultPrefix, token } = require('./config.json');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages
]
});
Sern.init({
client,
defaultPrefix,
commands : 'src/commands',
});
client.login(token);
ping.js (CommonJS)
const { Sern, CommandType } = require('@sern/handler');
exports.default = {
description: 'A ping pong command',
type: CommandType.Slash,
execute(ctx) {
ctx.reply('pong!');
}
};
See our templates for TypeScript examples and more
CLI
It is highly encouraged to use the command line interface for your project. Don't forget to view it.
Links
Contribute
- Read our contribution guidelines carefully
- Pull up on issues and report bugs
- All kinds of contributions are welcomed.
Roadmap
You can check our roadmap to see what's going to be added or patched in the future.
Description
A customizable, batteries-included, powerful discord.js framework to streamline bot development.
⚠️ ARCHIVED: Original GitHub repository no longer exists. Preserved as backup on 2026-05-01T16:06:47.653Z
Languages
TypeScript
97.9%
JavaScript
2.1%