feat: initial quickstart guide

This commit is contained in:
2025-01-26 18:37:48 +01:00
parent bfaf83d60c
commit 90cea45453
7 changed files with 44 additions and 23 deletions

View File

@@ -49,5 +49,6 @@
"prettier": "^3.2.5",
"prettier-plugin-astro": "^0.13.0",
"prettier-plugin-tailwindcss": "^0.5.14"
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}

View File

@@ -1,7 +1,7 @@
---
import { Tabs, TabItem, Code } from "@astrojs/starlight/components";
type Command = "add" | "update" | "remove" | "create";
type Command = "add" | "update" | "remove" | "create" | "dev";
type PackageManager = (typeof packageManagers)[number];
const packageManagers = ["NPM", "PNPM", "Yarn", "Bun"] as const;
@@ -41,6 +41,12 @@ const packageManagerCode = (
PNPM: `pnpm create ${text}`,
Bun: `bun create ${text}`,
},
dev: {
NPM: `npm run build && npm start`,
Yarn: `yarn build && yarn start`,
PNPM: `pnpm build && pnpm start`,
Bun: `bun build && bun start`,
}
};
return commands[command][manager];

View File

@@ -8,7 +8,7 @@ hero:
file: ~/assets/logo/sern-logo.svg
actions:
- text: <b>npm create @sern/bot</b>
link: /v4/reference/getting-started
link: /v4/reference/quickstart-guide
icon: right-arrow
variant: primary
---

View File

@@ -1,5 +1,5 @@
---
title: Error handling
title: Error Handling
description: Properly handle unexpected errors.
sidebar:
order: 9

View File

@@ -1,18 +0,0 @@
---
title: Getting Started
description: Get started with the sern framework
sidebar:
order: 1
---
import PackageManagers from '~/components/PackageManagers.astro';
<PackageManagers command="create" text="@sern/bot"/>
Once you've used this command, follow the interactive prompts to create your new project.
If you need help, feel free to ask on our [Discord](https://sern.dev/discord).
:::tip
This script will create a new folder for the project so you don't have to manually create it first.
:::

View File

@@ -0,0 +1,32 @@
---
title: Quickstart Guide
description: Get started with the sern framework
sidebar:
order: 1
---
import PackageManagers from '~/components/PackageManagers.astro';
### Step 1: Create a new project
<PackageManagers command="create" text="@sern/bot" />
sern has been created with the goal of making it easier to create Discord bots, so we've made it simple to get a boilerplate up and running with a single command.
### Step 2: Adding a token
Rename `.env.example` to `.env` and add your bot token to the `DISCORD_TOKEN` field.
If you're not familiar with how to get a bot token, you can follow the tutorial on [discordjs.guide](https://discordjs.guide/preparations/setting-up-a-bot-application.html#creating-your-bot).
:::caution
Make sure to enable the "Server Members" and "Message Content" intents!
![Intents](https://i.imgur.com/DgTOOgb.png)
:::
### Step 3: Invite the bot to your server
Again, we recommend using [discordjs.guide](https://discordjs.guide/preparations/adding-your-bot-to-servers.html#creating-and-using-your-invite-link) for this step.
### Step 4: Run the bot!
A development command inside the CLI is in the works. For now, you have to restart the bot manually for your changes to take effect.
<PackageManagers command="dev" text="" />
If you need help, feel free to ask on our [Discord](https://sern.dev/discord)!

View File

@@ -12,7 +12,7 @@ interface Link {
const links: Link[] = [
{
name: "Docs",
href: "/v4/reference/getting-started",
href: "/v4/reference/quickstart-guide",
},
{
name: "Plugins",