Options
All
  • Public
  • Public/Protected
  • All
Menu

sern-handler

Sern Handler

NPM version NPM downloads Builds Passing

Sern can automate and streamline development of your discord bot with new version compatibility and full customization.

Installation

npm install sern-handler
yarn add sern-handler
pnpm add sern-handler

Basic Usage

index.js

import { Client, Intents } from 'discord.js';
import { Sern } from 'sern-handler';
import { prefix, token } from '../src/secrets.json';

const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MEMBERS
]
});

new Sern.Handler({
client,
prefix,
commands : 'dist/commands',
privateServers : [
{
test : true,
id: 'server-id'
}
],
init: async (handler) => {
// Optional function to initialize anything else on bot startup
},
});


client.login(token);

ping.js

import { Sern, Types } from 'sern-handler';
import { Ok } from 'ts-results';

export default {
alias: [],
desc : 'A ping pong command',
visibility : 'private',
test : false,
type: Sern.CommandType.SLASH | Sern.CommandType.TEXT,
execute : async ({ message, interaction }, args) => {
interaction.reply({ content: 'Pong! });
}
};

See documentation for TypeScript examples and more

Links link

Contribute

  • Pull up on issues and tell me if there are bugs
  • All kinds of contributions are welcomed!

Generated using TypeDoc