Neo bfcc160a39 docs: change protectors WIP mark to its name (#214)
Idk I was bored and saw this was different to mine. Change mine instead or just close this pr, idm.
2023-02-07 20:16:23 -06:00
2022-08-29 07:12:33 +05:30
2023-01-30 12:35:37 -06:00
2022-12-28 14:40:19 -06:00
2022-01-24 20:48:18 -06:00
2022-09-28 11:52:25 -05:00
2022-08-29 07:12:33 +05:30
2023-01-30 12:30:28 -06:00
2022-05-30 20:54:23 +03:00
2023-02-03 23:04:13 -06:00
2022-08-29 07:12:33 +05:30
2022-08-29 07:12:33 +05:30
2022-08-29 07:12:33 +05:30
2022-12-28 14:40:19 -06:00

Handlers. Redefined.

A customizable, batteries-included, powerful discord.js framework to streamline bot development.

NPM version NPM downloads License MIT docs.rs Lines of code

📜 Installation

npm install @sern/handler
yarn add @sern/handler
pnpm add @sern/handler

Why?

  • Most handlers don't support discord.js 14.7+
  • Customizable commands
  • Plug and play or customize to your liking
  • Embraces reactive programming for consistent and reliable backend
  • Customizable logger, error handling, and more
  • Active development and growing community

👀 Quick Look

  • Support for discord.js v14 and all interactions
  • Hybrid commands
  • Lightweight and customizable
  • ESM, CommonJS and TypeScript support
  • A powerful CLI and awesome community-made plugins

👶 Basic Usage

index.js (CommonJS)

// Import the discord.js Client and GatewayIntentBits
const { Client, GatewayIntentBits } = require('discord.js');

// Import Sern namespace
const { Sern } = require('@sern/handler');

const client = new Client({
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMembers,
    GatewayIntentBits.GuildMessages
  ]
});
export const useContainer = Sern.makeDependencies({
    build: root => root
        .add({ '@sern/client': single(client)  })
        .upsert({ '@sern/logger': single(new DefaultLogging()) })
});

//View docs for all options
Sern.init({
	defaultPrefix: '!', // removing defaultPrefix will shut down text commands
	commands: 'src/commands',
	// events: 'src/events' (optional),
	containerConfig : {
		get: useContainer
	}
});

client.login("YOUR_BOT_TOKEN_HERE");

ping.js (CommonJS)

const { CommandType, commandModule } = require('@sern/handler');

exports.default = commandModule({
  name: 'ping',
  description: 'A ping pong command',
  type: CommandType.Slash,
  execute(ctx) {
    ctx.reply('pong!');
  }
});

🤖 Bots Using sern

💻 CLI

It is highly encouraged to use the command line interface for your project. Don't forget to view it.

👋 Contribute

  • Read our contribution guidelines carefully
  • Pull up on issues and report bugs
  • All kinds of contributions are welcomed.
Description
No description provided
Readme MIT 8.4 MiB
Languages
TypeScript 100%