Revert "starlight rewrite" (#65)

This reverts commit f6f60dee0d.
This commit is contained in:
2024-05-07 16:25:00 +02:00
committed by GitHub
parent f6f60dee0d
commit 3955337bee
232 changed files with 33078 additions and 4148 deletions

39
.github/workflows/docusaurus.yml vendored Normal file
View File

@@ -0,0 +1,39 @@
name: Deploy to GitHub Pages
on:
push:
branches: [ main ]
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- name: Install dependencies
run: yarn install --immutable
- name: Build website
run: yarn build
# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./build
# The following lines assign commit authorship to the official
# GH-Actions bot for deploys to `gh-pages` branch:
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
# The GH actions bot is used by default if you didn't specify the two fields.
# You can swap them out with your own user credentials.
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com

View File

@@ -1,30 +0,0 @@
name: Deploy to GitHub Pages
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install Dependencies
run: bun install
- name: Build
run: rm -rf sern-handler && git clone https://github.com/sern-handler/handler sern-handler && cd sern-handler && bun install && cd .. && bun run build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.AUTOMATA_TOKEN }}
publish_dir: ./dist
user_name: sernbot
user_email: ${{ secrets.AUTOMATA_EMAIL }}

34
.gitignore vendored
View File

@@ -1,24 +1,20 @@
# build output
dist/
# generated types
.astro/
# Dependencies
/node_modules
# dependencies
node_modules/
sern-handler
# Production
/build
# logs
# Generated files
.docusaurus
.cache-loader
# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
.yarn/install-state.gz
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# environment variables
.env
.env.production
# macOS-specific files
.DS_Store
sern-handler

2
.nvmrc
View File

@@ -1 +1 @@
lts/*
lts/*

1
.yarnrc.yml Normal file
View File

@@ -0,0 +1 @@
nodeLinker: node-modules

30
404.html Normal file
View File

@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html style="height:100%">
<head>
<meta name="viewport" charset="utf-8" content="width=device-width, initial-scale=1, shrink-to-fit=no" >
<link rel="icon" href="./assets/images/favicon.ico">
<meta name="theme-color" content="#fff">
<meta name="twitter:card" content="summary">
<meta property="og:title" content="sern">
<meta property="og:description" content="serns clean, modern and web interface.">
<meta property="og:type" content="website">
<meta property="og:url" content="https://sern-handler.js.org/">
<meta property="og:locale" content="en_US">
<meta name="description" content="serns clean, modern and user-friendly web interface.">
<title>sern - Page Not Found</title>
</head>
<body style="color: #444; margin:0;font: normal 14px/20px Arial, Helvetica, sans-serif; height:100%; background-color: #fff;">
<div style="height:auto; min-height:100%; "> <div style="text-align: center; width:800px; margin-left: -400px; position:absolute; top: 30%; left:50%;">
<h1 style="margin:0; font-size:150px; line-height:150px; font-weight:bold;">404</h1>
<h2 style="margin-top:20px;font-size: 30px;">Not Found
</h2>
<p>The link you visited may be broken or invalid.</p>
<div class="button">
<h2>
<a href="http://sern-handler.js.org" title="Back to home" style="color: #444;">Back to homepage</a>
</h2>
</div>
</div></div></body></html>

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 Sern
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,3 +1,3 @@
# Website (v2)
# Website
sern's clean, modern, and user-friendly web interface. (now built with [Starlight](https://starlight.astro.build/))
sern's clean, modern and user-friendly web interface.

View File

@@ -1,95 +0,0 @@
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import starlightBlog from 'starlight-blog';
import tailwind from "@astrojs/tailwind";
import starlightDocSearch from '@astrojs/starlight-docsearch';
import starlightTypeDoc, { typeDocSidebarGroup } from 'starlight-typedoc';
export default defineConfig({
integrations: [starlight({
title: 'sern',
social: {
github: 'https://github.com/sern-handler',
discord: 'https://discord.gg/DwbF5H5JgQ',
},
components: {
ThemeSelect: './src/components/ThemeSelect.astro',
Head: './src/components/Head.astro',
},
logo: {
src: './src/assets/logo/navbar-icon.png',
replacesTitle: true,
},
customCss: [
'./src/styles/global.css',
],
sidebar: [
typeDocSidebarGroup,
{
label: 'CLI',
autogenerate: { directory: 'cli' },
},
{
label: 'Guide',
items: [
{
label: 'Getting Started',
autogenerate: { directory: 'guide/getting-started' },
},
{
label: 'Walkthrough',
autogenerate: { directory: 'guide/walkthrough' },
},
],
},
],
plugins: [
starlightDocSearch({
appId: 'AA9S5J9NYT',
apiKey: 'ccfe6abc4d12ac6f882565a9d0caafb1',
indexName: 'sern',
}),
starlightBlog({
authors: {
jacoobes: {
name: 'jacoobes',
title: 'Head Dev',
url: 'https://github.com/jacoobes',
picture: 'https://github.com/jacoobes.png',
},
ethan: {
name: 'Sr Izan',
title: 'Head Dev',
url: 'https://github.com/SrIzan10',
picture: 'https://github.com/SrIzan10.png',
},
sern: {
name: 'sern Team',
url: 'https://github.com/sern-handler',
picture: 'https://github.com/sernbot.png',
},
murtatrxx: {
name: 'Murtatrxx',
title: 'Head Dev',
url: 'https://github.com/Murtatrxx',
picture: 'https://github.com/Murtatrxx.png',
},
duro: {
name: 'Duro',
title: 'Developer',
url: 'https://github.com/DuroCodes',
picture: 'https://github.com/DuroCodes.png',
},
}
}),
starlightTypeDoc({
tsconfig: './sern-handler/tsconfig.json',
entryPoints: ['./sern-handler/src/index.ts'],
autogenerate: {
directory: 'api',
},
sidebar: { collapsed: true },
}),
],
}), tailwind()]
});

3
babel.config.js Normal file
View File

@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};

View File

@@ -1,77 +1,71 @@
---
slug: blog/1.2.0
slug: 1.2.0
title: Release 1.2.0
authors: [jacoobes]
tags: [release]
date: 2022-09-28
---
## Class-based modules
Today we're announcing the ability to create class based modules!
To get started, install
```
npm install @sern/handler@latest
```
Quick List of changes!
- [Class based modules](#class-based-modules)
- [Deprecation Warnings](#deprecation-warnings)
- [Dependencies update](#dependencies-update)
- [Class-based modules](#class-based-modules-1)
- [Deprecation Warnings](#deprecation-warnings)
- [Dependencies Update](#dependencies-update)
### Class based modules
Incorporate class based modules into your project instead of the traditional `commandModule` or `eventModule`
Extend the new [CommandExecutable](docs/api/classes/CommandExecutable) or [EventExecutable](docs/api/classes/EventExecutable)
```ts title="commands/meaning-of-life.ts" {15}
import {
CommandType,
CommandExecutable,
type Args,
type Context,
} from "@sern/handler";
import { publish } from "../plugins/publish.js";
import { serendipityOnly } from "../plugins/serendipityOnly.js";
```ts title="commands/meaning-of-life.ts"
import { CommandType, CommandExecutable, type Args, type Context } from '@sern/handler';
import { publish } from '../plugins/publish.js';
import { serendipityOnly } from '../plugins/serendipityOnly.js';
export default class extends CommandExecutable<CommandType.Both> {
type = CommandType.Both as const;
description = "What is the meaning of life?";
override onEvent = [serendipityOnly()];
override plugins = [publish()];
execute = async (ctx: Context, args: Args) => {
await ctx.reply("42");
};
type = CommandType.Both as const;
description = 'What is the meaning of life?'
override onEvent = [
serendipityOnly()
];
override plugins = [
publish(),
];
// highlight-next-line
execute = async (ctx: Context, args: Args) => {
await ctx.reply('42')
};
}
```
:::caution
execute must not be a method of the class. It should be as above, a property on the class!
:::
```ts title="events/guildMemberAdd.ts" {6}
import { CommandType, EventExecutable, type EventType } from "@sern/handler";
import type { GuildMember } from "discord.js";
```ts title="events/guildMemberAdd.ts"
import { CommandType, EventExecutable, type EventType } from '@sern/handler';
import type { GuildMember } from 'discord.js'
export default class extends EventExecutable<EventType.Discord> {
type = EventType.Discord as const;
execute = (member: GuildMember) => {
console.log(member);
};
type = EventType.Discord as const;
// highlight-next-line
execute = (member: GuildMember) => {
console.log(member)
};
}
```
Now, you might ask **why** this feature was added. <br /> Simply put, to give flexibility to the developers.
I believe that you should build your own structures however you might like and customize to your liking.
In addition, **decorators now unofficially work with modules!**
Feel free to use TypeScript experimental decorators to augment and customize your classes.
Feel free to use TypeScript experimental decorators to augment and customize your classes.
### Deprecation Warnings
The next update will bring sern v2 with some important features. Here are some things to watch out for.
- [Wrapper#client](docs/api/interfaces/Wrapper) will be deprecated
@@ -81,6 +75,5 @@ The next update will bring sern v2 with some important features. Here are some t
- [Sern#addExternal](docs/api/classes/SernEmitter) will be deprecated in favor of a better way.
### Dependencies Update
- TypeScript has been updated to 4.8.3
- Discord.js has been upgraded to 14.5

View File

@@ -1,9 +1,8 @@
---
slug: blog/getting-started
slug: getting-started
title: How to get started with sern!
authors: [ethan]
authors: [Sr Izan]
tags: [guides]
date: 2022-09-30
---
## Hello everyone!
@@ -15,17 +14,13 @@ Today I'm going to show you how to get started with sern and all its cool featur
### Step 1: Install the CLI.
Install the CLI:
```
npm i -g @sern/cli
```
and then run
```
sern init
```
:::tip
You can also run `sern init -y` if you want to use the default options.
:::
@@ -55,14 +50,13 @@ Yes, that's it. Here's a little FAQ to get you started. You can also join the [D
## FAQ
**Q**: How do I publish a slash command?
**A**: Install the publish extension. Little video:
**A**: Install the publish extension. Little video:
<video width="400" controls>
<source src="https://srizan.s-ul.eu/uHzPhfcS" type="video/mp4" />
</video>
**Q**: Any snippet VSCode extension?
**A**: Yeah, just search `sern Snippets` made by a verified publisher called Sr Izan (haha yeah me funny!)
**A**: Yeah, just search `sern Snippets` made by a verified publisher called Sr Izan (haha yeah me funny!)
**Q**: HEEEELLLPPPP!!!!
**A**: Hey, don't panic! We're here to help so, join the [Discord](https://sern.dev/discord). We're trying to get to 100 members!

View File

@@ -1,51 +1,45 @@
---
slug: blog/2.0.0
slug: 2.0.0
title: Release 2.0.0
authors: [jacoobes]
tags: [release]
date: 2022-12-13
---
## 2.0 Release
Join our [discord](https://sern.dev/discord)! <br />
Wow! We're finally increasing our semantic versioning by +`1.7.9.` <br />
What does this mean?
### Plugin Support for Event Modules
You can now use plugins for event modules. Previous version would throw an error if the
You can now use plugins for event modules. Previous version would throw an error if the
`plugins` field was populated.
```typescript
export function commandPlTest(): SernEmitterPlugin {
return {
type: PluginType.Command,
execute: ({ mod }, controller) => {
if (mod.name === "module.register") {
console.log("Event Module created correctly");
return controller.next();
}
console.log("event name is wrong");
return controller.stop();
},
};
```typescript
export function commandPlTest() : SernEmitterPlugin {
return {
type: PluginType.Command,
execute: ({ mod}, controller) => {
if(mod.name === 'module.register') {
console.log('Event Module created correctly')
return controller.next()
}
console.log('event name is wrong')
return controller.stop()
}
}
}
```
Applying this plugin to some `eventModule`:
Applying this plugin to some `eventModule`:
```typescript
export default eventModule({
name: "error",
type: EventType.Sern,
plugins: [commandPlTest()],
execute(m) {
console.log(m);
},
});
name: 'error',
type: EventType.Sern,
plugins: [commandPlTest()],
execute(m) {
console.log(m)
},
})
```
## Dependency Injection and Decoupling
The powerful npm package `iti` decouples sern even more.
@@ -53,63 +47,57 @@ Decoupling data structures with the Inversion of Control pattern separates data
and make sern even more customizable than before.
### How do I start?
```typescript title="src/index.ts"
//With typescript, you can customize / augment your typings.
interface MyDependencies extends Dependencies {
"@sern/client": Singleton<Client>;
"@sern/logger": Singleton<DefaultLogging>;
'@sern/client' : Singleton<Client>;
'@sern/logger' : Singleton<DefaultLogging>
}
export const useContainer = Sern.makeDependencies<MyDependencies>({
// exclude: new Set(['@sern/logger']), don't autofill optional dependencies
build: (root) =>
root
.add({ "@sern/client": single(client) })
.add({ "@sern/logger": single(new DefaultLogging()) }),
// exclude: new Set(['@sern/logger']), don't autofill optional dependencies
build: root => root
.add({ '@sern/client': single(client) })
.add({ '@sern/logger': single(new DefaultLogging()) })
});
Sern.init({
defaultPrefix: "!", // removing defaultPrefix will shut down text commands
commands: "src/commands",
// events: 'src/events' (optional),
containerConfig: {
get: useContainer, //pass in your dependency getter here
},
defaultPrefix: '!', // removing defaultPrefix will shut down text commands
commands: 'src/commands',
// events: 'src/events' (optional),
containerConfig : {
get: useContainer //pass in your dependency getter here
}
});
```
Using the `Sern#makeDependencies` function, inject your dependencies.
```
Using the `Sern#makeDependencies` function, inject your dependencies.
We'll use specific dependencies that are created with the `@sern/keyword`
key.
Using typescript to display all `keywords` and what they represent:
```typescript
export interface Dependencies {
"@sern/client": Singleton<EventEmitter>; //Discord Client
"@sern/logger"?: Singleton<Logging>; //Logger
"@sern/emitter": Singleton<SernEmitter>; //SernEmitter
"@sern/store": Singleton<ModuleStore>; //Stores all Command Modules
"@sern/modules": Singleton<ModuleManager>; //Manages Modules
"@sern/errors": Singleton<ErrorHandling>; //A Lifetime / Crash Handler
'@sern/client': Singleton<EventEmitter>; //Discord Client
'@sern/logger'?: Singleton<Logging>; //Logger
'@sern/emitter': Singleton<SernEmitter>; //SernEmitter
'@sern/store' : Singleton<ModuleStore>; //Stores all Command Modules
'@sern/modules' : Singleton<ModuleManager>; //Manages Modules
'@sern/errors': Singleton<ErrorHandling>; //A Lifetime / Crash Handler
}
```
:::danger
Sern#addExternal has been deprecated and removed in favor of Sern#makeDependencies
:::
At the moment, one optional dependency, `@sern/logger`, exists. If not added explicitly,
At the moment, one optional dependency, `@sern/logger`, exists. If not added explicitly,
we'll **autofill** with a [DefaultLogger](https://sern.dev/docs/api/classes/defaultlogging).
:::tip
If you don't want a logger, add it to the
If you don't want a logger, add it to the
`exclude` field while composing dependencies.
:::
Use your generated dependency getter `useContainer` (use whatever name you want), access them
from anywhere.
:::note
the function [useContainerRaw](https://sern.dev/docs/api/modules#usecontainerraw) is provided for direct access to dependencies and the internal
data structure. Use this wisely as no guarantees are made and crashes can happen.
@@ -118,30 +106,24 @@ data structure. Use this wisely as no guarantees are made and crashes can happen
The `build` field follows [createContainer](https://itijs.org/docs/quick-start#usage) function call.
## New CommandTypes
2.0 includes all the new role select menus. `CommandType.MenuSelect` has been renamed into
`CommandType.StringSelect`. The remaining SelectMenus are
`CommandType.RoleSelect`, `CommandType.ChannelSelect`, `CommandType.UserSelect`, `CommandType.MentionableSelect`
```typescript title="commands/roleselect.ts"
export default commandModule({
type: CommandType.RoleSelect,
execute(ctx) {
ctx.reply("role select");
},
});
type: CommandType.RoleSelect,
execute(ctx) {
ctx.reply('role select')
},
})
```
In addition, commandModules with ContextMenus have been renamed.
```diff
- CommandType.MenuUser, CommandType.MenuMsg
- CommandType.MenuUser, CommandType.MenuMsg
+ CommandType.CtxUser, CommandType.CtxMsg
```
## Typings Simplification
Pre 2.0:
Pre 2.0:
<img src="https://cdn.discordapp.com/attachments/820348341358952550/1038577974829666386/image.png" />
<br/> <br/> <br/>
Post 2.0:
@@ -149,14 +131,12 @@ Post 2.0:
<img src="https://cdn.discordapp.com/attachments/820348341358952550/1052623728489550015/image.png" />
CommandPlugin<T\> and EventPlugin<T\> typings have also been static'ified, transformed from types to interfaces
## Breaking Changes
<img src="https://img.srizan.dev/Discord_z8Sn1UBfEe.png" />
<br />
All deprecation warnings from previous versions have taken effect, and are removed in 2.0.
```diff lang="ts" showLineNumbers=false
```diff
- type Module = EventModule | CommandModule
+ type AnyModule = EventModule | CommandModule
@@ -164,9 +144,7 @@ All deprecation warnings from previous versions have taken effect, and are remov
- args: Parameters<T>[number],
- ) => unknown;
```
Override type has been removed due to redundancy
```diff
- discord.js : 14.5
+ discord.js : 14.7
@@ -174,8 +152,7 @@ Override type has been removed due to redundancy
-typescript: 4.7
+ typescript: 4.9
```
```diff lang="ts" showLineNumbers=false
```diff
+ interface Wrapper {
+ readonly defaultPrefix?: string;
+ readonly commands: string;
@@ -196,22 +173,19 @@ Override type has been removed due to redundancy
- | (() => { mod: EventModule; absPath: string }[]);
-}
```
```diff lang="ts" showLineNumbers=false
```diff
+ DefaultLogger
+ DefaultModuleManager
+ SernEmitter
+ DefaultErrorHandling
+ type Singleton<T> = () => T
+ type Transient<T> = () => () => T;
+ type Transient<T> = () => () => T;
+ type LogPayload<T = unknown> = { message: T }
+ export const single = <T>() => T
+ export const many = <T>() => () => T
```
Including the previous section, some names to symbols and data structures were altered to
be better represented. view [changelog](/404.html)
## Context refactoring
The context data structure has been internally altered to represent its dynamics better.
The context data structure has been internally altered to represent its dynamics better.

View File

@@ -1,32 +1,25 @@
---
slug: blog/2.5.0
slug: 2.5.0
title: Release 2.5.0
authors: [jacoobes]
tags: [release]
date: 2023-01-12
---
## 2.5 Release
### Join our [discord](https://sern.dev/discord) <br />
- Thank you for using sern in your projects. It's only going to get better!
- I apologize for the sudden small breaking change. After this update, there won't be any for a while.
Wow! We're increasing our semantic versioning by `+0.3.9` <br />
What does this mean?
Wow! We're increasing our semantic versioning by `+0.3.9` <br />
What does this mean?
### Breaking changes
- [controller](../docs/api/modules#controller) parameter for plugins has been removed
- You'll need to import it instead
- This **breaks** old [CommandPlugin](../docs/api/interfaces/CommandPlugin), but **not** old [EventPlugin](../docs/api/interfaces/EventPlugin)
- You'll need to import it instead
- This **breaks** old [CommandPlugin](../docs/api/interfaces/CommandPlugin), but **not** old [EventPlugin](../docs/api/interfaces/EventPlugin)
### Deprecations
- [CommandPlugin](../docs/api/interfaces/CommandPlugin) and [EventPlugin](../docs/api/interfaces/EventPlugin) have been renamed [InitPlugin](../docs/api/interfaces/InitPlugin) and [ControlPlugin](../docs/api/interfaces/ControlPlugin)
### Reason
- The naming of plugins was getting too complex. For example, plugin naming evolved into CommandModuleCommandPlugin, CommandModuleEventPlugin and more.
- I realize that this affects all plugins. I have updated all [plugins](https://github.com/sern-handler/awesome-plugins/pull/68) to match these changes
- The old way of declaring plugins has been deprecated in favor of newer functions that facilitate and ease typings
@@ -35,4 +28,4 @@ date: 2023-01-12
- [EventControlPlugin](../docs/api/modules#eventcontrolplugin)
- [EventInitPlugin](../docs/api/modules#eventinitplugin)
- [DiscordEventControlPlugin](../docs/api/modules#discordeventcontrolplugin)
This will probably be the last breaking change in a while. Thanks for using sern!
This will probably be the last breaking change in a while. Thanks for using sern!

View File

@@ -1,9 +1,8 @@
---
slug: blog/3.0.0
slug: 3.0.0
title: Release 3.0.0
authors: [jacoobes]
tags: [release]
date: 2023-06-18
---
## 3.0 Release
@@ -13,22 +12,20 @@ date: 2023-06-18
### Features
#### Dependency Management
- `Service` API (recommended to use this over useContainer hooks)
- Dependencies type must be globally augmented in order for Services api to function properly
- Dependencies type must be globally augmented in order for Services api to function properly
- new methods on ModuleManager
- getPublishableCommands()
- Init Hooks
- implement starting behavior for dependencies
- To enforce and type check this, use the `Initializable` type when making your Dependencies type!
- getPublishableCommands()
- Init Hooks
- implement starting behavior for dependencies
- To enforce and type check this, use the `Initializable` type when making your Dependencies type!
- Emitter interface
- More generic interface to define any event emitter
- You can now swap out the SernEmitter with whatever emitter now.
```ts
- More generic interface to define any event emitter
- You can now swap out the SernEmitter with whatever emitter now.
```ts
class DatabaseService implements Init {
//some hypothetical database
_pgsql : database()
_pgsql : database()
async init() {
await _pgsql.load()
@@ -36,74 +33,70 @@ class DatabaseService implements Init {
}
await makeDependencies({
await makeDependencies({
build: root => root.add({
db: new DatabaseService() //will be init'ed automatically
})
})
```
- new SernEmitter event `modulesLoaded` , which allows users to customize behavior after all modules are loaded!
```ts
export default eventModule({
name: "modulesLoaded",
type: EventType.Sern,
execute: () => {
console.log("All modules loaded");
},
});
name: 'modulesLoaded',
type: EventType.Sern,
execute: () => {
console.log('All modules loaded')
}
})
```
#### Quality of Life
- faster module loading
- I utilize async generators for reading files now. A lot faster than the first iteration.
- I utilize async generators for reading files now. A lot faster than the first iteration.
- better error handling
- Less boilerplate
- Services api cleans up v2 boilerplate
- Services api cleans up v2 boilerplate
- class modules devex got upgraded and work better than before
- automatically ignore any files not ending in (mts, cts, mjs, cjs, ts, js)
- ignore commands and events with `!` prefix on filename or directory (ie: `!filename.ts` or `!directory` will be ignored by sern)
- ignore commands and events with `!` prefix on filename or directory (ie: `!filename.ts` or `!directory` will be ignored by sern)
- `Service` API (recommended to use this over useContainer hooks)
- Dependencies type must be globally augmented in order for Services api to function properly
- Dependencies type must be globally augmented in order for Services api to function properly
- Less boilerplate
- new methods on ModuleManager
- automatically ignore any files not ending in (mts, cts, mjs, cjs, ts, js)
- ignore commands / events with `!` prefix on filename or directory (ie: `!filename.ts` or `!directory`)
- ignore commands / events with `!` prefix on filename or directory (ie: `!filename.ts` or `!directory`)
- new SernEmitter event `modulesLoaded` , which allows users to customize behavior after all modules are loaded!
- Init Hooks
- implement starting behavior for dependencies
- Init Hooks
- implement starting behavior for dependencies
### Experimental
- Experimental things may be subject to removal, need feedback and are not guaranteed stable
- dev / prod mode
- sern will behave differently depending on mode set
- dev / prod mode
- sern will behave differently depending on mode set
- init sern from `file` option
- reads from local sern.config.json
- reads from local sern.config.json
```js
Sern.init("file");
```js
Sern.init('file');
```
### Breaking changes
- Sern.makeDependencies -> makeDependencies
- it is asynchronous and top level function now. Make sure to await it before initing for proper synchronization.
- module store and manager internally changed, so those using them may recieve breaking changes
- it is asynchronous and top level function now. Make sure to await it before initing for proper synchronization.
- module store and manager internally changed, so those using them may recieve breaking changes
- BaseOptions type removed
```diff lang="ts" showLineNumbers=false
```diff
- Sern.makeDependencies({ build: () => {} })
+ await makeDependencies({ build: () => {} })
```
### Deprecations
- Removed all previous marked deprecations in v3
- ModuleStore will be removed as a dependency in v4. The only way to access modules should be through ModuleManager
- Default Dependencies will be made internal in the v4. Users should only have access to its interface / contract

View File

@@ -1,9 +1,8 @@
---
slug: blog/new-logo
slug: newlogo
title: New logo!
authors: [sern]
tags: [branding]
date: 2023-07-04
---
Hey everyone! Today we have very special news for you all: We're changing our logo!
@@ -18,11 +17,11 @@ And here we are!
[Ropox](https://github.com/Murtatrxx)!
Bro's the GOAT. This website is maintained by him, the domain costs are funded by him and also he started brainstorming how the logo would be on paper:
![](/src/assets/blog/paper-prototypes.jpg)
![](/blog/newlogo/paperprototypes.jpg)
And there it all clicked:
![](/src/assets/blog/paper-logo.png)
![](/blog/newlogo/paperlogo.png)
seren tried by the way!
![](/src/assets/blog/seren-tried.png)
![](/blog/newlogo/serentried.png)
# Anyways, here it is:
@@ -32,4 +31,4 @@ Pretty nice!
By the way, we have animations and variations on the way, so make sure to stay updated in the [discord server](https://sern.dev/discord)!
# Finally, from the entire sern team, thank you for sticking around ❤️
# Finally, from the entire sern team, thank you for sticking around ❤️

View File

@@ -1,9 +1,8 @@
---
slug: blog/railway-deploy
slug: railway-deploy
title: Deploying sern with Railway
authors: [duro]
authors: [Duro]
tags: [guides]
date: 2024-02-23
---
In this guide, I'll be showing you how to deploy your sern bot with [Railway](https://railway.app/).

24
blog/authors.yml Normal file
View File

@@ -0,0 +1,24 @@
jacoobes:
name: jacoobes
title: Head Dev
url: https://github.com/jacoobes
image_url: https://github.com/jacoobes.png
Sr Izan:
name: Sr Izan
title: Developer
url: https://github.com/SrIzan10
image_url: https://github.com/SrIzan10.png
sern:
name: sern Team
url: https://github.com/sern-handler
image_url: https://github.com/sernbot.png
Murtatrxx:
name: Murtatrxx
title: Developer
url: https://github.com/Murtatrxx
image_url: https://github.com/Murtatrxx.png
Duro:
name: Duro
title: Developer
url: https://github.com/DuroCodes
image_url: https://github.com/DuroCodes.png

BIN
bun.lockb

Binary file not shown.

206
docgen.docusaurus.config.js Normal file
View File

@@ -0,0 +1,206 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const lightCodeTheme = require('prism-react-renderer').themes.nightOwlLight;
const darkCodeTheme = require('prism-react-renderer').themes.oceanicNext;
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'sern - Handlers. Redefined.',
tagline: 'With the support of the community made plugins and a powerful CLI, it\'s more than just a handler.',
url: 'https://sern.dev',
baseUrl: '/',
onBrokenLinks: 'ignore',
onBrokenMarkdownLinks: 'warn',
favicon: '/img/favicon.ico', // this currently not working
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'sern-handler', // Usually your GitHub org/user name.
projectName: 'website', // Usually your repo name.
deploymentBranch: 'main',
trailingSlash: false,
// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en']
},
markdown: {
format: 'detect'
},
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
editUrl:
'https://github.com/sern-handler/website/edit/main/',
},
blog: {
showReadingTime: true,
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
blogSidebarCount: 'ALL',
},
pages: {
path: 'src/pages',
routeBasePath: '/',
include: ['**/*.{js,jsx,ts,tsx,md,mdx}'],
exclude: [
'**/_*.{js,jsx,ts,tsx,md,mdx}',
'**/_*/**',
'**/*.test.{js,jsx,ts,tsx}',
'**/__tests__/**',
],
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
image: 'https://sern.dev/img/logo.png',
algolia: {
appId: 'AA9S5J9NYT',
apiKey: 'ccfe6abc4d12ac6f882565a9d0caafb1',
indexName: 'sern',
insights: true,
container: 'div',
debug: false,
contextualSearch: true,
externalUrlRegex: 'external\\.com|domain\\.com',
replaceSearchResultPathname: {
from: '/docs/api',
to: '/docs/api',
},
searchParameters: {},
searchPagePath: 'search',
},
navbar: {
title: 'Home',
logo: {
alt: 'logo logo',
src: 'img/favicon.ico',
},
items: [
{
type: 'doc',
docId: 'intro',
position: 'left',
label: 'Docs & Guide',
},
{ to: '/blog', label: 'Blog', position: 'left' },
{
href: 'https://github.com/sern-handler',
label: 'GitHub',
position: 'right',
},
{
to: '/plugins',
label: 'Plugins',
position: 'left'
}
],
},
footer: {
style: 'dark',
links: [
{
title: 'Information',
items: [
{
label: 'Docs & Guide',
to: '/docs/intro',
},
],
},
{
title: 'Community',
items: [
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/sern-handler',
},
{
label: 'Discord',
href: 'https://discord.gg/DwbF5H5JgQ',
},
{
label: 'Open Collective',
href: 'https://opencollective.com/sern'
}
],
},
{
title: 'More',
items: [
{
label: 'Blog',
to: '/blog',
},
{
label: 'GitHub',
href: 'https://github.com/sern-handler',
},
],
},
],
copyright: `Built with ❤️ by the sern Handler team and its contributors`,
},
metadata: [
{ name: 'og:title', content: 'sern - Handlers. Redefined.' },
{ name: 'og:description', content: 'A modular, customizable, fast Discord.js framework to streamline bot development' },
{ name: 'og:url', content: 'https://sern.dev' },
{ name: 'og:type', content: 'website' },
{ name: 'twitter:site', content: '@sern-handler' },
{ property: 'og:image:alt', content: 'sernlogo' },
{ name: 'twitter:title', content: 'sern - Handlers. Redefined.' },
{ name: 'twitter:description', content: 'A modular, customizable, fast Discord.js framework to streamline bot development' },
{ name: 'keywords', content: 'discord, bot, handler, framework, documentation, sern' },
{ name: 'twitter:image', content: 'https://sern.dev/img/logo.png' },
{ name: 'twitter:url', content: 'https://sern.dev' },
{ property: 'og:image:height', content: '512' },
{ property: 'og:image:width', content: '1024' },
{ name: 'theme-color', content: '#F25186' }
],
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
plugins: [
[
'docusaurus-plugin-typedoc',
{
//if you're editing website, please change this to your local branch of sern to generate documentation
entryPoints: ['../sernHandlerV2/src/index.ts'],
tsconfig: '../sernHandlerV2/tsconfig.json',
},
],
[
"@dipakparmar/docusaurus-plugin-umami",
{
websiteID: "e82ff65c-b08f-47b5-8e74-5c31cbcec0ad",
analyticsDomain: "analytics.srizan.dev",
scriptName: 'ua.js',
dataAutoTrack: true,
dataDoNotTrack: true,
dataCache: true,
dataDomains: "sern.dev",
},
]
]
};
module.exports = config;

