Saltearse al contenido
sern

Goal

Esta página aún no está disponible en tu idioma.

This walkthrough will be written in TypeScript but will have JavaScript snippets throughout.

Make robust, modular, bots

  • Modularity: sern is built with modularity in mind. You can swap pieces and parts easily.
  • Familiar: Commands and structures are similar to classic v12 handlers and the official Discord.js command handler guide, while packing many features!
  • Concise: Too much code is a liability. With sern, write less for more. 🤯

Why sern?

commands/ping.ts
1
import { Command } from "@sapphire/framework";
2
import type { CommandInteraction } from "discord.js";
3
4
export class PingCommand extends Command {
5
public constructor(context: Command.Context) {
6
super(context, {
7
description: "Pong!",
8
chatInputCommand: {
9
register: true,
10
},
11
});
12
}
13
public async chatInputRun(interaction: CommandInteraction) {
14
await interaction.reply("Pong!");
15
}
16
}

Keep in mind the sern example acts as both a slash command AND a text command. The Sapphire example is only a slash command, and it’s more code than sern.

Be smart. Choose sern.