mirror of
https://github.com/sern-handler/website
synced 2026-06-06 17:26:50 +00:00
Compare commits
14 Commits
error-hand
...
jacoobes-p
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b8191b7da | ||
|
|
cc7d02ff21 | ||
|
|
ac2561845f | ||
|
|
b793b8ca77 | ||
|
|
c1773b8b40 | ||
|
|
3e3cc36ec8 | ||
|
|
54d269375c | ||
|
|
663410eaed | ||
|
|
515d2ced78 | ||
|
|
8e9d895d1a | ||
|
|
5055daac9b | ||
|
|
1da3e57866 | ||
|
|
9d2c3f6582 | ||
|
|
d5cee30e4f |
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "./node_modules/@lunariajs/core/config.schema.json",
|
||||
"repository": {
|
||||
"name": "durocodes/sern-website"
|
||||
"name": "sern-handler/website"
|
||||
},
|
||||
"defaultLocale": {
|
||||
"label": "English",
|
||||
|
||||
@@ -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!
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -5,11 +5,17 @@ sidebar:
|
||||
order: 9
|
||||
---
|
||||
|
||||
:::tip
|
||||
If you want sern to just capture errors with nothing other than a simple log as to the error,
|
||||
set [handleModuleErrors](/v4/api/interfaces/wrapper/#handlemoduleerrors) to handle errors that occur within modules automatically
|
||||
:::
|
||||
|
||||
Error handling is important in any application, especially one which has a long lifetime of running.
|
||||
|
||||
|
||||
## Handling errors in command and event modules
|
||||
|
||||
To capture errors, enable the 'error' event in sern's global event manager.
|
||||
To capture errors, enable the `error` event in sern's global event manager.
|
||||
|
||||
import { FileTree } from '@astrojs/starlight/components';
|
||||
|
||||
@@ -50,6 +56,7 @@ If the error handler is not set, sern's behavior is to crash the application.
|
||||
This respects [node.js's default behavior](https://nodejs.org/api/events.html#error-events)
|
||||
|
||||
|
||||
|
||||
:::caution
|
||||
|
||||
Be careful about errors thrown IN the error handler.
|
||||
|
||||
27
src/content/docs/v4/reference/goal.mdx
Normal file
27
src/content/docs/v4/reference/goal.mdx
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
title: Goal
|
||||
description: sern's goal is to make bot development easier and more efficient
|
||||
sidebar:
|
||||
order: 10
|
||||
---
|
||||
|
||||
This reference will have JavaScript but many snippets are easily transferrable to Typescript.
|
||||
|
||||
# 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.
|
||||
- **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. 🤯
|
||||
|
||||
# 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!
|
||||
|
||||
|
||||
@@ -118,7 +118,8 @@ export const inGuild = (guildId: string) => {
|
||||
</Steps>
|
||||
|
||||
:::note
|
||||
Calling `controller.stop()` notifies sern that this command should not be run, and command is ignored.
|
||||
Calling `controller.stop()` notifies sern that this command should not be run, and command is ignored.
|
||||
In addition, this emits a `module.activate` event on the @sern/emitter with `PayloadType.Failure`
|
||||
:::
|
||||
|
||||
:::tip
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user