Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update goal.mdx #83

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/content/docs/v4/reference/conclusion.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Conclusion
description: Thank you for reading the sern guide
sidebar:
order: 10
order: 11
---

If you reached this far, thank you for reading!
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/v4/reference/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Config
description: Configure your bot
sidebar:
order: 2
order: 3
---
Your app needs a way to store constants and required variables for the framework to work.

Expand Down
63 changes: 16 additions & 47 deletions src/content/docs/v4/reference/goal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,26 @@
title: Goal
description: sern's goal is to make bot development easier and more efficient
sidebar:
order: 2
order: 10
---

This walkthrough will be written in [TypeScript](https://www.typescriptlang.org/) but will have JavaScript snippets throughout.
This reference will have JavaScript but many snippets are easily transferrable to Typescript.

## Make robust, modular, bots
# why?
Theres a lack of sane ways to build Discord bots.
Some advocate to *build your own abstractions*, use clunky archaic codebases that are rarely maintained, or install frameworks that don't satisfy your needs.

**Keep it simple!**


# sern is built for these things in mind

- **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!
- **Familiarity**: 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?

import { Tabs, TabItem } from '@astrojs/starlight/components';

<Tabs>
<TabItem value="sapphire" label="Using @sapphire/framework 🤢">
```ts title="commands/ping.ts"
import { Command } from "@sapphire/framework";
import type { CommandInteraction } from "discord.js";

export class PingCommand extends Command {
public constructor(context: Command.Context) {
super(context, {
description: "Pong!",
chatInputCommand: {
register: true,
},
});
}
public async chatInputRun(interaction: CommandInteraction) {
await interaction.reply("Pong!");
}
}
```
</TabItem>
<TabItem value="sern" label="Using @sern/handler 💪">
```ts title="commands/ping.ts"
import { commandModule, CommandType } from "@sern/handler";

export default commandModule({
type: CommandType.Both,
description: "Pong!",
execute: async (ctx, args) => {
await ctx.reply("Pong!");
},
});
```
</TabItem>
</Tabs>

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.
# Our community

As of 01/23/2025, our [discord](https://sern.dev/discord) is considered small, but it is no excuse for helping those who want to build bots with us. Feel free to join us!


2 changes: 1 addition & 1 deletion src/content/docs/v4/reference/tasks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Tasks
description: Schedule and execute functions at certain times
sidebar:
order: 2
order: 3
---

Your app may need to execute tasks in the future on intervals or over a long time.
Expand Down
Loading