1
docs/api/_category_.yml Normal file
View File

@@ -0,0 +1 @@
label: "API"

View File

@@ -0,0 +1,97 @@
---
id: "CommandExecutable"
title: "Class: CommandExecutable<Type>"
sidebar_label: "CommandExecutable"
sidebar_position: 0
custom_edit_url: null
---
**`Deprecated`**
Will be removed in future
## Type parameters
| Name | Type |
| :------ | :------ |
| `Type` | extends [`CommandType`](../enums/CommandType.md) = [`CommandType`](../enums/CommandType.md) |
## Constructors
### constructor
**new CommandExecutable**<`Type`\>(): [`CommandExecutable`](CommandExecutable.md)<`Type`\>
#### Type parameters
| Name | Type |
| :------ | :------ |
| `Type` | extends [`CommandType`](../enums/CommandType.md) = [`CommandType`](../enums/CommandType.md) |
#### Returns
[`CommandExecutable`](CommandExecutable.md)<`Type`\>
## Properties
### plugins
**plugins**: [`AnyCommandPlugin`](../modules.md#anycommandplugin)[] = `[]`
#### Defined in
[src/core/modules.ts:80](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L80)
___
### type
`Abstract` **type**: `Type`
#### Defined in
[src/core/modules.ts:79](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L79)
___
### \_instance
`Static` `Private` **\_instance**: [`CommandModule`](../modules.md#commandmodule)
#### Defined in
[src/core/modules.ts:81](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L81)
## Methods
### execute
**execute**(`...args`): `unknown`
#### Parameters
| Name | Type |
| :------ | :------ |
| `...args` | `CommandArgs`<`Type`, [`Control`](../enums/PluginType.md#control)\> |
#### Returns
`unknown`
#### Defined in
[src/core/modules.ts:92](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L92)
___
### getInstance
**getInstance**(): [`CommandModule`](../modules.md#commandmodule)
#### Returns
[`CommandModule`](../modules.md#commandmodule)
#### Defined in
[src/core/modules.ts:83](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L83)

View File

@@ -1,193 +1,246 @@
---
editUrl: false
next: false
prev: false
title: "Context"
id: "Context"
title: "Class: Context"
sidebar_label: "Context"
sidebar_position: 0
custom_edit_url: null
---
## Since
**`Since`**
1.0.0
Provides values shared between
Message and ChatInputCommandInteraction
## Extends
## Hierarchy
- `CoreContext`\<`Message`, `ChatInputCommandInteraction`\>
- `CoreContext`<`Message`, `ChatInputCommandInteraction`\>
**`Context`**
## Constructors
### constructor
**new Context**(`ctx`): [`Context`](Context.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| `ctx` | `Result`<`Message`<`boolean`\>, `ChatInputCommandInteraction`<`CacheType`\>\> |
#### Returns
[`Context`](Context.md)
#### Overrides
CoreContext\&lt;Message, ChatInputCommandInteraction\&gt;.constructor
#### Defined in
[src/core/structures/context.ts:29](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/context.ts#L29)
## Properties
### ctx
`Protected` **ctx**: `Result`<`Message`<`boolean`\>, `ChatInputCommandInteraction`<`CacheType`\>\>
#### Inherited from
CoreContext.ctx
#### Defined in
[src/core/structures/context.ts:29](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/context.ts#L29)
## Accessors
### channel
> `get` **channel**(): `null` \| `TextBasedChannel`
`get` **channel**(): ``null`` \| `TextBasedChannel`
#### Returns
`null` \| `TextBasedChannel`
``null`` \| `TextBasedChannel`
#### Source
#### Defined in
[src/core/structures/context.ts:39](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/context.ts#L39)
***
___
### channelId
> `get` **channelId**(): `string`
`get` **channelId**(): `string`
#### Returns
`string`
#### Source
#### Defined in
[src/core/structures/context.ts:45](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/context.ts#L45)
***
___
### client
> `get` **client**(): `Client`\<`boolean`\>
`get` **client**(): `Client`<`boolean`\>
#### Returns
`Client`\<`boolean`\>
`Client`<`boolean`\>
#### Source
#### Defined in
[src/core/structures/context.ts:91](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/context.ts#L91)
***
___
### createdTimestamp
> `get` **createdTimestamp**(): `number`
`get` **createdTimestamp**(): `number`
#### Returns
`number`
#### Source
#### Defined in
[src/core/structures/context.ts:65](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/context.ts#L65)
***
___
### guild
> `get` **guild**(): `null` \| `Guild`
`get` **guild**(): ``null`` \| `Guild`
#### Returns
`null` \| `Guild`
``null`` \| `Guild`
#### Source
#### Defined in
[src/core/structures/context.ts:71](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/context.ts#L71)
***
___
### guildId
> `get` **guildId**(): `null` \| `string`
`get` **guildId**(): ``null`` \| `string`
#### Returns
`null` \| `string`
``null`` \| `string`
#### Source
#### Defined in
[src/core/structures/context.ts:77](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/context.ts#L77)
***
___
### id
> `get` **id**(): `string`
`get` **id**(): `string`
#### Returns
`string`
#### Source
#### Defined in
[src/core/structures/context.ts:33](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/context.ts#L33)
***
___
### inGuild
> `get` **inGuild**(): `boolean`
`get` **inGuild**(): `boolean`
#### Returns
`boolean`
#### Source
#### Defined in
[src/core/structures/context.ts:97](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/context.ts#L97)
***
___
### interaction
> `get` **interaction**(): `I`
`get` **interaction**(): `I`
#### Returns
`I`
#### Source
#### Inherited from
CoreContext.interaction
#### Defined in
[src/core/structures/core-context.ts:15](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/core-context.ts#L15)
***
___
### member
> `get` **member**(): `null` \| `GuildMember` \| `APIInteractionGuildMember`
`get` **member**(): ``null`` \| `GuildMember` \| `APIInteractionGuildMember`
#### Returns
`null` \| `GuildMember` \| `APIInteractionGuildMember`
``null`` \| `GuildMember` \| `APIInteractionGuildMember`
#### Source
#### Defined in
[src/core/structures/context.ts:85](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/context.ts#L85)
***
___
### message
> `get` **message**(): `M`
`get` **message**(): `M`
#### Returns
`M`
#### Source
#### Inherited from
CoreContext.message
#### Defined in
[src/core/structures/core-context.ts:12](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/core-context.ts#L12)
***
___
### options
> `get` **options**(): `Omit`\<`CommandInteractionOptionResolver`\<`CacheType`\>, `"getMessage"` \| `"getFocused"`\>
`get` **options**(): `Omit`<`CommandInteractionOptionResolver`<`CacheType`\>, ``"getMessage"`` \| ``"getFocused"``\>
#### Returns
`Omit`\<`CommandInteractionOptionResolver`\<`CacheType`\>, `"getMessage"` \| `"getFocused"`\>
`Omit`<`CommandInteractionOptionResolver`<`CacheType`\>, ``"getMessage"`` \| ``"getFocused"``\>
#### Source
#### Overrides
CoreContext.options
#### Defined in
[src/core/structures/context.ts:26](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/context.ts#L26)
***
___
### user
> `get` **user**(): `User`
`get` **user**(): `User`
If context is holding a message, message.author
else, interaction.user
@@ -196,96 +249,100 @@ else, interaction.user
`User`
#### Source
#### Defined in
[src/core/structures/context.ts:55](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/context.ts#L55)
***
___
### userId
> `get` **userId**(): `string`
`get` **userId**(): `string`
#### Returns
`string`
#### Source
#### Defined in
[src/core/structures/context.ts:61](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/context.ts#L61)
## Methods
### isMessage()
### isMessage
> **isMessage**(): `this is CoreContext<Message<boolean>, never>`
**isMessage**(): this is CoreContext<Message<boolean\>, never\>
#### Returns
`this is CoreContext<Message<boolean>, never>`
this is CoreContext<Message<boolean\>, never\>
#### Inherited from
`CoreContext.isMessage`
CoreContext.isMessage
#### Source
#### Defined in
[src/core/structures/core-context.ts:19](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/core-context.ts#L19)
***
___
### isSlash()
### isSlash
> **isSlash**(): `this is CoreContext<never, ChatInputCommandInteraction<CacheType>>`
**isSlash**(): this is CoreContext<never, ChatInputCommandInteraction<CacheType\>\>
#### Returns
`this is CoreContext<never, ChatInputCommandInteraction<CacheType>>`
this is CoreContext<never, ChatInputCommandInteraction<CacheType\>\>
#### Inherited from
`CoreContext.isSlash`
CoreContext.isSlash
#### Source
#### Defined in
[src/core/structures/core-context.ts:23](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/core-context.ts#L23)
***
___
### reply()
### reply
> **reply**(`content`): `Promise`\<`Message`\<`boolean`\>\>
**reply**(`content`): `Promise`<`Message`<`boolean`\>\>
#### Parameters
**content**: `ReplyOptions`
| Name | Type |
| :------ | :------ |
| `content` | `ReplyOptions` |
#### Returns
`Promise`\<`Message`\<`boolean`\>\>
`Promise`<`Message`<`boolean`\>\>
#### Source
#### Defined in
[src/core/structures/context.ts:103](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/context.ts#L103)
***
___
### wrap()
### wrap
> `static` **wrap**(`wrappable`): [`Context`](/api/classes/context/)
**wrap**(`wrappable`): [`Context`](Context.md)
#### Parameters
**wrappable**: `Message`\<`boolean`\> \| `BaseInteraction`\<`CacheType`\>
| Name | Type |
| :------ | :------ |
| `wrappable` | `Message`<`boolean`\> \| `BaseInteraction`<`CacheType`\> |
#### Returns
[`Context`](/api/classes/context/)
[`Context`](Context.md)
#### Overrides
`CoreContext.wrap`
CoreContext.wrap
#### Source
#### Defined in
[src/core/structures/context.ts:113](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/context.ts#L113)

View File

@@ -0,0 +1,90 @@
---
id: "DefaultErrorHandling"
title: "Class: DefaultErrorHandling"
sidebar_label: "DefaultErrorHandling"
sidebar_position: 0
custom_edit_url: null
---
**`Since`**
2.0.0
Version 4.0.0 will internalize this api. Please refrain from using the defaults!
## Implements
- [`ErrorHandling`](../interfaces/ErrorHandling.md)
## Constructors
### constructor
**new DefaultErrorHandling**(): [`DefaultErrorHandling`](DefaultErrorHandling.md)
#### Returns
[`DefaultErrorHandling`](DefaultErrorHandling.md)
## Properties
### #keepAlive
`Private` **#keepAlive**: `number` = `1`
#### Defined in
[src/core/structures/services/error-handling.ts:13](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/services/error-handling.ts#L13)
## Methods
### crash
**crash**(`err`): `never`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Error` |
#### Returns
`never`
**`Deprecated`**
Version 4 will remove this method
#### Implementation of
[ErrorHandling](../interfaces/ErrorHandling.md).[crash](../interfaces/ErrorHandling.md#crash)
#### Defined in
[src/core/structures/services/error-handling.ts:9](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/services/error-handling.ts#L9)
___
### updateAlive
**updateAlive**(`err`): `void`
A function that is called on every throw.
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Error` |
#### Returns
`void`
#### Implementation of
[ErrorHandling](../interfaces/ErrorHandling.md).[updateAlive](../interfaces/ErrorHandling.md#updatealive)
#### Defined in
[src/core/structures/services/error-handling.ts:15](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/services/error-handling.ts#L15)

View File

@@ -0,0 +1,136 @@
---
id: "DefaultLogging"
title: "Class: DefaultLogging"
sidebar_label: "DefaultLogging"
sidebar_position: 0
custom_edit_url: null
---
**`Since`**
2.0.0
Version 4.0.0 will internalize this api. Please refrain from using ModuleStore!
## Implements
- [`Logging`](../interfaces/Logging.md)
## Constructors
### constructor
**new DefaultLogging**(): [`DefaultLogging`](DefaultLogging.md)
#### Returns
[`DefaultLogging`](DefaultLogging.md)
## Methods
### date
**date**(): `Date`
#### Returns
`Date`
#### Defined in
[src/core/structures/services/logger.ts:9](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/services/logger.ts#L9)
___
### debug
**debug**(`payload`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `payload` | [`LogPayload`](../modules.md#logpayload) |
#### Returns
`void`
#### Implementation of
[Logging](../interfaces/Logging.md).[debug](../interfaces/Logging.md#debug)
#### Defined in
[src/core/structures/services/logger.ts:10](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/services/logger.ts#L10)
___
### error
**error**(`payload`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `payload` | [`LogPayload`](../modules.md#logpayload) |
#### Returns
`void`
#### Implementation of
[Logging](../interfaces/Logging.md).[error](../interfaces/Logging.md#error)
#### Defined in
[src/core/structures/services/logger.ts:14](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/services/logger.ts#L14)
___
### info
**info**(`payload`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `payload` | [`LogPayload`](../modules.md#logpayload) |
#### Returns
`void`
#### Implementation of
[Logging](../interfaces/Logging.md).[info](../interfaces/Logging.md#info)
#### Defined in
[src/core/structures/services/logger.ts:18](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/services/logger.ts#L18)
___
### warning
**warning**(`payload`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `payload` | [`LogPayload`](../modules.md#logpayload) |
#### Returns
`void`
#### Implementation of
[Logging](../interfaces/Logging.md).[warning](../interfaces/Logging.md#warning)
#### Defined in
[src/core/structures/services/logger.ts:22](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/services/logger.ts#L22)

View File

@@ -0,0 +1,195 @@
---
id: "DefaultModuleManager"
title: "Class: DefaultModuleManager"
sidebar_label: "DefaultModuleManager"
sidebar_position: 0
custom_edit_url: null
---
**`Since`**
2.0.0
Version 4.0.0 will internalize this api. Please refrain from using DefaultModuleManager!
## Implements
- [`ModuleManager`](../interfaces/ModuleManager.md)
## Constructors
### constructor
**new DefaultModuleManager**(`moduleStore`): [`DefaultModuleManager`](DefaultModuleManager.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| `moduleStore` | [`CoreModuleStore`](../interfaces/CoreModuleStore.md) |
#### Returns
[`DefaultModuleManager`](DefaultModuleManager.md)
#### Defined in
[src/core/structures/services/module-manager.ts:11](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/services/module-manager.ts#L11)
## Properties
### moduleStore
`Private` **moduleStore**: [`CoreModuleStore`](../interfaces/CoreModuleStore.md)
#### Defined in
[src/core/structures/services/module-manager.ts:11](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/services/module-manager.ts#L11)
## Methods
### get
**get**(`id`): `undefined` \| `Module`
#### Parameters
| Name | Type |
| :------ | :------ |
| `id` | `string` |
#### Returns
`undefined` \| `Module`
#### Implementation of
[ModuleManager](../interfaces/ModuleManager.md).[get](../interfaces/ModuleManager.md#get)
#### Defined in
[src/core/structures/services/module-manager.ts:34](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/services/module-manager.ts#L34)
___
### getByNameCommandType
**getByNameCommandType**<`T`\>(`name`, `commandType`): `undefined` \| [`CommandModuleDefs`](../interfaces/CommandModuleDefs.md)[`T`]
#### Type parameters
| Name | Type |
| :------ | :------ |
| `T` | extends [`CommandType`](../enums/CommandType.md) |
#### Parameters
| Name | Type |
| :------ | :------ |
| `name` | `string` |
| `commandType` | `T` |
#### Returns
`undefined` \| [`CommandModuleDefs`](../interfaces/CommandModuleDefs.md)[`T`]
#### Implementation of
[ModuleManager](../interfaces/ModuleManager.md).[getByNameCommandType](../interfaces/ModuleManager.md#getbynamecommandtype)
#### Defined in
[src/core/structures/services/module-manager.ts:14](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/services/module-manager.ts#L14)
___
### getMetadata
**getMetadata**(`m`): `CommandMeta`
#### Parameters
| Name | Type |
| :------ | :------ |
| `m` | `Module` |
#### Returns
`CommandMeta`
#### Implementation of
[ModuleManager](../interfaces/ModuleManager.md).[getMetadata](../interfaces/ModuleManager.md#getmetadata)
#### Defined in
[src/core/structures/services/module-manager.ts:26](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/services/module-manager.ts#L26)
___
### getPublishableCommands
**getPublishableCommands**(): [`CommandModule`](../modules.md#commandmodule)[]
#### Returns
[`CommandModule`](../modules.md#commandmodule)[]
**`Deprecated`**
#### Implementation of
[ModuleManager](../interfaces/ModuleManager.md).[getPublishableCommands](../interfaces/ModuleManager.md#getpublishablecommands)
#### Defined in
[src/core/structures/services/module-manager.ts:41](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/services/module-manager.ts#L41)
___
### set
**set**(`id`, `path`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `id` | `string` |
| `path` | [`CommandModule`](../modules.md#commandmodule) |
#### Returns
`void`
#### Implementation of
[ModuleManager](../interfaces/ModuleManager.md).[set](../interfaces/ModuleManager.md#set)
#### Defined in
[src/core/structures/services/module-manager.ts:37](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/services/module-manager.ts#L37)
___
### setMetadata
**setMetadata**(`m`, `c`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `m` | `Module` |
| `c` | `CommandMeta` |
#### Returns
`void`
#### Implementation of
[ModuleManager](../interfaces/ModuleManager.md).[setMetadata](../interfaces/ModuleManager.md#setmetadata)
#### Defined in
[src/core/structures/services/module-manager.ts:22](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/services/module-manager.ts#L22)

View File

@@ -0,0 +1,97 @@
---
id: "EventExecutable"
title: "Class: EventExecutable<Type>"
sidebar_label: "EventExecutable"
sidebar_position: 0
custom_edit_url: null
---
**`Deprecated`**
Will be removed in future
## Type parameters
| Name | Type |
| :------ | :------ |
| `Type` | extends [`EventType`](../enums/EventType.md) |
## Constructors
### constructor
**new EventExecutable**<`Type`\>(): [`EventExecutable`](EventExecutable.md)<`Type`\>
#### Type parameters
| Name | Type |
| :------ | :------ |
| `Type` | extends [`EventType`](../enums/EventType.md) |
#### Returns
[`EventExecutable`](EventExecutable.md)<`Type`\>
## Properties
### plugins
**plugins**: [`AnyEventPlugin`](../modules.md#anyeventplugin)[] = `[]`
#### Defined in
[src/core/modules.ts:101](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L101)
___
### type
`Abstract` **type**: `Type`
#### Defined in
[src/core/modules.ts:100](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L100)
___
### \_instance
`Static` `Private` **\_instance**: [`EventModule`](../modules.md#eventmodule)
#### Defined in
[src/core/modules.ts:103](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L103)
## Methods
### execute
**execute**(`...args`): `unknown`
#### Parameters
| Name | Type |
| :------ | :------ |
| `...args` | `EventArgs`<`Type`, [`Control`](../enums/PluginType.md#control)\> |
#### Returns
`unknown`
#### Defined in
[src/core/modules.ts:112](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L112)
___
### getInstance
**getInstance**(): [`EventModule`](../modules.md#eventmodule)
#### Returns
[`EventModule`](../modules.md#eventmodule)
#### Defined in
[src/core/modules.ts:104](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L104)

View File

@@ -1,36 +1,37 @@
---
editUrl: false
next: false
prev: false
title: "ModuleStore"
id: "ModuleStore"
title: "Class: ModuleStore"
sidebar_label: "ModuleStore"
sidebar_position: 0
custom_edit_url: null
---
## Constructors
### new ModuleStore()
### constructor
> **new ModuleStore**(): [`ModuleStore`](/api/classes/modulestore/)
**new ModuleStore**(): [`ModuleStore`](ModuleStore.md)
#### Returns
[`ModuleStore`](/api/classes/modulestore/)
[`ModuleStore`](ModuleStore.md)
## Properties
### commands
> **commands**: `Map`\<`string`, `Module`\>
**commands**: `Map`<`string`, `Module`\>
#### Source
#### Defined in
[src/core/structures/module-store.ts:10](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/module-store.ts#L10)
***
___
### metadata
> **metadata**: `WeakMap`\<`Module`, `CommandMeta`\>
**metadata**: `WeakMap`<`Module`, `CommandMeta`\>
#### Source
#### Defined in
[src/core/structures/module-store.ts:9](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/module-store.ts#L9)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
label: "Classes"
position: 3

View File

@@ -1,16 +1,17 @@
---
editUrl: false
next: false
prev: false
title: "CommandType"
id: "CommandType"
title: "Enumeration: CommandType"
sidebar_label: "CommandType"
sidebar_position: 0
custom_edit_url: null
---
## Since
**`Since`**
1.0.0
A bitfield that discriminates command modules
## Example
**`Example`**
```ts
export default commandModule({
@@ -27,118 +28,118 @@ export default commandModule({
### Both
> **Both**: `3`
**Both** = ``3``
#### Source
#### Defined in
[src/core/structures/enums.ts:20](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/enums.ts#L20)
***
___
### Button
> **Button**: `16`
**Button** = ``16``
#### Source
#### Defined in
[src/core/structures/enums.ts:23](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/enums.ts#L23)
***
___
### ChannelSelect
> **ChannelSelect**: `1024`
**ChannelSelect** = ``1024``
#### Source
#### Defined in
[src/core/structures/enums.ts:29](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/enums.ts#L29)
***
___
### CtxMsg
> **CtxMsg**: `8`
**CtxMsg** = ``8``
#### Source
#### Defined in
[src/core/structures/enums.ts:22](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/enums.ts#L22)
***
___
### CtxUser
> **CtxUser**: `4`
**CtxUser** = ``4``
#### Source
#### Defined in
[src/core/structures/enums.ts:21](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/enums.ts#L21)
***
___
### MentionableSelect
> **MentionableSelect**: `512`
**MentionableSelect** = ``512``
#### Source
#### Defined in
[src/core/structures/enums.ts:28](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/enums.ts#L28)
***
___
### Modal
> **Modal**: `64`
**Modal** = ``64``
#### Source
#### Defined in
[src/core/structures/enums.ts:25](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/enums.ts#L25)
***
___
### RoleSelect
> **RoleSelect**: `256`
**RoleSelect** = ``256``
#### Source
#### Defined in
[src/core/structures/enums.ts:27](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/enums.ts#L27)
***
___
### Slash
> **Slash**: `2`
**Slash** = ``2``
#### Source
#### Defined in
[src/core/structures/enums.ts:19](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/enums.ts#L19)
***
___
### StringSelect
> **StringSelect**: `32`
**StringSelect** = ``32``
#### Source
#### Defined in
[src/core/structures/enums.ts:24](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/enums.ts#L24)
***
___
### Text
> **Text**: `1`
**Text** = ``1``
#### Source
#### Defined in
[src/core/structures/enums.ts:18](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/enums.ts#L18)
***
___
### UserSelect
> **UserSelect**: `128`
**UserSelect** = ``128``
#### Source
#### Defined in
[src/core/structures/enums.ts:26](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/enums.ts#L26)

View File

@@ -1,13 +1,14 @@
---
editUrl: false
next: false
prev: false
title: "EventType"
id: "EventType"
title: "Enumeration: EventType"
sidebar_label: "EventType"
sidebar_position: 0
custom_edit_url: null
---
A bitfield that discriminates event modules
## Example
**`Example`**
```ts
export default eventModule({
@@ -24,35 +25,35 @@ export default eventModule({
### Discord
> **Discord**: `1`
**Discord** = ``1``
The EventType for handling discord events
#### Source
#### Defined in
[src/core/structures/enums.ts:51](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/enums.ts#L51)
***
___
### External
> **External**: `3`
**External** = ``3``
The EventType for handling external events.
Could be for example, `process` events, database events
#### Source
#### Defined in
[src/core/structures/enums.ts:60](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/enums.ts#L60)
***
___
### Sern
> **Sern**: `2`
**Sern** = ``2``
The EventType for handling sern events
#### Source
#### Defined in
[src/core/structures/enums.ts:55](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/enums.ts#L55)

View File

@@ -1,42 +1,43 @@
---
editUrl: false
next: false
prev: false
title: "PayloadType"
id: "PayloadType"
title: "Enumeration: PayloadType"
sidebar_label: "PayloadType"
sidebar_position: 0
custom_edit_url: null
---
## Enumeration Members
### Failure
> **Failure**: `"failure"`
**Failure** = ``"failure"``
The PayloadType for a SernEmitter failure event
#### Source
#### Defined in
[src/core/structures/enums.ts:98](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/enums.ts#L98)
***
___
### Success
> **Success**: `"success"`
**Success** = ``"success"``
The PayloadType for a SernEmitter success event
#### Source
#### Defined in
[src/core/structures/enums.ts:94](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/enums.ts#L94)
***
___
### Warning
> **Warning**: `"warning"`
**Warning** = ``"warning"``
The PayloadType for a SernEmitter warning event
#### Source
#### Defined in
[src/core/structures/enums.ts:102](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/enums.ts#L102)

View File

@@ -1,13 +1,14 @@
---
editUrl: false
next: false
prev: false
title: "PluginType"
id: "PluginType"
title: "Enumeration: PluginType"
sidebar_label: "PluginType"
sidebar_position: 0
custom_edit_url: null
---
A bitfield that discriminates plugins
## Example
**`Example`**
```ts
export default function myPlugin() : EventPlugin<CommandType.Text> {
@@ -23,22 +24,22 @@ export default function myPlugin() : EventPlugin<CommandType.Text> {
### Control
> **Control**: `2`
**Control** = ``2``
The PluginType for EventPlugins
#### Source
#### Defined in
[src/core/structures/enums.ts:85](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/enums.ts#L85)
***
___
### Init
> **Init**: `1`
**Init** = ``1``
The PluginType for InitPlugins
#### Source
#### Defined in
[src/core/structures/enums.ts:81](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/structures/enums.ts#L81)

104
docs/api/enums/SernError.md Normal file
View File

@@ -0,0 +1,104 @@
---
id: "SernError"
title: "Enumeration: SernError"
sidebar_label: "SernError"
sidebar_position: 0
custom_edit_url: null
---
## Enumeration Members
### InvalidModuleType
**InvalidModuleType** = ``"Detected an unknown module type"``
Throws when registering an invalid module.
This means it is undefined or an invalid command type was provided
#### Defined in
[src/handler/structures/errors.ts:9](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/structures/errors.ts#L9)
___
### MismatchEvent
• **MismatchEvent** = ``"You cannot use message when an interaction fired or vice versa"``
A crash that occurs when accessing an invalid property of Context
#### Defined in
[src/handler/structures/errors.ts:29](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/structures/errors.ts#L29)
___
### MismatchModule
• **MismatchModule** = ``"A module type mismatched with event emitted!"``
Attempted to lookup module in command module store. Nothing was found!
#### Defined in
[src/handler/structures/errors.ts:17](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/structures/errors.ts#L17)
___
### MissingRequired
• **MissingRequired** = ``"@sern/client is required but was not found"``
Required Dependency not found
#### Defined in
[src/handler/structures/errors.ts:37](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/structures/errors.ts#L37)
___
### NotSupportedInteraction
• **NotSupportedInteraction** = ``"This interaction is not supported."``
Unsupported interaction at this moment.
#### Defined in
[src/handler/structures/errors.ts:21](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/structures/errors.ts#L21)
___
### NotSupportedYet
• **NotSupportedYet** = ``"This feature is not supported yet"``
Unsupported feature attempted to access at this time
#### Defined in
[src/handler/structures/errors.ts:33](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/structures/errors.ts#L33)
___
### PluginFailure
• **PluginFailure** = ``"A plugin failed to call controller.next()"``
One plugin called `controller.stop()` (end command execution / loading)
#### Defined in
[src/handler/structures/errors.ts:25](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/structures/errors.ts#L25)
___
### UndefinedModule
• **UndefinedModule** = ``"A module could not be detected"``
Attempted to lookup module in command module store. Nothing was found!
#### Defined in
[src/handler/structures/errors.ts:13](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/structures/errors.ts#L13)

View File

@@ -0,0 +1,2 @@
label: "Enumerations"
position: 2

76
docs/api/index.md Normal file
View File

@@ -0,0 +1,76 @@
---
id: "index"
title: "@sern/handler"
sidebar_label: "Readme"
sidebar_position: 0
custom_edit_url: null
---
<div align="center">
<img src="https://raw.githubusercontent.com/sern-handler/.github/main/banner.png" width="900px" />
</div>
<h1 align="center">Handlers. Redefined.</h1>
<h4 align="center">A complete, customizable, typesafe, & reactive framework for discord bots</h4>
<div align="center" styles="margin-top: 10px">
<img src="https://img.shields.io/badge/open-source-brightgreen" />
<a href="https://www.npmjs.com/package/@sern/handler"><img src="https://img.shields.io/npm/v/@sern/handler?maxAge=3600" alt="NPM version" /></a>
<a href="https://www.npmjs.com/package/@sern/handler"><img src="https://img.shields.io/npm/dt/@sern/handler?maxAge=3600" alt="NPM downloads" /></a>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-brightgreen" alt="License MIT" /></a>
<a href="https://sern.dev"><img alt="docs.rs" src="https://img.shields.io/docsrs/docs" /></a>
<img alt="Lines of code" src="https://img.shields.io/badge/total%20lines-2k-blue" />
</div>
## Why?
- For you. A framework that's tailored to your exact needs.
- Lightweight. Does a lot while being small.
- Latest features. Support for discord.js v14 and all of its interactions.
- Start quickly. Plug and play or customize to your liking.
- works with [bun](https://bun.sh/) and [node](https://nodejs.org/en) out the box!
- Use it with TypeScript or JavaScript. CommonJS and ESM supported.
- Active and growing community, always here to help. [Join us](https://sern.dev/discord)
- Unleash its full potential with a powerful CLI and awesome plugins.
## 📜 Installation
[Start here!!](https://sern.dev/docs/guide/walkthrough/new-project)
## 👶 Basic Usage
<details><summary>ping.ts</summary>
```ts
export default commandModule({
type: CommandType.Slash,
//Installed plugin to publish to discord api and allow access to owners only.
plugins: [publish(), ownerOnly()],
description: 'A ping pong command',
execute(ctx) {
ctx.reply('Hello owner of the bot');
}
});
```
</details>
## 🤖 Bots Using sern
- [Community Bot](https://github.com/sern-handler/sern-community), the community bot for our [discord server](https://sern.dev/discord).
- [Vinci](https://github.com/SrIzan10/vinci), the bot for Mara Turing.
- [Bask](https://github.com/baskbotml/bask), Listen your favorite artists on Discord.
- [ava](https://github.com/SrIzan10/ava), A discord bot that plays KNGI and Gensokyo Radio.
- [Murayama](https://github.com/murayamabot/murayama), :pepega:
- [Protector (WIP)](https://github.com/needhamgary/Protector), Just a simple bot to help enhance a private minecraft server.
- [SmokinWeed 💨](https://github.com/Peter-MJ-Parker/sern-bud), A fun bot for a small - but growing - server.
- [Man Nomic](https://github.com/jacoobes/man-nomic), A simple information bot to provide information to the nomic-ai discord community.
- [Linear-Discord](https://github.com/sern-handler/linear-discord) Display and manage a linear dashboard.
## 💻 CLI
It is **highly encouraged** to use the [command line interface](https://github.com/sern-handler/cli) for your project. Don't forget to view it.
## 🔗 Links
- [Official Documentation and Guide](https://sern.dev)
- [Support Server](https://sern.dev/discord)
## 👋 Contribute
- Read our contribution [guidelines](https://github.com/sern-handler/handler/blob/main/.github/CONTRIBUTING.md) carefully
- Pull up on [issues](https://github.com/sern-handler/handler/issues) and report bugs
- All kinds of contributions are welcomed.

View File

@@ -0,0 +1,55 @@
---
id: "AutocompleteCommand"
title: "Interface: AutocompleteCommand"
sidebar_label: "AutocompleteCommand"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- `Omit`<[`Module`](Module.md), ``"name"`` \| ``"type"`` \| ``"plugins"`` \| ``"description"``\>
**`AutocompleteCommand`**
## Properties
### execute
**execute**: (`ctx`: `AutocompleteInteraction`<`CacheType`\>) => `unknown`
#### Type declaration
▸ (`ctx`): `unknown`
##### Parameters
| Name | Type |
| :------ | :------ |
| `ctx` | `AutocompleteInteraction`<`CacheType`\> |
##### Returns
`unknown`
#### Overrides
Omit.execute
#### Defined in
[src/types/module.ts:111](https://github.com/sern-handler/handler/blob/c1f6906/src/types/module.ts#L111)
___
### onEvent
**onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
#### Overrides
Omit.onEvent
#### Defined in
[src/types/module.ts:110](https://github.com/sern-handler/handler/blob/c1f6906/src/types/module.ts#L110)

View File

@@ -0,0 +1,88 @@
---
id: "AutocompletePlugin"
title: "Interface: AutocompletePlugin"
sidebar_label: "AutocompletePlugin"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- [`Plugin`](Plugin.md)
**`AutocompletePlugin`**
## Properties
### description
`Optional` **description**: `string`
**`Deprecated`**
will be removed in the next update
#### Inherited from
[Plugin](Plugin.md).[description](Plugin.md#description)
#### Defined in
[src/handler/plugins/plugin.ts:33](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L33)
___
### execute
**execute**: (`autocmp`: `AutocompleteInteraction`<`CacheType`\>, `controlller`: [`Controller`](Controller.md)) => `Awaitable`<`Result`<`void`, `void`\>\>
#### Type declaration
▸ (`autocmp`, `controlller`): `Awaitable`<`Result`<`void`, `void`\>\>
##### Parameters
| Name | Type |
| :------ | :------ |
| `autocmp` | `AutocompleteInteraction`<`CacheType`\> |
| `controlller` | [`Controller`](Controller.md) |
##### Returns
`Awaitable`<`Result`<`void`, `void`\>\>
#### Defined in
[src/handler/plugins/plugin.ts:73](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L73)
___
### name
`Optional` **name**: `string`
**`Deprecated`**
will be removed in the next update
#### Inherited from
[Plugin](Plugin.md).[name](Plugin.md#name)
#### Defined in
[src/handler/plugins/plugin.ts:31](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L31)
___
### type
**type**: [`Event`](../enums/PluginType.md#event)
#### Overrides
[Plugin](Plugin.md).[type](Plugin.md#type)
#### Defined in
[src/handler/plugins/plugin.ts:72](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L72)

View File

@@ -1,124 +1,132 @@
---
editUrl: false
next: false
prev: false
title: "BothCommand"
id: "BothCommand"
title: "Interface: BothCommand"
sidebar_label: "BothCommand"
sidebar_position: 0
custom_edit_url: null
---
## Extends
## Hierarchy
- `Module`
**`BothCommand`**
## Properties
### alias?
### alias
> `optional` **alias**: `string`[]
`Optional` **alias**: `string`[]
#### Source
#### Defined in
[src/types/core-modules.ts:125](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L125)
***
___
### description
> **description**: `string`
**description**: `string`
#### Overrides
`Module.description`
Module.description
#### Source
#### Defined in
[src/types/core-modules.ts:126](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L126)
***
___
### execute()
### execute
> **execute**: (`ctx`, `args`) => `unknown`
**execute**: (`ctx`: [`Context`](../classes/Context.md), `args`: [`Args`](../modules.md#args)) => `unknown`
#### Parameters
#### Type declaration
**ctx**: [`Context`](/api/classes/context/)
▸ (`ctx`, `args`): `unknown`
**args**: [`Args`](/api/type-aliases/args/)
##### Parameters
#### Returns
| Name | Type |
| :------ | :------ |
| `ctx` | [`Context`](../classes/Context.md) |
| `args` | [`Args`](../modules.md#args) |
##### Returns
`unknown`
#### Overrides
`Module.execute`
Module.execute
#### Source
#### Defined in
[src/types/core-modules.ts:128](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L128)
***
___
### name?
### name
> `optional` **name**: `string`
`Optional` **name**: `string`
#### Inherited from
`Module.name`
Module.name
#### Source
#### Defined in
[src/types/core-modules.ts:33](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L33)
***
___
### onEvent
> **onEvent**: [`ControlPlugin`](/api/interfaces/controlplugin/)\<`any`[]\>[]
**onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.onEvent`
Module.onEvent
#### Source
#### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L34)
***
___
### options?
### options
> `optional` **options**: [`SernOptionsData`](/api/type-aliases/sernoptionsdata/)[]
`Optional` **options**: [`SernOptionsData`](../modules.md#sernoptionsdata)[]
#### Source
#### Defined in
[src/types/core-modules.ts:127](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L127)
***
___
### plugins
> **plugins**: [`InitPlugin`](/api/interfaces/initplugin/)\<`any`[]\>[]
**plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.plugins`
Module.plugins
#### Source
#### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L35)
***
___
### type
> **type**: [`Both`](/api/enumerations/commandtype/#both)
**type**: [`Both`](../enums/CommandType.md#both)
#### Overrides
`Module.type`
Module.type
#### Source
#### Defined in
[src/types/core-modules.ts:124](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L124)

View File

@@ -1,102 +1,111 @@
---
editUrl: false
next: false
prev: false
title: "ButtonCommand"
id: "ButtonCommand"
title: "Interface: ButtonCommand"
sidebar_label: "ButtonCommand"
sidebar_position: 0
custom_edit_url: null
---
## Extends
## Hierarchy
- `Module`
**`ButtonCommand`**
## Properties
### description?
### description
> `optional` **description**: `string`
`Optional` **description**: `string`
#### Inherited from
`Module.description`
Module.description
#### Source
#### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L36)
***
___
### execute()
### execute
> **execute**: (`ctx`) => `unknown`
**execute**: (`ctx`: `ButtonInteraction`<`CacheType`\>) => `unknown`
#### Parameters
#### Type declaration
**ctx**: `ButtonInteraction`\<`CacheType`\>
▸ (`ctx`): `unknown`
#### Returns
##### Parameters
| Name | Type |
| :------ | :------ |
| `ctx` | `ButtonInteraction`<`CacheType`\> |
##### Returns
`unknown`
#### Overrides
`Module.execute`
Module.execute
#### Source
#### Defined in
[src/types/core-modules.ts:65](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L65)
***
___
### name?
### name
> `optional` **name**: `string`
`Optional` **name**: `string`
#### Inherited from
`Module.name`
Module.name
#### Source
#### Defined in
[src/types/core-modules.ts:33](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L33)
***
___
### onEvent
> **onEvent**: [`ControlPlugin`](/api/interfaces/controlplugin/)\<`any`[]\>[]
**onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.onEvent`
Module.onEvent
#### Source
#### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L34)
***
___
### plugins
> **plugins**: [`InitPlugin`](/api/interfaces/initplugin/)\<`any`[]\>[]
**plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.plugins`
Module.plugins
#### Source
#### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L35)
***
___
### type
> **type**: [`Button`](/api/enumerations/commandtype/#button)
**type**: [`Button`](../enums/CommandType.md#button)
#### Overrides
`Module.type`
Module.type
#### Source
#### Defined in
[src/types/core-modules.ts:64](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L64)

View File

@@ -1,102 +1,111 @@
---
editUrl: false
next: false
prev: false
title: "ChannelSelectCommand"
id: "ChannelSelectCommand"
title: "Interface: ChannelSelectCommand"
sidebar_label: "ChannelSelectCommand"
sidebar_position: 0
custom_edit_url: null
---
## Extends
## Hierarchy
- `Module`
**`ChannelSelectCommand`**
## Properties
### description?
### description
> `optional` **description**: `string`
`Optional` **description**: `string`
#### Inherited from
`Module.description`
Module.description
#### Source
#### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L36)
***
___
### execute()
### execute
> **execute**: (`ctx`) => `unknown`
**execute**: (`ctx`: `ChannelSelectMenuInteraction`<`CacheType`\>) => `unknown`
#### Parameters
#### Type declaration
**ctx**: `ChannelSelectMenuInteraction`\<`CacheType`\>
▸ (`ctx`): `unknown`
#### Returns
##### Parameters
| Name | Type |
| :------ | :------ |
| `ctx` | `ChannelSelectMenuInteraction`<`CacheType`\> |
##### Returns
`unknown`
#### Overrides
`Module.execute`
Module.execute
#### Source
#### Defined in
[src/types/core-modules.ts:75](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L75)
***
___
### name?
### name
> `optional` **name**: `string`
`Optional` **name**: `string`
#### Inherited from
`Module.name`
Module.name
#### Source
#### Defined in
[src/types/core-modules.ts:33](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L33)
***
___
### onEvent
> **onEvent**: [`ControlPlugin`](/api/interfaces/controlplugin/)\<`any`[]\>[]
**onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.onEvent`
Module.onEvent
#### Source
#### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L34)
***
___
### plugins
> **plugins**: [`InitPlugin`](/api/interfaces/initplugin/)\<`any`[]\>[]
**plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.plugins`
Module.plugins
#### Source
#### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L35)
***
___
### type
> **type**: [`ChannelSelect`](/api/enumerations/commandtype/#channelselect)
**type**: [`ChannelSelect`](../enums/CommandType.md#channelselect)
#### Overrides
`Module.type`
Module.type
#### Source
#### Defined in
[src/types/core-modules.ts:74](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L74)

View File

@@ -0,0 +1,45 @@
---
id: "CommandError.Response"
title: "Interface: Response"
sidebar_label: "Response"
custom_edit_url: null
---
[CommandError](../namespaces/CommandError.md).Response
## Properties
### body
`Optional` **body**: `ReplyOptions`
#### Defined in
[src/core/structures/command-error.ts:6](https://github.com/sern-handler/handler/blob/504cdee/src/core/structures/command-error.ts#L6)
___
### log
`Optional` **log**: `Object`
#### Type declaration
| Name | Type |
| :------ | :------ |
| `message` | `unknown` |
| `type` | keyof [`Logging`](Logging.md)<`unknown`\> |
#### Defined in
[src/core/structures/command-error.ts:7](https://github.com/sern-handler/handler/blob/504cdee/src/core/structures/command-error.ts#L7)
___
### type
**type**: ``"fail"`` \| ``"continue"``
#### Defined in
[src/core/structures/command-error.ts:5](https://github.com/sern-handler/handler/blob/504cdee/src/core/structures/command-error.ts#L5)

View File

@@ -1,126 +1,127 @@
---
editUrl: false
next: false
prev: false
title: "CommandModuleDefs"
id: "CommandModuleDefs"
title: "Interface: CommandModuleDefs"
sidebar_label: "CommandModuleDefs"
sidebar_position: 0
custom_edit_url: null
---
## Properties
### 1
> **1**: [`TextCommand`](/api/interfaces/textcommand/)
**1**: [`TextCommand`](TextCommand.md)
#### Source
#### Defined in
[src/types/core-modules.ts:150](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L150)
***
___
### 1024
> **1024**: [`ChannelSelectCommand`](/api/interfaces/channelselectcommand/)
**1024**: [`ChannelSelectCommand`](ChannelSelectCommand.md)
#### Source
#### Defined in
[src/types/core-modules.ts:158](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L158)
***
___
### 128
> **128**: [`UserSelectCommand`](/api/interfaces/userselectcommand/)
**128**: [`UserSelectCommand`](UserSelectCommand.md)
#### Source
#### Defined in
[src/types/core-modules.ts:160](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L160)
***
___
### 16
> **16**: [`ButtonCommand`](/api/interfaces/buttoncommand/)
**16**: [`ButtonCommand`](ButtonCommand.md)
#### Source
#### Defined in
[src/types/core-modules.ts:155](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L155)
***
___
### 2
> **2**: [`SlashCommand`](/api/interfaces/slashcommand/)
**2**: [`SlashCommand`](SlashCommand.md)
#### Source
#### Defined in
[src/types/core-modules.ts:151](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L151)
***
___
### 256
> **256**: [`RoleSelectCommand`](/api/interfaces/roleselectcommand/)
**256**: [`RoleSelectCommand`](RoleSelectCommand.md)
#### Source
#### Defined in
[src/types/core-modules.ts:157](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L157)
***
___
### 3
> **3**: [`BothCommand`](/api/interfaces/bothcommand/)
**3**: [`BothCommand`](BothCommand.md)
#### Source
#### Defined in
[src/types/core-modules.ts:152](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L152)
***
___
### 32
> **32**: [`StringSelectCommand`](/api/interfaces/stringselectcommand/)
**32**: [`StringSelectCommand`](StringSelectCommand.md)
#### Source
#### Defined in
[src/types/core-modules.ts:156](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L156)
***
___
### 4
> **4**: [`ContextMenuUser`](/api/interfaces/contextmenuuser/)
**4**: [`ContextMenuUser`](ContextMenuUser.md)
#### Source
#### Defined in
[src/types/core-modules.ts:154](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L154)
***
___
### 512
> **512**: [`MentionableSelectCommand`](/api/interfaces/mentionableselectcommand/)
**512**: [`MentionableSelectCommand`](MentionableSelectCommand.md)
#### Source
#### Defined in
[src/types/core-modules.ts:159](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L159)
***
___
### 64
> **64**: [`ModalSubmitCommand`](/api/interfaces/modalsubmitcommand/)
**64**: [`ModalSubmitCommand`](ModalSubmitCommand.md)
#### Source
#### Defined in
[src/types/core-modules.ts:161](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L161)
***
___
### 8
> **8**: [`ContextMenuMsg`](/api/interfaces/contextmenumsg/)
**8**: [`ContextMenuMsg`](ContextMenuMsg.md)
#### Source
#### Defined in
[src/types/core-modules.ts:153](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L153)

View File

@@ -0,0 +1,72 @@
---
id: "CommandPlugin"
title: "Interface: CommandPlugin<T>"
sidebar_label: "CommandPlugin"
sidebar_position: 0
custom_edit_url: null
---
**`Deprecated`**
Use the newer helper functions and import { controller } from '@sern/handler'
## Type parameters
| Name | Type |
| :------ | :------ |
| `T` | extends [`CommandType`](../enums/CommandType.md) = [`CommandType`](../enums/CommandType.md) |
## Properties
### description
`Optional` **description**: `string`
#### Defined in
[src/types/plugin.ts:51](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L51)
___
### execute
**execute**: (`m`: [`InitArgs`](InitArgs.md)<[`Processed`](../modules.md#processed)<[`CommandModule`](../modules.md#commandmodule)\>\>, `controller?`: [`Deprecated`](../modules.md#deprecated)<``"Please import controller instead"``\>) => [`PluginResult`](../modules.md#pluginresult)
#### Type declaration
▸ (`m`, `controller?`): [`PluginResult`](../modules.md#pluginresult)
##### Parameters
| Name | Type |
| :------ | :------ |
| `m` | [`InitArgs`](InitArgs.md)<[`Processed`](../modules.md#processed)<[`CommandModule`](../modules.md#commandmodule)\>\> |
| `controller?` | [`Deprecated`](../modules.md#deprecated)<``"Please import controller instead"``\> |
##### Returns
[`PluginResult`](../modules.md#pluginresult)
#### Defined in
[src/types/plugin.ts:53](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L53)
___
### name
• `Optional` **name**: `string`
#### Defined in
[src/types/plugin.ts:50](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L50)
___
### type
• **type**: [`Init`](../enums/PluginType.md#init)
#### Defined in
[src/types/plugin.ts:52](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L52)

View File

@@ -1,102 +1,111 @@
---
editUrl: false
next: false
prev: false
title: "ContextMenuMsg"
id: "ContextMenuMsg"
title: "Interface: ContextMenuMsg"
sidebar_label: "ContextMenuMsg"
sidebar_position: 0
custom_edit_url: null
---
## Extends
## Hierarchy
- `Module`
**`ContextMenuMsg`**
## Properties
### description?
### description
> `optional` **description**: `string`
`Optional` **description**: `string`
#### Inherited from
`Module.description`
Module.description
#### Source
#### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L36)
***
___
### execute()
### execute
> **execute**: (`ctx`) => `unknown`
**execute**: (`ctx`: `MessageContextMenuCommandInteraction`<`CacheType`\>) => `unknown`
#### Parameters
#### Type declaration
**ctx**: `MessageContextMenuCommandInteraction`\<`CacheType`\>
▸ (`ctx`): `unknown`
#### Returns
##### Parameters
| Name | Type |
| :------ | :------ |
| `ctx` | `MessageContextMenuCommandInteraction`<`CacheType`\> |
##### Returns
`unknown`
#### Overrides
`Module.execute`
Module.execute
#### Source
#### Defined in
[src/types/core-modules.ts:60](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L60)
***
___
### name?
### name
> `optional` **name**: `string`
`Optional` **name**: `string`
#### Inherited from
`Module.name`
Module.name
#### Source
#### Defined in
[src/types/core-modules.ts:33](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L33)
***
___
### onEvent
> **onEvent**: [`ControlPlugin`](/api/interfaces/controlplugin/)\<`any`[]\>[]
**onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.onEvent`
Module.onEvent
#### Source
#### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L34)
***
___
### plugins
> **plugins**: [`InitPlugin`](/api/interfaces/initplugin/)\<`any`[]\>[]
**plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.plugins`
Module.plugins
#### Source
#### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L35)
***
___
### type
> **type**: [`CtxMsg`](/api/enumerations/commandtype/#ctxmsg)
**type**: [`CtxMsg`](../enums/CommandType.md#ctxmsg)
#### Overrides
`Module.type`
Module.type
#### Source
#### Defined in
[src/types/core-modules.ts:59](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L59)

View File

@@ -1,102 +1,111 @@
---
editUrl: false
next: false
prev: false
title: "ContextMenuUser"
id: "ContextMenuUser"
title: "Interface: ContextMenuUser"
sidebar_label: "ContextMenuUser"
sidebar_position: 0
custom_edit_url: null
---
## Extends
## Hierarchy
- `Module`
**`ContextMenuUser`**
## Properties
### description?
### description
> `optional` **description**: `string`
`Optional` **description**: `string`
#### Inherited from
`Module.description`
Module.description
#### Source
#### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L36)
***
___
### execute()
### execute
> **execute**: (`ctx`) => `unknown`
**execute**: (`ctx`: `UserContextMenuCommandInteraction`<`CacheType`\>) => `unknown`
#### Parameters
#### Type declaration
**ctx**: `UserContextMenuCommandInteraction`\<`CacheType`\>
▸ (`ctx`): `unknown`
#### Returns
##### Parameters
| Name | Type |
| :------ | :------ |
| `ctx` | `UserContextMenuCommandInteraction`<`CacheType`\> |
##### Returns
`unknown`
#### Overrides
`Module.execute`
Module.execute
#### Source
#### Defined in
[src/types/core-modules.ts:55](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L55)
***
___
### name?
### name
> `optional` **name**: `string`
`Optional` **name**: `string`
#### Inherited from
`Module.name`
Module.name
#### Source
#### Defined in
[src/types/core-modules.ts:33](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L33)
***
___
### onEvent
> **onEvent**: [`ControlPlugin`](/api/interfaces/controlplugin/)\<`any`[]\>[]
**onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.onEvent`
Module.onEvent
#### Source
#### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L34)
***
___
### plugins
> **plugins**: [`InitPlugin`](/api/interfaces/initplugin/)\<`any`[]\>[]
**plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.plugins`
Module.plugins
#### Source
#### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L35)
***
___
### type
> **type**: [`CtxUser`](/api/enumerations/commandtype/#ctxuser)
**type**: [`CtxUser`](../enums/CommandType.md#ctxuser)
#### Overrides
`Module.type`
Module.type
#### Source
#### Defined in
[src/types/core-modules.ts:54](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L54)

View File

@@ -0,0 +1,47 @@
---
id: "ControlPlugin"
title: "Interface: ControlPlugin<Args>"
sidebar_label: "ControlPlugin"
sidebar_position: 0
custom_edit_url: null
---
## Type parameters
| Name | Type |
| :------ | :------ |
| `Args` | extends `any`[] = `any`[] |
## Properties
### execute
**execute**: (...`args`: `Args`) => [`PluginResult`](../modules.md#pluginresult)
#### Type declaration
▸ (`...args`): [`PluginResult`](../modules.md#pluginresult)
##### Parameters
| Name | Type |
| :------ | :------ |
| `...args` | `Args` |
##### Returns
[`PluginResult`](../modules.md#pluginresult)
#### Defined in
[src/types/core-plugin.ts:73](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-plugin.ts#L73)
___
### type
**type**: [`Control`](../enums/PluginType.md#control)
#### Defined in
[src/types/core-plugin.ts:72](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-plugin.ts#L72)

View File

@@ -0,0 +1,43 @@
---
id: "Controller"
title: "Interface: Controller"
sidebar_label: "Controller"
sidebar_position: 0
custom_edit_url: null
---
## Properties
### next
**next**: () => `Ok`<`void`\>
#### Type declaration
▸ (): `Ok`<`void`\>
##### Returns
`Ok`<`void`\>
#### Defined in
[src/types/core-plugin.ts:59](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-plugin.ts#L59)
___
### stop
**stop**: () => `Err`<`void`\>
#### Type declaration
▸ (): `Err`<`void`\>
##### Returns
`Err`<`void`\>
#### Defined in
[src/types/core-plugin.ts:60](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-plugin.ts#L60)

View File

@@ -0,0 +1,119 @@
---
id: "CoreDependencies"
title: "Interface: CoreDependencies"
sidebar_label: "CoreDependencies"
sidebar_position: 0
custom_edit_url: null
---
## Properties
### @sern/client
**@sern/client**: () => [`Emitter`](Emitter.md)
#### Type declaration
▸ (): [`Emitter`](Emitter.md)
##### Returns
[`Emitter`](Emitter.md)
#### Defined in
[src/types/ioc.ts:28](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/ioc.ts#L28)
___
### @sern/emitter
**@sern/emitter**: () => [`Emitter`](Emitter.md)
#### Type declaration
▸ (): [`Emitter`](Emitter.md)
##### Returns
[`Emitter`](Emitter.md)
#### Defined in
[src/types/ioc.ts:29](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/ioc.ts#L29)
___
### @sern/errors
**@sern/errors**: () => [`ErrorHandling`](ErrorHandling.md)
#### Type declaration
▸ (): [`ErrorHandling`](ErrorHandling.md)
##### Returns
[`ErrorHandling`](ErrorHandling.md)
#### Defined in
[src/types/ioc.ts:36](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/ioc.ts#L36)
___
### @sern/logger
`Optional` **@sern/logger**: () => [`Logging`](Logging.md)<`unknown`\>
#### Type declaration
▸ (): [`Logging`](Logging.md)<`unknown`\>
##### Returns
[`Logging`](Logging.md)<`unknown`\>
#### Defined in
[src/types/ioc.ts:37](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/ioc.ts#L37)
___
### @sern/modules
**@sern/modules**: () => [`ModuleManager`](ModuleManager.md)
#### Type declaration
▸ (): [`ModuleManager`](ModuleManager.md)
##### Returns
[`ModuleManager`](ModuleManager.md)
#### Defined in
[src/types/ioc.ts:35](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/ioc.ts#L35)
___
### @sern/store
**@sern/store**: () => [`CoreModuleStore`](CoreModuleStore.md)
**`Deprecated`**
Will be removed and turned internal
#### Type declaration
▸ (): [`CoreModuleStore`](CoreModuleStore.md)
##### Returns
[`CoreModuleStore`](CoreModuleStore.md)
#### Defined in
[src/types/ioc.ts:34](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/ioc.ts#L34)

View File

@@ -1,8 +1,9 @@
---
editUrl: false
next: false
prev: false
title: "CoreModuleStore"
id: "CoreModuleStore"
title: "Interface: CoreModuleStore"
sidebar_label: "CoreModuleStore"
sidebar_position: 0
custom_edit_url: null
---
Represents a core module store that stores IDs mapped to file paths.
@@ -11,18 +12,18 @@ Represents a core module store that stores IDs mapped to file paths.
### commands
> **commands**: `Map`\<`string`, `Module`\>
**commands**: `Map`<`string`, `Module`\>
#### Source
#### Defined in
[src/core/contracts/module-store.ts:7](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/contracts/module-store.ts#L7)
***
___
### metadata
> **metadata**: `WeakMap`\<`Module`, `CommandMeta`\>
**metadata**: `WeakMap`<`Module`, `CommandMeta`\>
#### Source
#### Defined in
[src/core/contracts/module-store.ts:8](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/contracts/module-store.ts#L8)

View File

@@ -0,0 +1,67 @@
---
id: "Dependencies"
title: "Interface: Dependencies"
sidebar_label: "Dependencies"
sidebar_position: 0
custom_edit_url: null
---
## Properties
### @sern/client
**@sern/client**: [`Singleton`](../modules.md#singleton)<`__module`\>
#### Defined in
[src/types/handler.ts:40](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L40)
___
### @sern/emitter
**@sern/emitter**: [`Singleton`](../modules.md#singleton)<[`SernEmitter`](../classes/SernEmitter.md)\>
#### Defined in
[src/types/handler.ts:42](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L42)
___
### @sern/errors
**@sern/errors**: [`Singleton`](../modules.md#singleton)<[`ErrorHandling`](ErrorHandling.md)\>
#### Defined in
[src/types/handler.ts:45](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L45)
___
### @sern/logger
`Optional` **@sern/logger**: [`Singleton`](../modules.md#singleton)<[`Logging`](Logging.md)<`unknown`\>\>
#### Defined in
[src/types/handler.ts:41](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L41)
___
### @sern/modules
**@sern/modules**: [`Singleton`](../modules.md#singleton)<[`ModuleManager`](ModuleManager.md)\>
#### Defined in
[src/types/handler.ts:44](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L44)
___
### @sern/store
**@sern/store**: [`Singleton`](../modules.md#singleton)<[`ModuleStore`](../classes/ModuleStore.md)\>
#### Defined in
[src/types/handler.ts:43](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L43)

View File

@@ -0,0 +1,47 @@
---
id: "DependencyConfiguration"
title: "Interface: DependencyConfiguration<T>"
sidebar_label: "DependencyConfiguration"
sidebar_position: 0
custom_edit_url: null
---
## Type parameters
| Name | Type |
| :------ | :------ |
| `T` | extends [`Dependencies`](Dependencies.md) |
## Properties
### build
**build**: (`root`: `Container`<`Omit`<[`Dependencies`](Dependencies.md), ``"@sern/client"``\>, {}\>) => `Container`<`T`, {}\>
#### Type declaration
▸ (`root`): `Container`<`T`, {}\>
##### Parameters
| Name | Type |
| :------ | :------ |
| `root` | `Container`<`Omit`<[`Dependencies`](Dependencies.md), ``"@sern/client"``\>, {}\> |
##### Returns
`Container`<`T`, {}\>
#### Defined in
[src/types/handler.ts:68](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L68)
___
### exclude
• `Optional` **exclude**: `Set`<``"@sern/logger"``\>
#### Defined in
[src/types/handler.ts:67](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L67)

View File

@@ -0,0 +1,90 @@
---
id: "DiscordEmitterPlugin"
title: "Interface: DiscordEmitterPlugin"
sidebar_label: "DiscordEmitterPlugin"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- [`Plugin`](Plugin.md)
**`DiscordEmitterPlugin`**
## Properties
### description
`Optional` **description**: `string`
**`Deprecated`**
will be removed in the next update
#### Inherited from
[Plugin](Plugin.md).[description](Plugin.md#description)
#### Defined in
[src/handler/plugins/plugin.ts:33](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L33)
___
### execute
**execute**: (`payload`: { `absPath`: `string` ; `mod`: `DiscordEventCommand`<keyof `ClientEvents`\> & { `name`: `string` } }, `controller`: [`Controller`](Controller.md)) => `Awaitable`<`Result`<`void`, `void`\>\>
#### Type declaration
▸ (`payload`, `controller`): `Awaitable`<`Result`<`void`, `void`\>\>
##### Parameters
| Name | Type |
| :------ | :------ |
| `payload` | `Object` |
| `payload.absPath` | `string` |
| `payload.mod` | `DiscordEventCommand`<keyof `ClientEvents`\> & { `name`: `string` } |
| `controller` | [`Controller`](Controller.md) |
##### Returns
`Awaitable`<`Result`<`void`, `void`\>\>
#### Defined in
[src/handler/plugins/plugin.ts:49](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L49)
___
### name
`Optional` **name**: `string`
**`Deprecated`**
will be removed in the next update
#### Inherited from
[Plugin](Plugin.md).[name](Plugin.md#name)
#### Defined in
[src/handler/plugins/plugin.ts:31](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L31)
___
### type
**type**: [`Command`](../enums/PluginType.md#command)
#### Overrides
[Plugin](Plugin.md).[type](Plugin.md#type)
#### Defined in
[src/handler/plugins/plugin.ts:48](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L48)

View File

@@ -1,97 +1,104 @@
---
editUrl: false
next: false
prev: false
title: "DiscordEventCommand"
id: "DiscordEventCommand"
title: "Interface: DiscordEventCommand<T>"
sidebar_label: "DiscordEventCommand"
sidebar_position: 0
custom_edit_url: null
---
## Extends
- `Module`
## Type parameters
**T** *extends* keyof `ClientEvents` = keyof `ClientEvents`
| Name | Type |
| :------ | :------ |
| `T` | extends keyof `ClientEvents` = keyof `ClientEvents` |
## Hierarchy
- `Module`
**`DiscordEventCommand`**
## Properties
### description?
### description
> `optional` **description**: `string`
`Optional` **description**: `string`
#### Inherited from
`Module.description`
Module.description
#### Source
#### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L36)
***
___
### name?
### name
> `optional` **name**: `T`
`Optional` **name**: `T`
#### Overrides
`Module.name`
Module.name
#### Source
#### Defined in
[src/types/core-modules.ts:106](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L106)
***
___
### onEvent
> **onEvent**: [`ControlPlugin`](/api/interfaces/controlplugin/)\<`any`[]\>[]
**onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.onEvent`
Module.onEvent
#### Source
#### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L34)
***
___
### plugins
> **plugins**: [`InitPlugin`](/api/interfaces/initplugin/)\<`any`[]\>[]
**plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.plugins`
Module.plugins
#### Source
#### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L35)
***
___
### type
> **type**: [`Discord`](/api/enumerations/eventtype/#discord)
**type**: [`Discord`](../enums/EventType.md#discord)
#### Overrides
`Module.type`
Module.type
#### Source
#### Defined in
[src/types/core-modules.ts:107](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L107)
## Methods
### execute()
### execute
> **execute**(...`args`): `unknown`
**execute**(`...args`): `unknown`
#### Parameters
• ...**args**: `ClientEvents`\[`T`\]
| Name | Type |
| :------ | :------ |
| `...args` | `ClientEvents`[`T`] |
#### Returns
@@ -99,8 +106,8 @@ title: "DiscordEventCommand"
#### Overrides
`Module.execute`
Module.execute
#### Source
#### Defined in
[src/types/core-modules.ts:108](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L108)

View File

@@ -0,0 +1,94 @@
---
id: "DiscordEventPlugin"
title: "Interface: DiscordEventPlugin<T>"
sidebar_label: "DiscordEventPlugin"
sidebar_position: 0
custom_edit_url: null
---
## Type parameters
| Name | Type |
| :------ | :------ |
| `T` | extends keyof `ClientEvents` = keyof `ClientEvents` |
## Hierarchy
- [`Plugin`](Plugin.md)
**`DiscordEventPlugin`**
## Properties
### description
`Optional` **description**: `string`
**`Deprecated`**
will be removed in the next update
#### Inherited from
[Plugin](Plugin.md).[description](Plugin.md#description)
#### Defined in
[src/handler/plugins/plugin.ts:33](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L33)
___
### execute
**execute**: (`args`: `ClientEvents`[`T`], `controller`: [`Controller`](Controller.md)) => `Awaitable`<`Result`<`void`, `void`\>\>
#### Type declaration
▸ (`args`, `controller`): `Awaitable`<`Result`<`void`, `void`\>\>
##### Parameters
| Name | Type |
| :------ | :------ |
| `args` | `ClientEvents`[`T`] |
| `controller` | [`Controller`](Controller.md) |
##### Returns
`Awaitable`<`Result`<`void`, `void`\>\>
#### Defined in
[src/handler/plugins/plugin.ts:105](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L105)
___
### name
`Optional` **name**: `T`
**`Deprecated`**
will be removed in the next update
#### Overrides
[Plugin](Plugin.md).[name](Plugin.md#name)
#### Defined in
[src/handler/plugins/plugin.ts:103](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L103)
___
### type
**type**: [`Event`](../enums/PluginType.md#event)
#### Overrides
[Plugin](Plugin.md).[type](Plugin.md#type)
#### Defined in
[src/handler/plugins/plugin.ts:104](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L104)

View File

@@ -1,8 +1,9 @@
---
editUrl: false
next: false
prev: false
title: "Disposable"
id: "Disposable"
title: "Interface: Disposable"
sidebar_label: "Disposable"
sidebar_position: 0
custom_edit_url: null
---
Represents a Disposable contract.
@@ -10,14 +11,14 @@ Let dependencies implement this to dispose and cleanup.
## Methods
### dispose()
### dispose
> **dispose**(): `unknown`
**dispose**(): `unknown`
#### Returns
`unknown`
#### Source
#### Defined in
[src/core/contracts/hooks.ts:15](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/contracts/hooks.ts#L15)

View File

@@ -0,0 +1,70 @@
---
id: "Emitter"
title: "Interface: Emitter"
sidebar_label: "Emitter"
sidebar_position: 0
custom_edit_url: null
---
## Methods
### addListener
**addListener**(`eventName`, `listener`): `this`
#### Parameters
| Name | Type |
| :------ | :------ |
| `eventName` | `string` \| `symbol` |
| `listener` | `AnyFunction` |
#### Returns
`this`
#### Defined in
[src/core/contracts/emitter.ts:6](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/contracts/emitter.ts#L6)
___
### emit
**emit**(`eventName`, `...payload`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `eventName` | `string` \| `symbol` |
| `...payload` | `any`[] |
#### Returns
`boolean`
#### Defined in
[src/core/contracts/emitter.ts:8](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/contracts/emitter.ts#L8)
___
### removeListener
**removeListener**(`eventName`, `listener`): `this`
#### Parameters
| Name | Type |
| :------ | :------ |
| `eventName` | `string` \| `symbol` |
| `listener` | `AnyFunction` |
#### Returns
`this`
#### Defined in
[src/core/contracts/emitter.ts:7](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/contracts/emitter.ts#L7)

View File

@@ -1,52 +1,61 @@
---
editUrl: false
next: false
prev: false
title: "ErrorHandling"
id: "ErrorHandling"
title: "Interface: ErrorHandling"
sidebar_label: "ErrorHandling"
sidebar_position: 0
custom_edit_url: null
---
## Since
**`Since`**
2.0.0
## Implemented by
- [`DefaultErrorHandling`](../classes/DefaultErrorHandling.md)
## Methods
### ~~crash()~~
### crash
> **crash**(`err`): `never`
:::caution[Deprecated]
Version 4 will remove this method
:::
**crash**(`err`): `never`
#### Parameters
**err**: `Error`
| Name | Type |
| :------ | :------ |
| `err` | `Error` |
#### Returns
`never`
#### Source
**`Deprecated`**
Version 4 will remove this method
#### Defined in
[src/core/contracts/error-handling.ts:9](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/contracts/error-handling.ts#L9)
***
___
### updateAlive()
### updateAlive
> **updateAlive**(`error`): `void`
**updateAlive**(`error`): `void`
A function that is called on every throw.
#### Parameters
**error**: `Error`
| Name | Type |
| :------ | :------ |
| `error` | `Error` |
#### Returns
`void`
#### Source
#### Defined in
[src/core/contracts/error-handling.ts:14](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/contracts/error-handling.ts#L14)

View File

@@ -1,36 +1,37 @@
---
editUrl: false
next: false
prev: false
title: "EventModuleDefs"
id: "EventModuleDefs"
title: "Interface: EventModuleDefs"
sidebar_label: "EventModuleDefs"
sidebar_position: 0
custom_edit_url: null
---
## Properties
### 1
> **1**: [`DiscordEventCommand`](/api/interfaces/discordeventcommand/)\<keyof `ClientEvents`\>
**1**: [`DiscordEventCommand`](DiscordEventCommand.md)<keyof `ClientEvents`\>
#### Source
#### Defined in
[src/types/core-modules.ts:166](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L166)
***
___
### 2
> **2**: [`SernEventCommand`](/api/interfaces/serneventcommand/)\<keyof [`SernEventsMapping`](/api/interfaces/serneventsmapping/)\>
**2**: [`SernEventCommand`](SernEventCommand.md)<keyof [`SernEventsMapping`](SernEventsMapping.md)\>
#### Source
#### Defined in
[src/types/core-modules.ts:165](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L165)
***
___
### 3
> **3**: [`ExternalEventCommand`](/api/interfaces/externaleventcommand/)
**3**: [`ExternalEventCommand`](ExternalEventCommand.md)
#### Source
#### Defined in
[src/types/core-modules.ts:167](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L167)

View File

@@ -0,0 +1,72 @@
---
id: "EventPlugin"
title: "Interface: EventPlugin<T>"
sidebar_label: "EventPlugin"
sidebar_position: 0
custom_edit_url: null
---
**`Deprecated`**
Use the newer helper functions
## Type parameters
| Name | Type |
| :------ | :------ |
| `T` | extends [`CommandType`](../enums/CommandType.md) |
## Properties
### description
`Optional` **description**: `string`
#### Defined in
[src/types/plugin.ts:64](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L64)
___
### execute
**execute**: (`args`: [`CommandArgs`](../modules.md#commandargs)<`T`, [`Event`](../enums/PluginType.md#event)\>, `controller?`: [`Controller`](Controller.md)) => [`PluginResult`](../modules.md#pluginresult)
#### Type declaration
▸ (`args`, `controller?`): [`PluginResult`](../modules.md#pluginresult)
##### Parameters
| Name | Type |
| :------ | :------ |
| `args` | [`CommandArgs`](../modules.md#commandargs)<`T`, [`Event`](../enums/PluginType.md#event)\> |
| `controller?` | [`Controller`](Controller.md) |
##### Returns
[`PluginResult`](../modules.md#pluginresult)
#### Defined in
[src/types/plugin.ts:66](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L66)
___
### name
`Optional` **name**: `string`
#### Defined in
[src/types/plugin.ts:63](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L63)
___
### type
**type**: [`Event`](../enums/PluginType.md#event)
#### Defined in
[src/types/plugin.ts:65](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L65)

View File

@@ -0,0 +1,90 @@
---
id: "ExternalEmitterPlugin"
title: "Interface: ExternalEmitterPlugin"
sidebar_label: "ExternalEmitterPlugin"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- [`Plugin`](Plugin.md)
**`ExternalEmitterPlugin`**
## Properties
### description
`Optional` **description**: `string`
**`Deprecated`**
will be removed in the next update
#### Inherited from
[Plugin](Plugin.md).[description](Plugin.md#description)
#### Defined in
[src/handler/plugins/plugin.ts:33](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L33)
___
### execute
**execute**: (`payload`: { `absPath`: `string` ; `mod`: `ExternalEventCommand` & { `name`: `string` } }, `controller`: [`Controller`](Controller.md)) => `Awaitable`<`Result`<`void`, `void`\>\>
#### Type declaration
▸ (`payload`, `controller`): `Awaitable`<`Result`<`void`, `void`\>\>
##### Parameters
| Name | Type |
| :------ | :------ |
| `payload` | `Object` |
| `payload.absPath` | `string` |
| `payload.mod` | `ExternalEventCommand` & { `name`: `string` } |
| `controller` | [`Controller`](Controller.md) |
##### Returns
`Awaitable`<`Result`<`void`, `void`\>\>
#### Defined in
[src/handler/plugins/plugin.ts:57](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L57)
___
### name
`Optional` **name**: `string`
**`Deprecated`**
will be removed in the next update
#### Inherited from
[Plugin](Plugin.md).[name](Plugin.md#name)
#### Defined in
[src/handler/plugins/plugin.ts:31](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L31)
___
### type
**type**: [`Command`](../enums/PluginType.md#command)
#### Overrides
[Plugin](Plugin.md).[type](Plugin.md#type)
#### Defined in
[src/handler/plugins/plugin.ts:56](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L56)

View File

@@ -1,103 +1,108 @@
---
editUrl: false
next: false
prev: false
title: "ExternalEventCommand"
id: "ExternalEventCommand"
title: "Interface: ExternalEventCommand"
sidebar_label: "ExternalEventCommand"
sidebar_position: 0
custom_edit_url: null
---
## Extends
## Hierarchy
- `Module`
**`ExternalEventCommand`**
## Properties
### description?
### description
> `optional` **description**: `string`
`Optional` **description**: `string`
#### Inherited from
`Module.description`
Module.description
#### Source
#### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L36)
***
___
### emitter
> **emitter**: keyof `Dependencies`
**emitter**: keyof `Dependencies`
#### Source
#### Defined in
[src/types/core-modules.ts:48](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L48)
***
___
### name?
### name
> `optional` **name**: `string`
`Optional` **name**: `string`
#### Overrides
`Module.name`
Module.name
#### Source
#### Defined in
[src/types/core-modules.ts:47](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L47)
***
___
### onEvent
> **onEvent**: [`ControlPlugin`](/api/interfaces/controlplugin/)\<`any`[]\>[]
**onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.onEvent`
Module.onEvent
#### Source
#### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L34)
***
___
### plugins
> **plugins**: [`InitPlugin`](/api/interfaces/initplugin/)\<`any`[]\>[]
**plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.plugins`
Module.plugins
#### Source
#### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L35)
***
___
### type
> **type**: [`External`](/api/enumerations/eventtype/#external)
**type**: [`External`](../enums/EventType.md#external)
#### Overrides
`Module.type`
Module.type
#### Source
#### Defined in
[src/types/core-modules.ts:49](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L49)
## Methods
### execute()
### execute
> **execute**(...`args`): `unknown`
**execute**(`...args`): `unknown`
#### Parameters
• ...**args**: `unknown`[]
| Name | Type |
| :------ | :------ |
| `...args` | `unknown`[] |
#### Returns
@@ -105,8 +110,8 @@ title: "ExternalEventCommand"
#### Overrides
`Module.execute`
Module.execute
#### Source
#### Defined in
[src/types/core-modules.ts:50](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L50)

View File

@@ -0,0 +1,88 @@
---
id: "ExternalEventPlugin"
title: "Interface: ExternalEventPlugin"
sidebar_label: "ExternalEventPlugin"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- [`Plugin`](Plugin.md)
**`ExternalEventPlugin`**
## Properties
### description
`Optional` **description**: `string`
**`Deprecated`**
will be removed in the next update
#### Inherited from
[Plugin](Plugin.md).[description](Plugin.md#description)
#### Defined in
[src/handler/plugins/plugin.ts:33](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L33)
___
### execute
**execute**: (`args`: `unknown`[], `controller`: [`Controller`](Controller.md)) => `Awaitable`<`Result`<`void`, `void`\>\>
#### Type declaration
▸ (`args`, `controller`): `Awaitable`<`Result`<`void`, `void`\>\>
##### Parameters
| Name | Type |
| :------ | :------ |
| `args` | `unknown`[] |
| `controller` | [`Controller`](Controller.md) |
##### Returns
`Awaitable`<`Result`<`void`, `void`\>\>
#### Defined in
[src/handler/plugins/plugin.ts:99](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L99)
___
### name
`Optional` **name**: `string`
**`Deprecated`**
will be removed in the next update
#### Inherited from
[Plugin](Plugin.md).[name](Plugin.md#name)
#### Defined in
[src/handler/plugins/plugin.ts:31](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L31)
___
### type
**type**: [`Event`](../enums/PluginType.md#event)
#### Overrides
[Plugin](Plugin.md).[type](Plugin.md#type)
#### Defined in
[src/handler/plugins/plugin.ts:98](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L98)

View File

@@ -1,8 +1,9 @@
---
editUrl: false
next: false
prev: false
title: "Init"
id: "Init"
title: "Interface: Init"
sidebar_label: "Init"
sidebar_position: 0
custom_edit_url: null
---
Represents an initialization contract.
@@ -10,14 +11,14 @@ Let dependencies implement this to initiate some logic.
## Methods
### init()
### init
> **init**(): `unknown`
**init**(): `unknown`
#### Returns
`unknown`
#### Source
#### Defined in
[src/core/contracts/hooks.ts:7](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/contracts/hooks.ts#L7)

View File

@@ -0,0 +1,33 @@
---
id: "InitArgs"
title: "Interface: InitArgs<T>"
sidebar_label: "InitArgs"
sidebar_position: 0
custom_edit_url: null
---
## Type parameters
| Name | Type |
| :------ | :------ |
| `T` | extends [`Processed`](../modules.md#processed)<[`Module`](Module.md)\> |
## Properties
### absPath
**absPath**: `string`
#### Defined in
[src/handler/plugins/args.ts:107](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/plugins/args.ts#L107)
___
### module
**module**: `T`
#### Defined in
[src/handler/plugins/args.ts:106](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/plugins/args.ts#L106)

View File

@@ -0,0 +1,47 @@
---
id: "InitPlugin"
title: "Interface: InitPlugin<Args>"
sidebar_label: "InitPlugin"
sidebar_position: 0
custom_edit_url: null
---
## Type parameters
| Name | Type |
| :------ | :------ |
| `Args` | extends `any`[] = `any`[] |
## Properties
### execute
**execute**: (...`args`: `Args`) => [`PluginResult`](../modules.md#pluginresult)
#### Type declaration
▸ (`...args`): [`PluginResult`](../modules.md#pluginresult)
##### Parameters
| Name | Type |
| :------ | :------ |
| `...args` | `Args` |
##### Returns
[`PluginResult`](../modules.md#pluginresult)
#### Defined in
[src/types/core-plugin.ts:69](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-plugin.ts#L69)
___
### type
**type**: [`Init`](../enums/PluginType.md#init)
#### Defined in
[src/types/core-plugin.ts:68](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-plugin.ts#L68)

View File

@@ -0,0 +1,101 @@
---
id: "Logging"
title: "Interface: Logging<T>"
sidebar_label: "Logging"
sidebar_position: 0
custom_edit_url: null
---
**`Since`**
2.0.0
## Type parameters
| Name | Type |
| :------ | :------ |
| `T` | `unknown` |
## Implemented by
- [`DefaultLogging`](../classes/DefaultLogging.md)
## Methods
### debug
**debug**(`payload`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `payload` | [`LogPayload`](../modules.md#logpayload)<`T`\> |
#### Returns
`void`
#### Defined in
[src/core/contracts/logging.ts:8](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/contracts/logging.ts#L8)
___
### error
**error**(`payload`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `payload` | [`LogPayload`](../modules.md#logpayload)<`T`\> |
#### Returns
`void`
#### Defined in
[src/core/contracts/logging.ts:5](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/contracts/logging.ts#L5)
___
### info
**info**(`payload`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `payload` | [`LogPayload`](../modules.md#logpayload)<`T`\> |
#### Returns
`void`
#### Defined in
[src/core/contracts/logging.ts:7](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/contracts/logging.ts#L7)
___
### warning
**warning**(`payload`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `payload` | [`LogPayload`](../modules.md#logpayload)<`T`\> |
#### Returns
`void`
#### Defined in
[src/core/contracts/logging.ts:6](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/contracts/logging.ts#L6)

View File

@@ -1,102 +1,111 @@
---
editUrl: false
next: false
prev: false
title: "MentionableSelectCommand"
id: "MentionableSelectCommand"
title: "Interface: MentionableSelectCommand"
sidebar_label: "MentionableSelectCommand"
sidebar_position: 0
custom_edit_url: null
---
## Extends
## Hierarchy
- `Module`
**`MentionableSelectCommand`**
## Properties
### description?
### description
> `optional` **description**: `string`
`Optional` **description**: `string`
#### Inherited from
`Module.description`
Module.description
#### Source
#### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L36)
***
___
### execute()
### execute
> **execute**: (`ctx`) => `unknown`
**execute**: (`ctx`: `MentionableSelectMenuInteraction`<`CacheType`\>) => `unknown`
#### Parameters
#### Type declaration
**ctx**: `MentionableSelectMenuInteraction`\<`CacheType`\>
▸ (`ctx`): `unknown`
#### Returns
##### Parameters
| Name | Type |
| :------ | :------ |
| `ctx` | `MentionableSelectMenuInteraction`<`CacheType`\> |
##### Returns
`unknown`
#### Overrides
`Module.execute`
Module.execute
#### Source
#### Defined in
[src/types/core-modules.ts:85](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L85)
***
___
### name?
### name
> `optional` **name**: `string`
`Optional` **name**: `string`
#### Inherited from
`Module.name`
Module.name
#### Source
#### Defined in
[src/types/core-modules.ts:33](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L33)
***
___
### onEvent
> **onEvent**: [`ControlPlugin`](/api/interfaces/controlplugin/)\<`any`[]\>[]
**onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.onEvent`
Module.onEvent
#### Source
#### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L34)
***
___
### plugins
> **plugins**: [`InitPlugin`](/api/interfaces/initplugin/)\<`any`[]\>[]
**plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.plugins`
Module.plugins
#### Source
#### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L35)
***
___
### type
> **type**: [`MentionableSelect`](/api/enumerations/commandtype/#mentionableselect)
**type**: [`MentionableSelect`](../enums/CommandType.md#mentionableselect)
#### Overrides
`Module.type`
Module.type
#### Source
#### Defined in
[src/types/core-modules.ts:84](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L84)

View File

@@ -1,102 +1,111 @@
---
editUrl: false
next: false
prev: false
title: "ModalSubmitCommand"
id: "ModalSubmitCommand"
title: "Interface: ModalSubmitCommand"
sidebar_label: "ModalSubmitCommand"
sidebar_position: 0
custom_edit_url: null
---
## Extends
## Hierarchy
- `Module`
**`ModalSubmitCommand`**
## Properties
### description?
### description
> `optional` **description**: `string`
`Optional` **description**: `string`
#### Inherited from
`Module.description`
Module.description
#### Source
#### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L36)
***
___
### execute()
### execute
> **execute**: (`ctx`) => `unknown`
**execute**: (`ctx`: `ModalSubmitInteraction`<`CacheType`\>) => `unknown`
#### Parameters
#### Type declaration
**ctx**: `ModalSubmitInteraction`\<`CacheType`\>
▸ (`ctx`): `unknown`
#### Returns
##### Parameters
| Name | Type |
| :------ | :------ |
| `ctx` | `ModalSubmitInteraction`<`CacheType`\> |
##### Returns
`unknown`
#### Overrides
`Module.execute`
Module.execute
#### Source
#### Defined in
[src/types/core-modules.ts:95](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L95)
***
___
### name?
### name
> `optional` **name**: `string`
`Optional` **name**: `string`
#### Inherited from
`Module.name`
Module.name
#### Source
#### Defined in
[src/types/core-modules.ts:33](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L33)
***
___
### onEvent
> **onEvent**: [`ControlPlugin`](/api/interfaces/controlplugin/)\<`any`[]\>[]
**onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.onEvent`
Module.onEvent
#### Source
#### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L34)
***
___
### plugins
> **plugins**: [`InitPlugin`](/api/interfaces/initplugin/)\<`any`[]\>[]
**plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.plugins`
Module.plugins
#### Source
#### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L35)
***
___
### type
> **type**: [`Modal`](/api/enumerations/commandtype/#modal)
**type**: [`Modal`](../enums/CommandType.md#modal)
#### Overrides
`Module.type`
Module.type
#### Source
#### Defined in
[src/types/core-modules.ts:94](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L94)

View File

@@ -0,0 +1,115 @@
---
id: "Module"
title: "Interface: Module"
sidebar_label: "Module"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- **`Module`**
↳ [`TextCommand`](TextCommand.md)
↳ [`SlashCommand`](SlashCommand.md)
↳ [`BothCommand`](BothCommand.md)
↳ [`ContextMenuUser`](ContextMenuUser.md)
↳ [`ContextMenuMsg`](ContextMenuMsg.md)
↳ [`ButtonCommand`](ButtonCommand.md)
↳ [`StringSelectCommand`](StringSelectCommand.md)
↳ [`ChannelSelectCommand`](ChannelSelectCommand.md)
↳ [`RoleSelectCommand`](RoleSelectCommand.md)
↳ [`MentionableSelectCommand`](MentionableSelectCommand.md)
↳ [`UserSelectCommand`](UserSelectCommand.md)
↳ [`ModalSubmitCommand`](ModalSubmitCommand.md)
↳ [`SernEventCommand`](SernEventCommand.md)
↳ [`DiscordEventCommand`](DiscordEventCommand.md)
↳ [`ExternalEventCommand`](ExternalEventCommand.md)
## Properties
### description
`Optional` **description**: `string`
#### Defined in
[src/types/module.ts:38](https://github.com/sern-handler/handler/blob/c1f6906/src/types/module.ts#L38)
___
### execute
**execute**: (...`args`: `any`[]) => `any`
#### Type declaration
▸ (...`args`): `any`
##### Parameters
| Name | Type |
| :------ | :------ |
| `...args` | `any`[] |
##### Returns
`any`
#### Defined in
[src/types/module.ts:39](https://github.com/sern-handler/handler/blob/c1f6906/src/types/module.ts#L39)
___
### name
`Optional` **name**: `string`
#### Defined in
[src/types/module.ts:35](https://github.com/sern-handler/handler/blob/c1f6906/src/types/module.ts#L35)
___
### onEvent
**onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
#### Defined in
[src/types/module.ts:36](https://github.com/sern-handler/handler/blob/c1f6906/src/types/module.ts#L36)
___
### plugins
**plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
#### Defined in
[src/types/module.ts:37](https://github.com/sern-handler/handler/blob/c1f6906/src/types/module.ts#L37)
___
### type
**type**: [`CommandType`](../enums/CommandType.md) \| [`EventType`](../enums/EventType.md)
#### Defined in
[src/types/module.ts:34](https://github.com/sern-handler/handler/blob/c1f6906/src/types/module.ts#L34)

View File

@@ -0,0 +1,155 @@
---
id: "ModuleManager"
title: "Interface: ModuleManager"
sidebar_label: "ModuleManager"
sidebar_position: 0
custom_edit_url: null
---
**`Since`**
2.0.0
- direct access to the module manager will be removed in version 4
## Hierarchy
- `MetadataAccess`
**`ModuleManager`**
## Implemented by
- [`DefaultModuleManager`](../classes/DefaultModuleManager.md)
## Methods
### get
**get**(`id`): `undefined` \| `Module`
#### Parameters
| Name | Type |
| :------ | :------ |
| `id` | `string` |
#### Returns
`undefined` \| `Module`
#### Defined in
[src/core/contracts/module-manager.ts:19](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/contracts/module-manager.ts#L19)
___
### getByNameCommandType
**getByNameCommandType**<`T`\>(`name`, `commandType`): `undefined` \| [`CommandModuleDefs`](CommandModuleDefs.md)[`T`]
#### Type parameters
| Name | Type |
| :------ | :------ |
| `T` | extends [`CommandType`](../enums/CommandType.md) |
#### Parameters
| Name | Type |
| :------ | :------ |
| `name` | `string` |
| `commandType` | `T` |
#### Returns
`undefined` \| [`CommandModuleDefs`](CommandModuleDefs.md)[`T`]
#### Defined in
[src/core/contracts/module-manager.ts:30](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/contracts/module-manager.ts#L30)
___
### getMetadata
**getMetadata**(`m`): `undefined` \| `CommandMeta`
#### Parameters
| Name | Type |
| :------ | :------ |
| `m` | `Module` |
#### Returns
`undefined` \| `CommandMeta`
#### Inherited from
MetadataAccess.getMetadata
#### Defined in
[src/core/contracts/module-manager.ts:10](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/contracts/module-manager.ts#L10)
___
### getPublishableCommands
**getPublishableCommands**(): [`CommandModule`](../modules.md#commandmodule)[]
#### Returns
[`CommandModule`](../modules.md#commandmodule)[]
**`Deprecated`**
#### Defined in
[src/core/contracts/module-manager.ts:25](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/contracts/module-manager.ts#L25)
___
### set
**set**(`id`, `path`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `id` | `string` |
| `path` | `Module` |
#### Returns
`void`
#### Defined in
[src/core/contracts/module-manager.ts:21](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/contracts/module-manager.ts#L21)
___
### setMetadata
**setMetadata**(`m`, `c`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `m` | `Module` |
| `c` | `CommandMeta` |
#### Returns
`void`
#### Inherited from
MetadataAccess.setMetadata
#### Defined in
[src/core/contracts/module-manager.ts:11](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/contracts/module-manager.ts#L11)

View File

@@ -0,0 +1,47 @@
---
id: "Plugin"
title: "Interface: Plugin<Args>"
sidebar_label: "Plugin"
sidebar_position: 0
custom_edit_url: null
---
## Type parameters
| Name | Type |
| :------ | :------ |
| `Args` | extends `any`[] = `any`[] |
## Properties
### execute
**execute**: (...`args`: `Args`) => [`PluginResult`](../modules.md#pluginresult)
#### Type declaration
▸ (`...args`): [`PluginResult`](../modules.md#pluginresult)
##### Parameters
| Name | Type |
| :------ | :------ |
| `...args` | `Args` |
##### Returns
[`PluginResult`](../modules.md#pluginresult)
#### Defined in
[src/types/core-plugin.ts:64](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-plugin.ts#L64)
___
### type
**type**: [`PluginType`](../enums/PluginType.md)
#### Defined in
[src/types/core-plugin.ts:63](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-plugin.ts#L63)

View File

@@ -1,74 +1,82 @@
---
editUrl: false
next: false
prev: false
title: "Result"
id: "Presence.Result"
title: "Interface: Result"
sidebar_label: "Result"
custom_edit_url: null
---
[Presence](../namespaces/Presence.md).Result
## Properties
### activities?
### activities
> `optional` **activities**: `ActivitiesOptions`[]
`Optional` **activities**: `ActivitiesOptions`[]
#### Source
#### Defined in
[src/core/presences.ts:11](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/presences.ts#L11)
***
___
### afk?
### afk
> `optional` **afk**: `boolean`
`Optional` **afk**: `boolean`
#### Source
#### Defined in
[src/core/presences.ts:10](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/presences.ts#L10)
***
___
### onRepeat()?
### onRepeat
> `optional` **onRepeat**: (`previous`) => [`Result`](/api/namespaces/presence/interfaces/result/)
`Optional` **onRepeat**: (`previous`: [`Result`](Presence.Result.md)) => [`Result`](Presence.Result.md)
#### Parameters
#### Type declaration
**previous**: [`Result`](/api/namespaces/presence/interfaces/result/)
▸ (`previous`): [`Result`](Presence.Result.md)
#### Returns
##### Parameters
[`Result`](/api/namespaces/presence/interfaces/result/)
| Name | Type |
| :------ | :------ |
| `previous` | [`Result`](Presence.Result.md) |
#### Source
##### Returns
[`Result`](Presence.Result.md)
#### Defined in
[src/core/presences.ts:14](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/presences.ts#L14)
***
___
### repeat?
### repeat
> `optional` **repeat**: `number` \| [[`Emitter`](/api/interfaces/emitter/), `string`]
`Optional` **repeat**: `number` \| [[`Emitter`](Emitter.md), `string`]
#### Source
#### Defined in
[src/core/presences.ts:13](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/presences.ts#L13)
***
___
### shardId?
### shardId
> `optional` **shardId**: `number`[]
`Optional` **shardId**: `number`[]
#### Source
#### Defined in
[src/core/presences.ts:12](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/presences.ts#L12)
***
___
### status?
### status
> `optional` **status**: `Status`
`Optional` **status**: `Status`
#### Source
#### Defined in
[src/core/presences.ts:9](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/presences.ts#L9)

View File

@@ -1,102 +1,111 @@
---
editUrl: false
next: false
prev: false
title: "RoleSelectCommand"
id: "RoleSelectCommand"
title: "Interface: RoleSelectCommand"
sidebar_label: "RoleSelectCommand"
sidebar_position: 0
custom_edit_url: null
---
## Extends
## Hierarchy
- `Module`
**`RoleSelectCommand`**
## Properties
### description?
### description
> `optional` **description**: `string`
`Optional` **description**: `string`
#### Inherited from
`Module.description`
Module.description
#### Source
#### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L36)
***
___
### execute()
### execute
> **execute**: (`ctx`) => `unknown`
**execute**: (`ctx`: `RoleSelectMenuInteraction`<`CacheType`\>) => `unknown`
#### Parameters
#### Type declaration
**ctx**: `RoleSelectMenuInteraction`\<`CacheType`\>
▸ (`ctx`): `unknown`
#### Returns
##### Parameters
| Name | Type |
| :------ | :------ |
| `ctx` | `RoleSelectMenuInteraction`<`CacheType`\> |
##### Returns
`unknown`
#### Overrides
`Module.execute`
Module.execute
#### Source
#### Defined in
[src/types/core-modules.ts:80](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L80)
***
___
### name?
### name
> `optional` **name**: `string`
`Optional` **name**: `string`
#### Inherited from
`Module.name`
Module.name
#### Source
#### Defined in
[src/types/core-modules.ts:33](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L33)
***
___
### onEvent
> **onEvent**: [`ControlPlugin`](/api/interfaces/controlplugin/)\<`any`[]\>[]
**onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.onEvent`
Module.onEvent
#### Source
#### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L34)
***
___
### plugins
> **plugins**: [`InitPlugin`](/api/interfaces/initplugin/)\<`any`[]\>[]
**plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.plugins`
Module.plugins
#### Source
#### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L35)
***
___
### type
> **type**: [`RoleSelect`](/api/enumerations/commandtype/#roleselect)
**type**: [`RoleSelect`](../enums/CommandType.md#roleselect)
#### Overrides
`Module.type`
Module.type
#### Source
#### Defined in
[src/types/core-modules.ts:79](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L79)

View File

@@ -0,0 +1,113 @@
---
id: "SernAutocompleteData"
title: "Interface: SernAutocompleteData"
sidebar_label: "SernAutocompleteData"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- `Omit`<`BaseApplicationCommandOptionsData`, ``"autocomplete"``\>
**`SernAutocompleteData`**
## Properties
### autocomplete
**autocomplete**: ``true``
#### Defined in
[src/types/core-modules.ts:172](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L172)
___
### command
• **command**: `AutocompleteCommand`
#### Defined in
[src/types/core-modules.ts:177](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L177)
___
### description
• **description**: `string`
#### Inherited from
Omit.description
#### Defined in
node_modules/discord.js/typings/index.d.ts:4493
___
### descriptionLocalizations
• `Optional` **descriptionLocalizations**: `Partial`<`Record`<``"id"`` \| ``"en-US"`` \| ``"en-GB"`` \| ``"bg"`` \| ``"zh-CN"`` \| ``"zh-TW"`` \| ``"hr"`` \| ``"cs"`` \| ``"da"`` \| ``"nl"`` \| ``"fi"`` \| ``"fr"`` \| ``"de"`` \| ``"el"`` \| ``"hi"`` \| ``"hu"`` \| ``"it"`` \| ``"ja"`` \| ``"ko"`` \| ``"lt"`` \| ``"no"`` \| ``"pl"`` \| ``"pt-BR"`` \| ``"ro"`` \| ``"ru"`` \| ``"es-ES"`` \| ``"sv-SE"`` \| ``"th"`` \| ``"tr"`` \| ``"uk"`` \| ``"vi"``, ``null`` \| `string`\>\>
#### Inherited from
Omit.descriptionLocalizations
#### Defined in
node_modules/discord.js/typings/index.d.ts:4494
___
### name
• **name**: `string`
#### Inherited from
Omit.name
#### Defined in
node_modules/discord.js/typings/index.d.ts:4491
___
### nameLocalizations
• `Optional` **nameLocalizations**: `Partial`<`Record`<``"id"`` \| ``"en-US"`` \| ``"en-GB"`` \| ``"bg"`` \| ``"zh-CN"`` \| ``"zh-TW"`` \| ``"hr"`` \| ``"cs"`` \| ``"da"`` \| ``"nl"`` \| ``"fi"`` \| ``"fr"`` \| ``"de"`` \| ``"el"`` \| ``"hi"`` \| ``"hu"`` \| ``"it"`` \| ``"ja"`` \| ``"ko"`` \| ``"lt"`` \| ``"no"`` \| ``"pl"`` \| ``"pt-BR"`` \| ``"ro"`` \| ``"ru"`` \| ``"es-ES"`` \| ``"sv-SE"`` \| ``"th"`` \| ``"tr"`` \| ``"uk"`` \| ``"vi"``, ``null`` \| `string`\>\>
#### Inherited from
Omit.nameLocalizations
#### Defined in
node_modules/discord.js/typings/index.d.ts:4492
___
### required
• `Optional` **required**: `boolean`
#### Inherited from
Omit.required
#### Defined in
node_modules/discord.js/typings/index.d.ts:4495
___
### type
• **type**: `String` \| `Integer` \| `Number`
#### Defined in
[src/types/core-modules.ts:173](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L173)

View File

@@ -0,0 +1,90 @@
---
id: "SernEmitterPlugin"
title: "Interface: SernEmitterPlugin"
sidebar_label: "SernEmitterPlugin"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- [`Plugin`](Plugin.md)
**`SernEmitterPlugin`**
## Properties
### description
`Optional` **description**: `string`
**`Deprecated`**
will be removed in the next update
#### Inherited from
[Plugin](Plugin.md).[description](Plugin.md#description)
#### Defined in
[src/handler/plugins/plugin.ts:33](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L33)
___
### execute
**execute**: (`payload`: { `absPath`: `string` ; `mod`: `SernEventCommand`<keyof [`SernEventsMapping`](../modules.md#serneventsmapping)\> & { `name`: `string` } }, `controller`: [`Controller`](Controller.md)) => `Awaitable`<`Result`<`void`, `void`\>\>
#### Type declaration
▸ (`payload`, `controller`): `Awaitable`<`Result`<`void`, `void`\>\>
##### Parameters
| Name | Type |
| :------ | :------ |
| `payload` | `Object` |
| `payload.absPath` | `string` |
| `payload.mod` | `SernEventCommand`<keyof [`SernEventsMapping`](../modules.md#serneventsmapping)\> & { `name`: `string` } |
| `controller` | [`Controller`](Controller.md) |
##### Returns
`Awaitable`<`Result`<`void`, `void`\>\>
#### Defined in
[src/handler/plugins/plugin.ts:65](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L65)
___
### name
`Optional` **name**: `string`
**`Deprecated`**
will be removed in the next update
#### Inherited from
[Plugin](Plugin.md).[name](Plugin.md#name)
#### Defined in
[src/handler/plugins/plugin.ts:31](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L31)
___
### type
**type**: [`Command`](../enums/PluginType.md#command)
#### Overrides
[Plugin](Plugin.md).[type](Plugin.md#type)
#### Defined in
[src/handler/plugins/plugin.ts:64](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L64)

View File

@@ -1,97 +1,104 @@
---
editUrl: false
next: false
prev: false
title: "SernEventCommand"
id: "SernEventCommand"
title: "Interface: SernEventCommand<T>"
sidebar_label: "SernEventCommand"
sidebar_position: 0
custom_edit_url: null
---
## Extends
- `Module`
## Type parameters
**T** *extends* keyof [`SernEventsMapping`](/api/interfaces/serneventsmapping/) = keyof [`SernEventsMapping`](/api/interfaces/serneventsmapping/)
| Name | Type |
| :------ | :------ |
| `T` | extends keyof [`SernEventsMapping`](SernEventsMapping.md) = keyof [`SernEventsMapping`](SernEventsMapping.md) |
## Hierarchy
- `Module`
**`SernEventCommand`**
## Properties
### description?
### description
> `optional` **description**: `string`
`Optional` **description**: `string`
#### Inherited from
`Module.description`
Module.description
#### Source
#### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L36)
***
___
### name?
### name
> `optional` **name**: `T`
`Optional` **name**: `T`
#### Overrides
`Module.name`
Module.name
#### Source
#### Defined in
[src/types/core-modules.ts:42](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L42)
***
___
### onEvent
> **onEvent**: [`ControlPlugin`](/api/interfaces/controlplugin/)\<`any`[]\>[]
**onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.onEvent`
Module.onEvent
#### Source
#### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L34)
***
___
### plugins
> **plugins**: [`InitPlugin`](/api/interfaces/initplugin/)\<`any`[]\>[]
**plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.plugins`
Module.plugins
#### Source
#### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L35)
***
___
### type
> **type**: [`Sern`](/api/enumerations/eventtype/#sern)
**type**: [`Sern`](../enums/EventType.md#sern)
#### Overrides
`Module.type`
Module.type
#### Source
#### Defined in
[src/types/core-modules.ts:43](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L43)
## Methods
### execute()
### execute
> **execute**(...`args`): `unknown`
**execute**(`...args`): `unknown`
#### Parameters
• ...**args**: [`SernEventsMapping`](/api/interfaces/serneventsmapping/)\[`T`\]
| Name | Type |
| :------ | :------ |
| `...args` | [`SernEventsMapping`](SernEventsMapping.md)[`T`] |
#### Returns
@@ -99,8 +106,8 @@ title: "SernEventCommand"
#### Overrides
`Module.execute`
Module.execute
#### Source
#### Defined in
[src/types/core-modules.ts:44](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L44)

View File

@@ -0,0 +1,94 @@
---
id: "SernEventPlugin"
title: "Interface: SernEventPlugin<T>"
sidebar_label: "SernEventPlugin"
sidebar_position: 0
custom_edit_url: null
---
## Type parameters
| Name | Type |
| :------ | :------ |
| `T` | extends keyof [`SernEventsMapping`](../modules.md#serneventsmapping) = keyof [`SernEventsMapping`](../modules.md#serneventsmapping) |
## Hierarchy
- [`Plugin`](Plugin.md)
**`SernEventPlugin`**
## Properties
### description
`Optional` **description**: `string`
**`Deprecated`**
will be removed in the next update
#### Inherited from
[Plugin](Plugin.md).[description](Plugin.md#description)
#### Defined in
[src/handler/plugins/plugin.ts:33](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L33)
___
### execute
**execute**: (`args`: [`SernEventsMapping`](../modules.md#serneventsmapping)[`T`], `controller`: [`Controller`](Controller.md)) => `Awaitable`<`Result`<`void`, `void`\>\>
#### Type declaration
▸ (`args`, `controller`): `Awaitable`<`Result`<`void`, `void`\>\>
##### Parameters
| Name | Type |
| :------ | :------ |
| `args` | [`SernEventsMapping`](../modules.md#serneventsmapping)[`T`] |
| `controller` | [`Controller`](Controller.md) |
##### Returns
`Awaitable`<`Result`<`void`, `void`\>\>
#### Defined in
[src/handler/plugins/plugin.ts:91](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L91)
___
### name
`Optional` **name**: `T`
**`Deprecated`**
will be removed in the next update
#### Overrides
[Plugin](Plugin.md).[name](Plugin.md#name)
#### Defined in
[src/handler/plugins/plugin.ts:89](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L89)
___
### type
**type**: [`Event`](../enums/PluginType.md#event)
#### Overrides
[Plugin](Plugin.md).[type](Plugin.md#type)
#### Defined in
[src/handler/plugins/plugin.ts:90](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L90)

View File

@@ -1,56 +1,57 @@
---
editUrl: false
next: false
prev: false
title: "SernEventsMapping"
id: "SernEventsMapping"
title: "Interface: SernEventsMapping"
sidebar_label: "SernEventsMapping"
sidebar_position: 0
custom_edit_url: null
---
## Properties
### error
> **error**: [`object`]
**error**: [\{ `module?`: `AnyModule` ; `reason`: `string` \| `Error` ; `type`: [`Failure`](../enums/PayloadType.md#failure) }]
#### Source
#### Defined in
[src/types/utility.ts:21](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/utility.ts#L21)
***
___
### module.activate
> **module.activate**: [[`Payload`](/api/type-aliases/payload/)]
**module.activate**: [[`Payload`](../modules.md#payload)]
#### Source
#### Defined in
[src/types/utility.ts:20](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/utility.ts#L20)
***
___
### module.register
> **module.register**: [[`Payload`](/api/type-aliases/payload/)]
**module.register**: [[`Payload`](../modules.md#payload)]
#### Source
#### Defined in
[src/types/utility.ts:19](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/utility.ts#L19)
***
___
### modulesLoaded
> **modulesLoaded**: [`undefined?`]
**modulesLoaded**: [undefined?]
#### Source
#### Defined in
[src/types/utility.ts:23](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/utility.ts#L23)
***
___
### warning
> **warning**: [[`Payload`](/api/type-aliases/payload/)]
**warning**: [[`Payload`](../modules.md#payload)]
#### Source
#### Defined in
[src/types/utility.ts:22](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/utility.ts#L22)

View File

@@ -0,0 +1,107 @@
---
id: "SernSubCommandData"
title: "Interface: SernSubCommandData"
sidebar_label: "SernSubCommandData"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- `APIApplicationCommandOptionBase`<`ApplicationCommandOptionType.Subcommand`\>
**`SernSubCommandData`**
## Properties
### description
**description**: `string`
#### Inherited from
APIApplicationCommandOptionBase.description
#### Defined in
node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.d.ts:7
___
### description\_localizations
`Optional` **description\_localizations**: ``null`` \| `Partial`<`Record`<``"id"`` \| ``"en-US"`` \| ``"en-GB"`` \| ``"bg"`` \| ``"zh-CN"`` \| ``"zh-TW"`` \| ``"hr"`` \| ``"cs"`` \| ``"da"`` \| ``"nl"`` \| ``"fi"`` \| ``"fr"`` \| ``"de"`` \| ``"el"`` \| ``"hi"`` \| ``"hu"`` \| ``"it"`` \| ``"ja"`` \| ``"ko"`` \| ``"lt"`` \| ``"no"`` \| ``"pl"`` \| ``"pt-BR"`` \| ``"ro"`` \| ``"ru"`` \| ``"es-ES"`` \| ``"sv-SE"`` \| ``"th"`` \| ``"tr"`` \| ``"uk"`` \| ``"vi"``, ``null`` \| `string`\>\>
#### Inherited from
APIApplicationCommandOptionBase.description\_localizations
#### Defined in
node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.d.ts:8
___
### name
• **name**: `string`
#### Inherited from
APIApplicationCommandOptionBase.name
#### Defined in
node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.d.ts:5
___
### name\_localizations
• `Optional` **name\_localizations**: ``null`` \| `Partial`<`Record`<``"id"`` \| ``"en-US"`` \| ``"en-GB"`` \| ``"bg"`` \| ``"zh-CN"`` \| ``"zh-TW"`` \| ``"hr"`` \| ``"cs"`` \| ``"da"`` \| ``"nl"`` \| ``"fi"`` \| ``"fr"`` \| ``"de"`` \| ``"el"`` \| ``"hi"`` \| ``"hu"`` \| ``"it"`` \| ``"ja"`` \| ``"ko"`` \| ``"lt"`` \| ``"no"`` \| ``"pl"`` \| ``"pt-BR"`` \| ``"ro"`` \| ``"ru"`` \| ``"es-ES"`` \| ``"sv-SE"`` \| ``"th"`` \| ``"tr"`` \| ``"uk"`` \| ``"vi"``, ``null`` \| `string`\>\>
#### Inherited from
APIApplicationCommandOptionBase.name\_localizations
#### Defined in
node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.d.ts:6
___
### options
• `Optional` **options**: [`SernOptionsData`](../modules.md#sernoptionsdata)[]
#### Defined in
[src/types/core-modules.ts:209](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L209)
___
### required
• `Optional` **required**: `boolean`
#### Inherited from
APIApplicationCommandOptionBase.required
#### Defined in
node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.d.ts:9
___
### type
• **type**: `Subcommand`
#### Overrides
APIApplicationCommandOptionBase.type
#### Defined in
[src/types/core-modules.ts:208](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L208)

View File

@@ -0,0 +1,117 @@
---
id: "SernSubCommandGroupData"
title: "Interface: SernSubCommandGroupData"
sidebar_label: "SernSubCommandGroupData"
sidebar_position: 0
custom_edit_url: null
---
## Hierarchy
- `BaseApplicationCommandOptionsData`
**`SernSubCommandGroupData`**
## Properties
### autocomplete
`Optional` **autocomplete**: `undefined`
#### Inherited from
BaseApplicationCommandOptionsData.autocomplete
#### Defined in
node_modules/discord.js/typings/index.d.ts:4496
___
### description
**description**: `string`
#### Inherited from
BaseApplicationCommandOptionsData.description
#### Defined in
node_modules/discord.js/typings/index.d.ts:4493
___
### descriptionLocalizations
`Optional` **descriptionLocalizations**: `Partial`<`Record`<``"id"`` \| ``"en-US"`` \| ``"en-GB"`` \| ``"bg"`` \| ``"zh-CN"`` \| ``"zh-TW"`` \| ``"hr"`` \| ``"cs"`` \| ``"da"`` \| ``"nl"`` \| ``"fi"`` \| ``"fr"`` \| ``"de"`` \| ``"el"`` \| ``"hi"`` \| ``"hu"`` \| ``"it"`` \| ``"ja"`` \| ``"ko"`` \| ``"lt"`` \| ``"no"`` \| ``"pl"`` \| ``"pt-BR"`` \| ``"ro"`` \| ``"ru"`` \| ``"es-ES"`` \| ``"sv-SE"`` \| ``"th"`` \| ``"tr"`` \| ``"uk"`` \| ``"vi"``, ``null`` \| `string`\>\>
#### Inherited from
BaseApplicationCommandOptionsData.descriptionLocalizations
#### Defined in
node_modules/discord.js/typings/index.d.ts:4494
___
### name
• **name**: `string`
#### Inherited from
BaseApplicationCommandOptionsData.name
#### Defined in
node_modules/discord.js/typings/index.d.ts:4491
___
### nameLocalizations
• `Optional` **nameLocalizations**: `Partial`<`Record`<``"id"`` \| ``"en-US"`` \| ``"en-GB"`` \| ``"bg"`` \| ``"zh-CN"`` \| ``"zh-TW"`` \| ``"hr"`` \| ``"cs"`` \| ``"da"`` \| ``"nl"`` \| ``"fi"`` \| ``"fr"`` \| ``"de"`` \| ``"el"`` \| ``"hi"`` \| ``"hu"`` \| ``"it"`` \| ``"ja"`` \| ``"ko"`` \| ``"lt"`` \| ``"no"`` \| ``"pl"`` \| ``"pt-BR"`` \| ``"ro"`` \| ``"ru"`` \| ``"es-ES"`` \| ``"sv-SE"`` \| ``"th"`` \| ``"tr"`` \| ``"uk"`` \| ``"vi"``, ``null`` \| `string`\>\>
#### Inherited from
BaseApplicationCommandOptionsData.nameLocalizations
#### Defined in
node_modules/discord.js/typings/index.d.ts:4492
___
### options
• `Optional` **options**: [`SernSubCommandData`](SernSubCommandData.md)[]
#### Defined in
[src/types/core-modules.ts:214](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L214)
___
### required
• `Optional` **required**: `boolean`
#### Inherited from
BaseApplicationCommandOptionsData.required
#### Defined in
node_modules/discord.js/typings/index.d.ts:4495
___
### type
• **type**: `SubcommandGroup`
#### Defined in
[src/types/core-modules.ts:213](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L213)

View File

@@ -1,114 +1,122 @@
---
editUrl: false
next: false
prev: false
title: "SlashCommand"
id: "SlashCommand"
title: "Interface: SlashCommand"
sidebar_label: "SlashCommand"
sidebar_position: 0
custom_edit_url: null
---
## Extends
## Hierarchy
- `Module`
**`SlashCommand`**
## Properties
### description
> **description**: `string`
**description**: `string`
#### Overrides
`Module.description`
Module.description
#### Source
#### Defined in
[src/types/core-modules.ts:118](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L118)
***
___
### execute()
### execute
> **execute**: (`ctx`, `args`) => `unknown`
**execute**: (`ctx`: [`Context`](../classes/Context.md), `args`: [``"slash"``, [`SlashOptions`](../modules.md#slashoptions)]) => `unknown`
#### Parameters
#### Type declaration
**ctx**: [`Context`](/api/classes/context/)
▸ (`ctx`, `args`): `unknown`
**args**: [`"slash"`, [`SlashOptions`](/api/type-aliases/slashoptions/)]
##### Parameters
#### Returns
| Name | Type |
| :------ | :------ |
| `ctx` | [`Context`](../classes/Context.md) |
| `args` | [``"slash"``, [`SlashOptions`](../modules.md#slashoptions)] |
##### Returns
`unknown`
#### Overrides
`Module.execute`
Module.execute
#### Source
#### Defined in
[src/types/core-modules.ts:120](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L120)
***
___
### name?
### name
> `optional` **name**: `string`
`Optional` **name**: `string`
#### Inherited from
`Module.name`
Module.name
#### Source
#### Defined in
[src/types/core-modules.ts:33](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L33)
***
___
### onEvent
> **onEvent**: [`ControlPlugin`](/api/interfaces/controlplugin/)\<`any`[]\>[]
**onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.onEvent`
Module.onEvent
#### Source
#### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L34)
***
___
### options?
### options
> `optional` **options**: [`SernOptionsData`](/api/type-aliases/sernoptionsdata/)[]
`Optional` **options**: [`SernOptionsData`](../modules.md#sernoptionsdata)[]
#### Source
#### Defined in
[src/types/core-modules.ts:119](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L119)
***
___
### plugins
> **plugins**: [`InitPlugin`](/api/interfaces/initplugin/)\<`any`[]\>[]
**plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.plugins`
Module.plugins
#### Source
#### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L35)
***
___
### type
> **type**: [`Slash`](/api/enumerations/commandtype/#slash)
**type**: [`Slash`](../enums/CommandType.md#slash)
#### Overrides
`Module.type`
Module.type
#### Source
#### Defined in
[src/types/core-modules.ts:117](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L117)

View File

@@ -1,102 +1,111 @@
---
editUrl: false
next: false
prev: false
title: "StringSelectCommand"
id: "StringSelectCommand"
title: "Interface: StringSelectCommand"
sidebar_label: "StringSelectCommand"
sidebar_position: 0
custom_edit_url: null
---
## Extends
## Hierarchy
- `Module`
**`StringSelectCommand`**
## Properties
### description?
### description
> `optional` **description**: `string`
`Optional` **description**: `string`
#### Inherited from
`Module.description`
Module.description
#### Source
#### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L36)
***
___
### execute()
### execute
> **execute**: (`ctx`) => `unknown`
**execute**: (`ctx`: `StringSelectMenuInteraction`<`CacheType`\>) => `unknown`
#### Parameters
#### Type declaration
**ctx**: `StringSelectMenuInteraction`\<`CacheType`\>
▸ (`ctx`): `unknown`
#### Returns
##### Parameters
| Name | Type |
| :------ | :------ |
| `ctx` | `StringSelectMenuInteraction`<`CacheType`\> |
##### Returns
`unknown`
#### Overrides
`Module.execute`
Module.execute
#### Source
#### Defined in
[src/types/core-modules.ts:70](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L70)
***
___
### name?
### name
> `optional` **name**: `string`
`Optional` **name**: `string`
#### Inherited from
`Module.name`
Module.name
#### Source
#### Defined in
[src/types/core-modules.ts:33](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L33)
***
___
### onEvent
> **onEvent**: [`ControlPlugin`](/api/interfaces/controlplugin/)\<`any`[]\>[]
**onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.onEvent`
Module.onEvent
#### Source
#### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L34)
***
___
### plugins
> **plugins**: [`InitPlugin`](/api/interfaces/initplugin/)\<`any`[]\>[]
**plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.plugins`
Module.plugins
#### Source
#### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L35)
***
___
### type
> **type**: [`StringSelect`](/api/enumerations/commandtype/#stringselect)
**type**: [`StringSelect`](../enums/CommandType.md#stringselect)
#### Overrides
`Module.type`
Module.type
#### Source
#### Defined in
[src/types/core-modules.ts:69](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L69)

View File

@@ -1,114 +1,122 @@
---
editUrl: false
next: false
prev: false
title: "TextCommand"
id: "TextCommand"
title: "Interface: TextCommand"
sidebar_label: "TextCommand"
sidebar_position: 0
custom_edit_url: null
---
## Extends
## Hierarchy
- `Module`
**`TextCommand`**
## Properties
### alias?
### alias
> `optional` **alias**: `string`[]
`Optional` **alias**: `string`[]
#### Source
#### Defined in
[src/types/core-modules.ts:112](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L112)
***
___
### description?
### description
> `optional` **description**: `string`
`Optional` **description**: `string`
#### Inherited from
`Module.description`
Module.description
#### Source
#### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L36)
***
___
### execute()
### execute
> **execute**: (`ctx`, `args`) => `unknown`
**execute**: (`ctx`: [`Context`](../classes/Context.md), `args`: [``"text"``, `string`[]]) => `unknown`
#### Parameters
#### Type declaration
**ctx**: [`Context`](/api/classes/context/)
▸ (`ctx`, `args`): `unknown`
**args**: [`"text"`, `string`[]]
##### Parameters
#### Returns
| Name | Type |
| :------ | :------ |
| `ctx` | [`Context`](../classes/Context.md) |
| `args` | [``"text"``, `string`[]] |
##### Returns
`unknown`
#### Overrides
`Module.execute`
Module.execute
#### Source
#### Defined in
[src/types/core-modules.ts:113](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L113)
***
___
### name?
### name
> `optional` **name**: `string`
`Optional` **name**: `string`
#### Inherited from
`Module.name`
Module.name
#### Source
#### Defined in
[src/types/core-modules.ts:33](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L33)
***
___
### onEvent
> **onEvent**: [`ControlPlugin`](/api/interfaces/controlplugin/)\<`any`[]\>[]
**onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.onEvent`
Module.onEvent
#### Source
#### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L34)
***
___
### plugins
> **plugins**: [`InitPlugin`](/api/interfaces/initplugin/)\<`any`[]\>[]
**plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.plugins`
Module.plugins
#### Source
#### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L35)
***
___
### type
> **type**: [`Text`](/api/enumerations/commandtype/#text)
**type**: [`Text`](../enums/CommandType.md#text)
#### Overrides
`Module.type`
Module.type
#### Source
#### Defined in
[src/types/core-modules.ts:111](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L111)

View File

@@ -1,102 +1,111 @@
---
editUrl: false
next: false
prev: false
title: "UserSelectCommand"
id: "UserSelectCommand"
title: "Interface: UserSelectCommand"
sidebar_label: "UserSelectCommand"
sidebar_position: 0
custom_edit_url: null
---
## Extends
## Hierarchy
- `Module`
**`UserSelectCommand`**
## Properties
### description?
### description
> `optional` **description**: `string`
`Optional` **description**: `string`
#### Inherited from
`Module.description`
Module.description
#### Source
#### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L36)
***
___
### execute()
### execute
> **execute**: (`ctx`) => `unknown`
**execute**: (`ctx`: `UserSelectMenuInteraction`<`CacheType`\>) => `unknown`
#### Parameters
#### Type declaration
**ctx**: `UserSelectMenuInteraction`\<`CacheType`\>
▸ (`ctx`): `unknown`
#### Returns
##### Parameters
| Name | Type |
| :------ | :------ |
| `ctx` | `UserSelectMenuInteraction`<`CacheType`\> |
##### Returns
`unknown`
#### Overrides
`Module.execute`
Module.execute
#### Source
#### Defined in
[src/types/core-modules.ts:90](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L90)
***
___
### name?
### name
> `optional` **name**: `string`
`Optional` **name**: `string`
#### Inherited from
`Module.name`
Module.name
#### Source
#### Defined in
[src/types/core-modules.ts:33](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L33)
***
___
### onEvent
> **onEvent**: [`ControlPlugin`](/api/interfaces/controlplugin/)\<`any`[]\>[]
**onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.onEvent`
Module.onEvent
#### Source
#### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L34)
***
___
### plugins
> **plugins**: [`InitPlugin`](/api/interfaces/initplugin/)\<`any`[]\>[]
**plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
#### Inherited from
`Module.plugins`
Module.plugins
#### Source
#### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L35)
***
___
### type
> **type**: [`UserSelect`](/api/enumerations/commandtype/#userselect)
**type**: [`UserSelect`](../enums/CommandType.md#userselect)
#### Overrides
`Module.type`
Module.type
#### Source
#### Defined in
[src/types/core-modules.ts:89](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L89)

View File

@@ -1,74 +1,69 @@
---
editUrl: false
next: false
prev: false
title: "Wrapper"
id: "Wrapper"
title: "Interface: Wrapper"
sidebar_label: "Wrapper"
sidebar_position: 0
custom_edit_url: null
---
## Properties
### commands
> **commands**: `string`
**commands**: `string`
#### Source
#### Defined in
[src/types/core.ts:9](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core.ts#L9)
***
___
### containerConfig?
### containerConfig
> `optional` **containerConfig**: `object`
`Optional` **containerConfig**: `Object`
#### get()
#### Type declaration
> **get**: (...`keys`) => `unknown`[]
| Name | Type |
| :------ | :------ |
| `get` | (...`keys`: keyof `Dependencies`[]) => `unknown`[] |
##### Parameters
• ...**keys**: keyof `Dependencies`[]
##### Returns
`unknown`[]
#### Source
#### Defined in
[src/types/core.ts:20](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core.ts#L20)
***
___
### defaultPrefix?
### defaultPrefix
> `optional` **defaultPrefix**: `string`
`Optional` **defaultPrefix**: `string`
#### Source
#### Defined in
[src/types/core.ts:10](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core.ts#L10)
***
___
### events?
### events
> `optional` **events**: `string`
`Optional` **events**: `string`
#### Source
#### Defined in
[src/types/core.ts:11](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core.ts#L11)
***
___
### ~~mode?~~
### mode
> `optional` **mode**: `string`
`Optional` **mode**: `string`
Overload to enable mode in case developer does not use a .env file.
:::caution[Deprecated]
- https://github.com/sern-handler/handler/pull/325
:::
**`Deprecated`**
#### Source
- https://github.com/sern-handler/handler/pull/325
#### Defined in
[src/types/core.ts:16](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core.ts#L16)

View File

@@ -0,0 +1,2 @@
label: "Interfaces"
position: 4

734
docs/api/modules.md Normal file
View File

@@ -0,0 +1,734 @@
---
id: "modules"
title: "@sern/handler"
sidebar_label: "Exports"
sidebar_position: 0.5
custom_edit_url: null
---
## Namespaces
- [Presence](namespaces/Presence.md)
- [Sern](namespaces/Sern.md)
## Enumerations
- [CommandType](enums/CommandType.md)
- [EventType](enums/EventType.md)
- [PayloadType](enums/PayloadType.md)
- [PluginType](enums/PluginType.md)
## Classes
- [Context](classes/Context.md)
- [DefaultErrorHandling](classes/DefaultErrorHandling.md)
- [DefaultLogging](classes/DefaultLogging.md)
- [DefaultModuleManager](classes/DefaultModuleManager.md)
- [ModuleStore](classes/ModuleStore.md)
## Interfaces
- [BothCommand](interfaces/BothCommand.md)
- [ButtonCommand](interfaces/ButtonCommand.md)
- [ChannelSelectCommand](interfaces/ChannelSelectCommand.md)
- [CommandModuleDefs](interfaces/CommandModuleDefs.md)
- [ContextMenuMsg](interfaces/ContextMenuMsg.md)
- [ContextMenuUser](interfaces/ContextMenuUser.md)
- [ControlPlugin](interfaces/ControlPlugin.md)
- [Controller](interfaces/Controller.md)
- [CoreDependencies](interfaces/CoreDependencies.md)
- [CoreModuleStore](interfaces/CoreModuleStore.md)
- [DiscordEventCommand](interfaces/DiscordEventCommand.md)
- [Disposable](interfaces/Disposable.md)
- [Emitter](interfaces/Emitter.md)
- [ErrorHandling](interfaces/ErrorHandling.md)
- [EventModuleDefs](interfaces/EventModuleDefs.md)
- [ExternalEventCommand](interfaces/ExternalEventCommand.md)
- [Init](interfaces/Init.md)
- [InitPlugin](interfaces/InitPlugin.md)
- [Logging](interfaces/Logging.md)
- [MentionableSelectCommand](interfaces/MentionableSelectCommand.md)
- [ModalSubmitCommand](interfaces/ModalSubmitCommand.md)
- [ModuleManager](interfaces/ModuleManager.md)
- [Plugin](interfaces/Plugin.md)
- [RoleSelectCommand](interfaces/RoleSelectCommand.md)
- [SernAutocompleteData](interfaces/SernAutocompleteData.md)
- [SernEventCommand](interfaces/SernEventCommand.md)
- [SernEventsMapping](interfaces/SernEventsMapping.md)
- [SernSubCommandData](interfaces/SernSubCommandData.md)
- [SernSubCommandGroupData](interfaces/SernSubCommandGroupData.md)
- [SlashCommand](interfaces/SlashCommand.md)
- [StringSelectCommand](interfaces/StringSelectCommand.md)
- [TextCommand](interfaces/TextCommand.md)
- [UserSelectCommand](interfaces/UserSelectCommand.md)
- [Wrapper](interfaces/Wrapper.md)
## Type Aliases
### AnyCommandPlugin
Ƭ **AnyCommandPlugin**: [`ControlPlugin`](interfaces/ControlPlugin.md) \| [`InitPlugin`](interfaces/InitPlugin.md)<[`InitArgs`<`Processed`<[`CommandModule`](modules.md#commandmodule)\>\>]\>
#### Defined in
[src/types/core-plugin.ts:76](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-plugin.ts#L76)
___
### AnyEventPlugin
Ƭ **AnyEventPlugin**: [`ControlPlugin`](interfaces/ControlPlugin.md) \| [`InitPlugin`](interfaces/InitPlugin.md)<[`InitArgs`<`Processed`<[`EventModule`](modules.md#eventmodule)\>\>]\>
#### Defined in
[src/types/core-plugin.ts:77](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-plugin.ts#L77)
___
### Args
Ƭ **Args**: `ParseType`<\{ `slash`: [`SlashOptions`](modules.md#slashoptions) ; `text`: `string`[] }\>
#### Defined in
[src/types/utility.ts:16](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/utility.ts#L16)
___
### CommandModule
Ƭ **CommandModule**: [`TextCommand`](interfaces/TextCommand.md) \| [`SlashCommand`](interfaces/SlashCommand.md) \| [`BothCommand`](interfaces/BothCommand.md) \| [`ContextMenuUser`](interfaces/ContextMenuUser.md) \| [`ContextMenuMsg`](interfaces/ContextMenuMsg.md) \| [`ButtonCommand`](interfaces/ButtonCommand.md) \| [`StringSelectCommand`](interfaces/StringSelectCommand.md) \| [`MentionableSelectCommand`](interfaces/MentionableSelectCommand.md) \| [`UserSelectCommand`](interfaces/UserSelectCommand.md) \| [`ChannelSelectCommand`](interfaces/ChannelSelectCommand.md) \| [`RoleSelectCommand`](interfaces/RoleSelectCommand.md) \| [`ModalSubmitCommand`](interfaces/ModalSubmitCommand.md)
#### Defined in
[src/types/core-modules.ts:132](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L132)
___
### EventModule
Ƭ **EventModule**: [`DiscordEventCommand`](interfaces/DiscordEventCommand.md) \| [`SernEventCommand`](interfaces/SernEventCommand.md) \| [`ExternalEventCommand`](interfaces/ExternalEventCommand.md)
#### Defined in
[src/types/core-modules.ts:131](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L131)
___
### Initializable
Ƭ **Initializable**<`T`\>: `T`
Type to annotate that something is initializable.
If T has an init method, this will be called.
#### Type parameters
| Name | Type |
| :------ | :------ |
| `T` | extends [`Init`](interfaces/Init.md) |
#### Defined in
[src/types/ioc.ts:17](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/ioc.ts#L17)
___
### LogPayload
Ƭ **LogPayload**<`T`\>: `Object`
#### Type parameters
| Name | Type |
| :------ | :------ |
| `T` | `unknown` |
#### Type declaration
| Name | Type |
| :------ | :------ |
| `message` | `T` |
#### Defined in
[src/core/contracts/logging.ts:11](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/contracts/logging.ts#L11)
___
### Payload
Ƭ **Payload**: \{ `module`: `AnyModule` ; `type`: [`Success`](enums/PayloadType.md#success) } \| \{ `module?`: `AnyModule` ; `reason`: `string` \| `Error` ; `type`: [`Failure`](enums/PayloadType.md#failure) } \| \{ `module`: `undefined` ; `reason`: `string` ; `type`: [`Warning`](enums/PayloadType.md#warning) }
#### Defined in
[src/types/utility.ts:26](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/utility.ts#L26)
___
### PluginResult
Ƭ **PluginResult**: `Awaitable`<`VoidResult`\>
#### Defined in
[src/types/core-plugin.ts:51](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-plugin.ts#L51)
___
### SernOptionsData
Ƭ **SernOptionsData**: [`SernSubCommandData`](interfaces/SernSubCommandData.md) \| [`SernSubCommandGroupData`](interfaces/SernSubCommandGroupData.md) \| `APIApplicationCommandBasicOption` \| [`SernAutocompleteData`](interfaces/SernAutocompleteData.md)
Type that replaces autocomplete with [SernAutocompleteData](interfaces/SernAutocompleteData.md)
#### Defined in
[src/types/core-modules.ts:200](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/core-modules.ts#L200)
___
### Singleton
Ƭ **Singleton**<`T`\>: () => `T`
Type to annotate that something is a singleton.
T is created once and lazily.
#### Type parameters
| Name |
| :------ |
| `T` |
#### Type declaration
▸ (): `T`
##### Returns
`T`
#### Defined in
[src/types/ioc.ts:7](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/ioc.ts#L7)
___
### SlashOptions
Ƭ **SlashOptions**: `Omit`<`CommandInteractionOptionResolver`, ``"getMessage"`` \| ``"getFocused"``\>
#### Defined in
[src/types/utility.ts:14](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/utility.ts#L14)
___
### Transient
Ƭ **Transient**<`T`\>: () => () => `T`
Type to annotate that something is transient.
Every time this is called, a new object is created
#### Type parameters
| Name |
| :------ |
| `T` |
#### Type declaration
▸ (): () => `T`
##### Returns
`fn`
▸ (): `T`
##### Returns
`T`
#### Defined in
[src/types/ioc.ts:12](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/types/ioc.ts#L12)
## Variables
### controller
• `Const` **controller**: `Object`
**`Since`**
1.0.0
The object passed into every plugin to control a command's behavior
#### Type declaration
| Name | Type |
| :------ | :------ |
| `next` | () => `OkImpl`<`void`\> |
| `stop` | () => `ErrImpl`<`void`\> |
#### Defined in
[src/core/create-plugins.ts:69](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/create-plugins.ts#L69)
## Functions
### CommandControlPlugin
▸ **CommandControlPlugin**<`I`\>(`execute`): [`Plugin`](interfaces/Plugin.md)<`unknown`[]\>
#### Type parameters
| Name | Type |
| :------ | :------ |
| `I` | extends [`CommandType`](enums/CommandType.md) |
#### Parameters
| Name | Type |
| :------ | :------ |
| `execute` | (...`args`: `CommandArgs`<`I`, [`Control`](enums/PluginType.md#control)\>) => [`PluginResult`](modules.md#pluginresult) |
#### Returns
[`Plugin`](interfaces/Plugin.md)<`unknown`[]\>
**`Since`**
2.5.0
@__PURE__
#### Defined in
[src/core/create-plugins.ts:37](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/create-plugins.ts#L37)
___
### CommandInitPlugin
▸ **CommandInitPlugin**<`I`\>(`execute`): [`Plugin`](interfaces/Plugin.md)<`unknown`[]\>
#### Type parameters
| Name | Type |
| :------ | :------ |
| `I` | extends [`CommandType`](enums/CommandType.md) |
#### Parameters
| Name | Type |
| :------ | :------ |
| `execute` | (...`args`: `CommandArgs`<`I`, [`Init`](enums/PluginType.md#init)\>) => [`PluginResult`](modules.md#pluginresult) |
#### Returns
[`Plugin`](interfaces/Plugin.md)<`unknown`[]\>
**`Since`**
2.5.0
@__PURE__
#### Defined in
[src/core/create-plugins.ts:28](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/create-plugins.ts#L28)
___
### DiscordEventControlPlugin
▸ **DiscordEventControlPlugin**<`T`\>(`name`, `execute`): [`Plugin`](interfaces/Plugin.md)<`unknown`[]\>
#### Type parameters
| Name | Type |
| :------ | :------ |
| `T` | extends keyof `ClientEvents` |
#### Parameters
| Name | Type |
| :------ | :------ |
| `name` | `T` |
| `execute` | (...`args`: `ClientEvents`[`T`]) => [`PluginResult`](modules.md#pluginresult) |
#### Returns
[`Plugin`](interfaces/Plugin.md)<`unknown`[]\>
**`Since`**
2.5.0
**`Experimental`**
A specialized function for creating control plugins with discord.js ClientEvents.
Will probably be moved one day!
#### Defined in
[src/core/create-plugins.ts:58](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/create-plugins.ts#L58)
___
### EventControlPlugin
▸ **EventControlPlugin**<`I`\>(`execute`): [`Plugin`](interfaces/Plugin.md)<`unknown`[]\>
#### Type parameters
| Name | Type |
| :------ | :------ |
| `I` | extends [`EventType`](enums/EventType.md) |
#### Parameters
| Name | Type |
| :------ | :------ |
| `execute` | (...`args`: `EventArgs`<`I`, [`Control`](enums/PluginType.md#control)\>) => [`PluginResult`](modules.md#pluginresult) |
#### Returns
[`Plugin`](interfaces/Plugin.md)<`unknown`[]\>
**`Since`**
2.5.0
@__PURE__
#### Defined in
[src/core/create-plugins.ts:46](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/create-plugins.ts#L46)
___
### EventInitPlugin
▸ **EventInitPlugin**<`I`\>(`execute`): [`Plugin`](interfaces/Plugin.md)<`unknown`[]\>
#### Type parameters
| Name | Type |
| :------ | :------ |
| `I` | extends [`EventType`](enums/EventType.md) |
#### Parameters
| Name | Type |
| :------ | :------ |
| `execute` | (...`args`: `EventArgs`<`I`, [`Init`](enums/PluginType.md#init)\>) => [`PluginResult`](modules.md#pluginresult) |
#### Returns
[`Plugin`](interfaces/Plugin.md)<`unknown`[]\>
**`Since`**
2.5.0
@__PURE__
#### Defined in
[src/core/create-plugins.ts:19](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/create-plugins.ts#L19)
___
### Service
▸ **Service**<`T`\>(`key`): `NonNullable`<`UnpackFunction`<`Partial`<`Dependencies`\>[`T`]\>\>
The new Service api, a cleaner alternative to useContainer
To obtain intellisense, ensure a .d.ts file exists in the root of compilation.
Usually our scaffolding tool takes care of this.
Note: this method only works AFTER your container has been initiated
#### Type parameters
| Name | Type |
| :------ | :------ |
| `T` | extends keyof `Dependencies` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `key` | `T` | a key that corresponds to a dependency registered. |
#### Returns
`NonNullable`<`UnpackFunction`<`Partial`<`Dependencies`\>[`T`]\>\>
**`Since`**
3.0.0
**`Example`**
```ts
const client = Service('@sern/client');
```
#### Defined in
[src/core/ioc/dependency-injection.ts:37](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/ioc/dependency-injection.ts#L37)
___
### Services
▸ **Services**<`T`\>(`...keys`): `IntoDependencies`<`T`\>
#### Type parameters
| Name | Type |
| :------ | :------ |
| `T` | extends keyof `Dependencies`[] |
#### Parameters
| Name | Type |
| :------ | :------ |
| `...keys` | [...T[]] |
#### Returns
`IntoDependencies`<`T`\>
array of dependencies, in the same order of keys provided
**`Since`**
3.0.0
The plural version of [Service](modules.md#service)
#### Defined in
[src/core/ioc/dependency-injection.ts:47](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/ioc/dependency-injection.ts#L47)
___
### commandModule
▸ **commandModule**(`mod`): [`CommandModule`](modules.md#commandmodule)
#### Parameters
| Name | Type |
| :------ | :------ |
| `mod` | `InputCommand` |
#### Returns
[`CommandModule`](modules.md#commandmodule)
**`Since`**
1.0.0 The wrapper function to define command modules for sern
#### Defined in
[src/core/modules.ts:19](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/modules.ts#L19)
___
### discordEvent
▸ **discordEvent**<`T`\>(`mod`): [`EventModule`](modules.md#eventmodule)
Create event modules from discord.js client events,
This is an [eventModule](modules.md#eventmodule-1) for discord events,
where typings can be very bad.
#### Type parameters
| Name | Type |
| :------ | :------ |
| `T` | extends keyof `ClientEvents` |
#### Parameters
| Name | Type |
| :------ | :------ |
| `mod` | `Object` |
| `mod.execute` | (...`args`: `ClientEvents`[`T`]) => `unknown` |
| `mod.name` | `T` |
| `mod.plugins?` | [`AnyEventPlugin`](modules.md#anyeventplugin)[] |
#### Returns
[`EventModule`](modules.md#eventmodule)
**`Experimental`**
#### Defined in
[src/core/modules.ts:47](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/modules.ts#L47)
___
### eventModule
▸ **eventModule**(`mod`): [`EventModule`](modules.md#eventmodule)
#### Parameters
| Name | Type |
| :------ | :------ |
| `mod` | `InputEvent` |
#### Returns
[`EventModule`](modules.md#eventmodule)
**`Since`**
1.0.0
The wrapper function to define event modules for sern
#### Defined in
[src/core/modules.ts:32](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/modules.ts#L32)
___
### makeDependencies
▸ **makeDependencies**<`T`\>(`conf`): `Promise`<<V\>(...`keys`: [...V[]]) => `IntoDependencies`<`V`\>\>
#### Type parameters
| Name | Type |
| :------ | :------ |
| `T` | extends `Dependencies` |
#### Parameters
| Name | Type |
| :------ | :------ |
| `conf` | `ValidDependencyConfig` |
#### Returns
`Promise`<<V\>(...`keys`: [...V[]]) => `IntoDependencies`<`V`\>\>
#### Defined in
[src/core/ioc/base.ts:144](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/ioc/base.ts#L144)
___
### makePlugin
▸ **makePlugin**<`V`\>(`type`, `execute`): [`Plugin`](interfaces/Plugin.md)<`V`\>
#### Type parameters
| Name | Type |
| :------ | :------ |
| `V` | extends `unknown`[] |
#### Parameters
| Name | Type |
| :------ | :------ |
| `type` | [`PluginType`](enums/PluginType.md) |
| `execute` | (...`args`: `any`[]) => `any` |
#### Returns
[`Plugin`](interfaces/Plugin.md)<`V`\>
#### Defined in
[src/core/create-plugins.ts:6](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/create-plugins.ts#L6)
___
### single
▸ **single**<`T`\>(`cb`): () => `T`
@__PURE__
#### Type parameters
| Name |
| :------ |
| `T` |
#### Parameters
| Name | Type |
| :------ | :------ |
| `cb` | () => `T` |
#### Returns
`fn`
▸ (): `T`
##### Returns
`T`
**`Since`**
2.0.0.
Creates a singleton object.
#### Defined in
[src/core/ioc/dependency-injection.ts:11](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/ioc/dependency-injection.ts#L11)
___
### transient
▸ **transient**<`T`\>(`cb`): () => () => `T`
@__PURE__
#### Type parameters
| Name |
| :------ |
| `T` |
#### Parameters
| Name | Type |
| :------ | :------ |
| `cb` | () => () => `T` |
#### Returns
`fn`
▸ (): () => `T`
##### Returns
`fn`
▸ (): `T`
##### Returns
`T`
**`Since`**
2.0.0
Creates a transient object
#### Defined in
[src/core/ioc/dependency-injection.ts:21](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/ioc/dependency-injection.ts#L21)

View File

@@ -0,0 +1,31 @@
---
id: "CommandError"
title: "Namespace: CommandError"
sidebar_label: "CommandError"
sidebar_position: 0
custom_edit_url: null
---
## Interfaces
- [Response](../interfaces/CommandError.Response.md)
## Functions
### of
**of**(): `Object`
#### Returns
`Object`
| Name | Type |
| :------ | :------ |
| `log` | <T\>(`type`: keyof [`Logging`](../interfaces/Logging.md)<`unknown`\>, `message`: `T`) => `Record`<`PropertyKey`, `unknown`\> |
| `reply` | (`bodyContent`: `ReplyOptions`) => `Record`<`PropertyKey`, `unknown`\> |
| `status` | (`p`: ``"fail"`` \| ``"continue"``) => `Record`<`PropertyKey`, `unknown`\> |
#### Defined in
[src/core/structures/command-error.ts:10](https://github.com/sern-handler/handler/blob/504cdee/src/core/structures/command-error.ts#L10)

View File

@@ -0,0 +1,93 @@
---
id: "Presence"
title: "Namespace: Presence"
sidebar_label: "Presence"
sidebar_position: 0
custom_edit_url: null
---
## Interfaces
- [Result](../interfaces/Presence.Result.md)
## Type Aliases
### Config
Ƭ **Config**<`T`\>: `Object`
#### Type parameters
| Name | Type |
| :------ | :------ |
| `T` | extends keyof `Dependencies`[] |
#### Type declaration
| Name | Type |
| :------ | :------ |
| `execute` | (...`v`: `IntoDependencies`<`T`\>) => [`Result`](../interfaces/Presence.Result.md) |
| `inject?` | [...T] |
#### Defined in
[src/core/presences.ts:17](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/presences.ts#L17)
## Functions
### module
**module**<`T`\>(`conf`): [`Config`](Presence.md#config)<`T`\>
A small wrapper to provide type inference.
Create a Presence module which **MUST** be put in a file called presence.(language-extension)
adjacent to the file where **Sern.init** is CALLED.
#### Type parameters
| Name | Type |
| :------ | :------ |
| `T` | extends keyof `Dependencies`[] |
#### Parameters
| Name | Type |
| :------ | :------ |
| `conf` | [`Config`](Presence.md#config)<`T`\> |
#### Returns
[`Config`](Presence.md#config)<`T`\>
#### Defined in
[src/core/presences.ts:28](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/presences.ts#L28)
___
### of
**of**(`root`): `Object`
Create a Presence body which can be either:
- once, the presence is activated only once.
- repeated, per cycle or event, the presence can be changed.
#### Parameters
| Name | Type |
| :------ | :------ |
| `root` | `Omit`<[`Result`](../interfaces/Presence.Result.md), ``"repeat"`` \| ``"onRepeat"``\> |
#### Returns
`Object`
| Name | Type | Description |
| :------ | :------ | :------ |
| `once` | () => `Omit`<[`Result`](../interfaces/Presence.Result.md), ``"repeat"`` \| ``"onRepeat"``\> | - |
| `repeated` | (`onRepeat`: `PresenceReduce`, `repeat`: `number` \| [[`Emitter`](../interfaces/Emitter.md), `string`]) => \{ `activities?`: `ActivitiesOptions`[] ; `afk?`: `boolean` ; `onRepeat`: `PresenceReduce` ; `repeat`: `number` \| [[`Emitter`](../interfaces/Emitter.md), `string`] ; `shardId?`: `number`[] ; `status?`: `Status` } | - |
#### Defined in
[src/core/presences.ts:37](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/core/presences.ts#L37)

View File

@@ -0,0 +1,40 @@
---
id: "Sern"
title: "Namespace: Sern"
sidebar_label: "Sern"
sidebar_position: 0
custom_edit_url: null
---
## Functions
### init
**init**(`maybeWrapper`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `maybeWrapper` | [`Wrapper`](../interfaces/Wrapper.md) \| ``"file"`` |
#### Returns
`void`
**`Since`**
1.0.0
**`Example`**
```ts title="src/index.ts"
Sern.init({
commands: 'dist/commands',
events: 'dist/events',
})
```
#### Defined in
[src/sern.ts:26](https://github.com/sern-handler/handler/blob/91b3768e376cfe22ec37d8ab44f4e4a4dfe8a1e8/src/sern.ts#L26)

View File

@@ -0,0 +1,2 @@
label: "Namespaces"
position: 1

View File

@@ -1,12 +1,9 @@
---
title: About the CLI
---
# CLI
Publish commands to the API, install plugins, and use other tools provided by our cli.
The CLI is your pocketknife for discord bot development. It'll have all features necessary for developing and shipping to production.
```ansi
```
Usage: sern [options] [command]
@@ -16,17 +13,16 @@ Usage: sern [options] [command]
|___/\___|_| |_| |_|
Welcome!
If you're new to sern, run npm create @sern/bot for an interactive setup to your new bot project!
If you're new to sern, run npm create @sern/bot for an interactive setup to your new bot project!
If you have any ideas, suggestions, bug reports, kindly join our support server: https://sern.dev/discord
If you have any ideas, suggestions, bug reports, kindly join our support server: https://sern.dev/discord
Options:
-v, --version output the version number
-h, --help display help for command
Commands:
init [options] Quickest way to scaffold a new project [DEPRECATED]
init [options] Quickest way to scaffold a new project [DEPRECATED]
plugins [options] Install plugins from https://github.com/sern-handler/awesome-plugins
extra Easy way to add extra things in your sern project
commands Defacto way to manage your slash commands

View File

@@ -1,7 +1,3 @@
---
title: Build
---
```sh
Usage: sern build [options]
@@ -39,123 +35,126 @@ The `sern build` command comes equipped with a range of features designed to enh
- **Experimental Image Support**: We've introduced experimental support for top-level imports of PNG and JPG files, making it easier to include images in your bot application.
- **Compile Time Constants**: Customize your build with constants such as `__DEV__`, `__PROD__`, allowing you to tailor your application to different production stages.
- **Compile Time Constants**: Customize your build with constants such as \_\_DEV\_\_, \_\_PROD\_\_, allowing you to tailor your application to different production stages.
- **Development and Production Modes**: The CLI supports both development and production modes, enabling you to tailor your bot application for different stages of development.
- **Type-safe `process.env`**: The CLI generates a type-safe `process.env`, reducing potential errors.
## Implicits
## Implicits
- command line arguments take precendence over sern.build configuration file
- default build format is ESM
- defineVersion = true
- **DEV** AND **PROD** constants are configured.
- __DEV__ AND __PROD__ constants are configured.
- only a [few tsconfig options](https://esbuild.github.io/content-types/#tsconfig-json) are respected.
### sern.build.js
- For any extra configuration you may need
- the cli was intentionally made to be installed globally, and we can't provide typings at a project level. If you need typings, here they are:
```ts
type BuildOptions = {
/**
* Define __VERSION__
* This option is a quick switch to defining the __VERSION__ constant which will be a string of the version provided in
* cwd's package.json
*/
defineVersion?: boolean;
/**
* default = esm
*/
format?: "cjs" | "esm";
/**
* extra esbuild plugins to build with sern.
*/
esbuildPlugins?: esbuild.Plugin[];
/**
* https://esbuild.github.io/api/#drop-labels
**/
dropLabels?: string[];
/**
* https://esbuild.github.io/api/#define
**/
define?: Record<string, string>;
/**
* Path to tsconfig
**/
tsconfig?: string;
/**
* default = 'development'
*/
mode: "production" | "development";
/**
* will search for env file. If none exists,
* default to .env.
*/
env?: string;
};
```
## Usage
```
sern build
```
(that was easy)
## Adapting older projects
- Change your tsconfig.json to extend our generated one.
```json {2}
{
"extends": "./.sern/tsconfig.json",
"compilerOptions": {
// all of your old fields
}
/**
* Define __VERSION__
* This option is a quick switch to defining the __VERSION__ constant which will be a string of the version provided in
* cwd's package.json
*/
defineVersion?: boolean
/**
* default = esm
*/
format?: 'cjs' | 'esm'
/**
* extra esbuild plugins to build with sern.
*/
esbuildPlugins?: esbuild.Plugin[]
/**
* https://esbuild.github.io/api/#drop-labels
**/
dropLabels?: string[]
/**
* https://esbuild.github.io/api/#define
**/
define?: Record<string, string>
/**
* Path to tsconfig
**/
tsconfig?: string;
/**
* default = 'development'
*/
mode: 'production' | 'development',
/**
* will search for env file. If none exists,
* default to .env.
*/
env?: string
}
```
## Usage
```
sern build
```
(that was easy)
## Adapting older projects
- Change your tsconfig.json to extend our generated one.
```json
{
// highlight-start
"extends": "./.sern/tsconfig.json",
// highlight-end
"compilerOptions" : {
//all of your old fields
}
}
```
## In depth
We use the `define` and `drop labels` api in C style macros to have easy development stage differences.
We use the `define` and `drop labels` api in C style macros to have easy development stage differences.
[Here](https://esbuild.github.io/api/#drop-labels) is the esbuild full API documentation
### drop labels
```sh
```sh
# mode is set to production
sern build
```
import { Tabs, TabItem } from '@astrojs/starlight/components';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
<Tabs>
<TabItem value="input" label="Input">
```ts
__DEV__: console.log("This is for production only");
__PROD__: console.log("This is for either mode");
```
</TabItem>
<TabItem value="sh" label="Running build for production">
```sh
# mode is set to production
sern build
```
</TabItem>
<TabItem value="output" label="Output">
```ts
__PROD__ console.log('This is for either mode')
```
</TabItem>
<TabItem value="input" label="Input">
```ts
__DEV__: console.log('This is for production only')
__PROD__: console.log('This is for either mode')
```
</TabItem>
<TabItem value="sh" label="Running build for production">
```sh
# mode is set to production
sern build
```
</TabItem>
<TabItem value="output" label="Output">
```ts
__PROD__ console.log('This is for either mode')
```
</TabItem>
</Tabs>
### constants
sern builds with three default constants. `__DEV__`, `__PROD__`, `__VERSION__`.
### constants
sern builds with three default constants. \_\_DEV\_\_, \_\_PROD\_\_, \_\_VERSION\_\_.
<Tabs>
@@ -169,9 +168,9 @@ sern build
<TabItem value="sh" label="Constants available and typesafe!">
```ts
if (__PROD__) {
console.log("Bot version: " + __VERSION__);
```ts
if(__PROD__) {
console.log('Bot version: ' + __VERSION__)
}
```
@@ -183,31 +182,28 @@ Full esbuild documentation [here](https://esbuild.github.io/api/#define)
Add more to the `define` field in build options (only availible with a `sern.build` file at the moment.
### process.env
We generate your process.env with `dotenv` and generate typings for process.env. Less hassle!
<Tabs>
<TabItem value="input" label=".env">
```sh frame="none"
```sh
DISCORD_TOKEN=<your token>
```
```ts
process.env.DISCORD_TOKEN; // string | undefined (not typesafe :()
```ts
process.env.DISCORD_TOKEN // string | undefined (not typesafe :()
```
</TabItem>
<TabItem value="sh" label="sern build">
```sh
```sh
sern build
```
```ts
process.env.DISCORD_TOKEN; // string (typesafe :))
```ts
process.env.DISCORD_TOKEN // string (typesafe :))
```
</TabItem>

View File

@@ -1,7 +1,3 @@
---
title: Clear
---
```sh
Usage: sern commands clear [options]
@@ -12,24 +8,21 @@ Options:
-e, --env [path] Supply a path to a .env
-h, --help display help for command
```
## Implicits
- Automatically reads a .env in the working directory. For seamless integration, your .env file should look like this:
```sh title=".env"
```txt title=".env"
DISCORD_TOKEN=<YOUR_TOKEN>
APPLICATION_ID=<YOUR_APPLICATION_ID>
NODE_ENV=<development|production>
```
- Calls the discord API with the [PUT route](https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands) with an EMPTY array, essentially setting all registered commands to nothing.
- Calls the discord API with the [PUT route](https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands) with an EMPTY array, essentially setting all registered commands to nothing.
- Optionally override an .env path as a command line argument as well. **CLI arguments take precedence.**
If you do not know how to obtain either of these credentials, [click here](https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-&-getting-a-token)
If you do not know how to obtain either of these credentials, [click here](https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-&-getting-a-token)
- Automatically confirm with the **-y** flag.
## Features
- Clears all application data and sern-commands-data.json
- Clears all application data and sern-commands-data.json

View File

@@ -1,6 +1,3 @@
---
title: Extra
---
```sh
Usage: sern extra [options]

View File

@@ -1,7 +1,3 @@
---
title: Publish
---
```sh
Usage: sern commands publish [options] [path]
@@ -16,28 +12,24 @@ Options:
--appId [applicationId]
-h, --help display help for command
```
## Implicits
- Automatically reads a .env in the working directory. For seamless integration, your .env file should look like this:
```sh title=".env"
```txt title=".env"
DISCORD_TOKEN=<YOUR_TOKEN>
APPLICATION_ID=<YOUR_APPLICATION_ID>
NODE_ENV=<production|development>
```
- Calls the discord API with the [PUT route](https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands). Wherever your commands directory is located, publish will override the existing application commands at Discord. Existing commands do not count towards the command limit creation daily.
- Calls the discord API with the [PUT route](https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands). Wherever your commands directory is located, publish will override the existing application commands at Discord. Existing commands do not count towards the command limit creation daily.
You may pass these in as command line arguments as well. **CLI arguments take precedence.**
If you do not know how to obtain either of these credentials, [click here](https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-&-getting-a-token)
## Usage
## Usage
![usage](../../static/img/Code_-_Insiders_2kTVzm0uIQ.gif)
![usage](/src/assets/docs/sern-publish.gif)
## Features
- Automatically syncs api with your command base
- generates JSON file of output (**.sern/command-data-remote.json**)
- supports publishing direct esm typescript files
@@ -45,13 +37,12 @@ If you do not know how to obtain either of these credentials, [click here](https
- prerequire scripts.
- supports a configuration that is the same as the original publish plugin.
Each command file can have an extra config that follows `ValidPublishOptions`:
## Config
```ts
```ts
type ValidMemberPermissions =
type ValidMemberPermissions =
| PermissionFlagBits //discord.js enum
| PermissionFlagBits[] //array of discord.js enum
| string //must be a stringified number
@@ -62,54 +53,48 @@ interface PublishConfig {
dmPermission?: boolean;
defaultMemberPermissions: ValidMemberPermissions;
}
type ValidPublishOptions =
type ValidPublishOptions =
| PublishConfig
| (absPath: string, module: CommandModule) => PublishConfig
```
In other words, you can export a function or object.
## Prerequiring
## Prerequiring
Is there a [service](../guide/walkthrough/services) that is required at the top level of a command?
- Create an ES6 script anywhere:
- Create an ES6 script anywhere:
```ts title="scripts/prerequire.mjs"
import { makeDependencies, single, Service } from "@sern/handler";
import { Client } from "discord.js";
import { makeDependencies, single, Service } from '@sern/handler'
import { Client } from 'discord.js'
await makeDependencies({
build: (root) =>
root.add({ "@sern/client": single(() => new Client(...options)) }),
});
await Service("@sern/client").login();
await Service('@sern/client').login()
```
This will create a container for publishing. (as of 0.6.0, client is required or this will crash)
### Example: command published in guild
#### Script ran:
```
sern commands publish -i ./scripts/prerequire.mjs
```
```ts title=src/commands/ping.ts
import { commandModule, Service, CommandType } from '@sern/handler'
const client = Service('@sern/client');
export const config = {
export const config = {
guildIds: ["889026545715400705"]
}
export default commandModule( {
type: CommandType.Slash
description: `${client.user.username}'s ping`,
execute: (ctx) => {
execute: (ctx) => {
ctx.reply('pong')
}
})

0
docs/guide/.nojekyll Normal file
View File

30
docs/guide/README.md Normal file
View File

@@ -0,0 +1,30 @@
# Introduction
Welcome to our official guide. This guide will go through all the core features of the framework.
- 💖 Thank you for choosing sern to be your framework!
- Teaching the discord.js library and / or Javascript / Typescript is out of scope of this project, so the documentation assumes you already know these elements.
- [discord.js](https://discord.js.org/#/)
- [javascript](https://nodejs.dev/en/learn/)
- [typescript](https://www.typescriptlang.org/docs/)
- discord.js v14 is the only supported library at the moment
## You will learn
* [sern's goal](walkthrough/goal.md)
* How to use sern with the [CLI](walkthrough/cli.md)
* [Your first command](walkthrough/first-command.md)
* [The Context class](walkthrough/first-command.md#context-class)
* [Autocomplete](walkthrough/autocomplete.md)
* [Services](walkthrough/services.md)
* [dependency injection](walkthrough/dependency-injection.md)
### Working with plugins
* [Plugins](walkthrough/plugins.md)
- [Init Plugins](walkthrough/plugins.md#command-plugins)
- [Control Plugins](walkthrough/plugins.md#event-plugins)
### Events
* [The SernEmitter class](walkthrough/sern-emitter.md)
* [Your first event](walkthrough/first-event.md)
### Good to know
* [sern.config.json](walkthrough/good-to-know.md)

Some files were not shown because too many files have changed in this diff Show More