Sern can automate and streamline development of your discord bot with new version compatibility and full customization.
- A reincarnation of this old project
npm install sern-handler
yarn add sern-handler
pnpm add sern-handler
const { Client, Intents } = require('discord.js');
const { Sern } = require('sern-handler');
const { prefix, token } = require('./config.json');
const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MEMBERS
],
});
new Sern.Handler({
client,
prefix,
commands: 'src/commands',
privateServers: [
{
test: true,
id: 'server-id',
},
],
init: async (handler) => {
// Optional function to initialize anything else on bot startup
},
});
client.login(token);
const { Sern, Types } = require('sern-handler');
module.exports = {
alias: [],
desc: 'A ping pong command',
visibility: 'private',
test: false,
type: Sern.CommandType.SLASH | Sern.CommandType.TEXT,
execute: async ({ message, interaction }, args) => 'pong!',
};
See documentation for TypeScript examples and more
- Pull up on issues and tell us, if there are bugs
- All kinds of contributions are welcomed!
- Default commands
- Categories
- Ruling out all bugs in the command system
- Better support for slash commands
- More Build scripts
- Logger