mirror of
https://github.com/sern-handler/website
synced 2026-06-06 09:26:46 +00:00
Compare commits
84 Commits
1.1
...
feat/clear
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9d8ef511a | ||
|
|
ae72c3eedc | ||
|
|
a69e19503c | ||
|
|
edd1d1492d | ||
|
|
92959c3319 | ||
|
|
b14a033c86 | ||
|
|
55a691e787 | ||
|
|
0bd5ab15cb | ||
| 4cd89d146f | |||
| a37d077848 | |||
| 7e444894c7 | |||
| c0b5631bc7 | |||
|
|
c047c3b1cc | ||
|
|
828471eba7 | ||
|
|
1b49dc80b5 | ||
|
|
82605f326b | ||
|
|
3b5795c0e6 | ||
|
|
f2388eb23d | ||
|
|
948b3bb8cf | ||
| ce43790214 | |||
|
|
3eb3690232 | ||
|
|
74b259e1b6 | ||
|
|
76eb15c793 | ||
|
|
2689b95e85 | ||
|
|
e64667b31c | ||
|
|
749b706a02 | ||
|
|
2f757710e1 | ||
|
|
d77ee3f7f5 | ||
|
|
1d142db329 | ||
|
|
71f100d079 | ||
|
|
0b8de88344 | ||
|
|
bfc4d6ac8e | ||
|
|
b06251f499 | ||
|
|
19db611a9b | ||
|
|
ef452e678a | ||
|
|
c7a8611476 | ||
|
|
9802586bf7 | ||
|
|
d59674eca2 | ||
|
|
9168f61c09 | ||
|
|
c1d64d1172 | ||
|
|
2b3cdc2374 | ||
|
|
530a622c36 | ||
|
|
c46f074926 | ||
|
|
3cc8b38390 | ||
|
|
ef6420a669 | ||
|
|
e10e6cbd2f | ||
|
|
d531eb7340 | ||
|
|
332399bb43 | ||
|
|
b97bc9dde7 | ||
|
|
d447a40f98 | ||
|
|
eca35e1309 | ||
|
|
44645d89de | ||
|
|
66bdaf7f9f | ||
|
|
d9a69a4b6b | ||
|
|
70ff70a1bf | ||
|
|
59b6096423 | ||
|
|
ee11018d48 | ||
|
|
e547c0f485 | ||
| 75140b3d38 | |||
|
|
f1917da3e6 | ||
|
|
7a80638a1b | ||
|
|
4c6b6f9177 | ||
|
|
49a910f90a | ||
|
|
05e470b99b | ||
|
|
ebe5c84ba3 | ||
|
|
a4d12af7f2 | ||
|
|
b8377ec5a4 | ||
|
|
b8be42b1d7 | ||
|
|
9eebee836a | ||
|
|
64adb7b0ca | ||
|
|
51a9774b58 | ||
|
|
4feb242b61 | ||
| 24a2098402 | |||
|
|
6ab8f09271 | ||
|
|
04a7824983 | ||
|
|
994f0ca0e8 | ||
|
|
a60c20545e | ||
|
|
9923ad226d | ||
|
|
a418273592 | ||
|
|
cefbc62823 | ||
|
|
437b8759cb | ||
|
|
7e0c9c012f | ||
|
|
9087c085c4 | ||
|
|
adfbe3b8a4 |
6
.github/workflows/docusaurus.yml
vendored
6
.github/workflows/docusaurus.yml
vendored
@@ -15,12 +15,12 @@ jobs:
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
cache: npm
|
||||
cache: yarn
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
run: yarn install --immutable
|
||||
- name: Build website
|
||||
run: npm run build
|
||||
run: yarn build
|
||||
|
||||
# Popular action to deploy to GitHub Pages:
|
||||
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
|
||||
|
||||
90
.idea/workspace.xml
generated
90
.idea/workspace.xml
generated
@@ -4,9 +4,56 @@
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="53dd69d3-e01a-4656-b414-c727f5aa549a" name="Changes" comment="feat: add image">
|
||||
<list default="true" id="53dd69d3-e01a-4656-b414-c727f5aa549a" name="Changes" comment="docs: add new plugins docs">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/blog/2022-12-13-mdx-blog-post.md" beforeDir="false" afterPath="$PROJECT_DIR$/blog/2022-12-13-mdx-blog-post.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/classes/CommandExecutable.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/classes/CommandExecutable.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/classes/Context.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/classes/Context.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/classes/DefaultErrorHandling.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/classes/DefaultErrorHandling.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/classes/DefaultLogging.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/classes/DefaultLogging.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/classes/DefaultModuleManager.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/classes/DefaultModuleManager.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/classes/EventExecutable.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/classes/EventExecutable.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/classes/ModuleStore.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/classes/ModuleStore.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/classes/SernEmitter.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/classes/SernEmitter.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/enums/CommandType.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/enums/CommandType.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/enums/EventType.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/enums/EventType.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/enums/PayloadType.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/enums/PayloadType.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/enums/PluginType.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/enums/PluginType.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/enums/SernError.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/enums/SernError.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/AutocompleteCommand.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/AutocompleteCommand.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/BothCommand.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/BothCommand.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/ButtonCommand.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/ButtonCommand.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/ChannelSelectCommand.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/ChannelSelectCommand.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/CommandPlugin.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/CommandPlugin.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/ContextMenuMsg.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/ContextMenuMsg.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/ContextMenuUser.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/ContextMenuUser.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/ControlPlugin.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/ControlPlugin.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/Controller.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/Controller.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/Dependencies.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/Dependencies.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/DependencyConfiguration.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/DependencyConfiguration.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/DiscordEventCommand.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/DiscordEventCommand.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/ErrorHandling.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/ErrorHandling.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/EventPlugin.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/EventPlugin.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/ExternalEventCommand.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/ExternalEventCommand.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/InitArgs.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/InitArgs.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/InitPlugin.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/InitPlugin.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/Logging.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/Logging.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/MentionableSelectCommand.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/MentionableSelectCommand.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/ModalSubmitCommand.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/ModalSubmitCommand.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/Module.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/Module.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/ModuleManager.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/ModuleManager.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/Plugin.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/Plugin.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/RoleSelectCommand.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/RoleSelectCommand.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/SernAutocompleteData.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/SernAutocompleteData.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/SernEventCommand.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/SernEventCommand.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/SernSubCommandData.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/SernSubCommandData.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/SernSubCommandGroupData.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/SernSubCommandGroupData.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/SlashCommand.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/SlashCommand.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/StringSelectCommand.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/StringSelectCommand.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/TextCommand.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/TextCommand.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/UserSelectCommand.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/UserSelectCommand.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/interfaces/Wrapper.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/interfaces/Wrapper.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/modules.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/modules.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/docs/api/namespaces/Sern.md" beforeDir="false" afterPath="$PROJECT_DIR$/docs/api/namespaces/Sern.md" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@@ -133,6 +180,8 @@
|
||||
<workItem from="1671030002725" duration="5842000" />
|
||||
<workItem from="1671047161316" duration="3576000" />
|
||||
<workItem from="1671119393024" duration="3889000" />
|
||||
<workItem from="1673974979200" duration="2385000" />
|
||||
<workItem from="1674757791435" duration="925000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="feat: remove old index.html in static/">
|
||||
<created>1660418841831</created>
|
||||
@@ -295,7 +344,35 @@
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1671123452807</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="24" />
|
||||
<task id="LOCAL-00024" summary="feat: update docs and some blog progress">
|
||||
<created>1673582791487</created>
|
||||
<option name="number" value="00024" />
|
||||
<option name="presentableId" value="LOCAL-00024" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1673582791487</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00025" summary="feat: update documentation and clarify documentation">
|
||||
<created>1673976226325</created>
|
||||
<option name="number" value="00025" />
|
||||
<option name="presentableId" value="LOCAL-00025" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1673976226325</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00026" summary="fix: links">
|
||||
<created>1673976805332</created>
|
||||
<option name="number" value="00026" />
|
||||
<option name="presentableId" value="LOCAL-00026" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1673976805332</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00027" summary="docs: add new plugins docs">
|
||||
<created>1673976828238</created>
|
||||
<option name="number" value="00027" />
|
||||
<option name="presentableId" value="LOCAL-00027" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1673976828238</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="28" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
@@ -324,7 +401,6 @@
|
||||
<MESSAGE value="feat: adding width attr" />
|
||||
<MESSAGE value="feat: adding blogs" />
|
||||
<MESSAGE value="feat: blogwork" />
|
||||
<MESSAGE value="fix: links" />
|
||||
<MESSAGE value="fix: try fiux" />
|
||||
<MESSAGE value="feat: change date of blog" />
|
||||
<MESSAGE value="feat: starting writing 2.0 release blog" />
|
||||
@@ -335,6 +411,10 @@
|
||||
<MESSAGE value="feat: update typedoc" />
|
||||
<MESSAGE value="feat: try again" />
|
||||
<MESSAGE value="feat: add image" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="feat: add image" />
|
||||
<MESSAGE value="feat: update docs and some blog progress" />
|
||||
<MESSAGE value="feat: update documentation and clarify documentation" />
|
||||
<MESSAGE value="fix: links" />
|
||||
<MESSAGE value="docs: add new plugins docs" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="docs: add new plugins docs" />
|
||||
</component>
|
||||
</project>
|
||||
BIN
.yarn/install-state.gz
Normal file
BIN
.yarn/install-state.gz
Normal file
Binary file not shown.
1
.yarnrc.yml
Normal file
1
.yarnrc.yml
Normal file
@@ -0,0 +1 @@
|
||||
nodeLinker: node-modules
|
||||
4
404.html
4
404.html
@@ -2,7 +2,7 @@
|
||||
<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/icon.png">
|
||||
<link rel="icon" href="./assets/images/favicon.ico">
|
||||
<meta name="theme-color" content="#fff">
|
||||
<meta name="twitter:card" content="summary">
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<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 is may be broken or invalid.</p>
|
||||
<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>
|
||||
|
||||
@@ -39,7 +39,7 @@ If you're using ESM, configure dotenv with `import 'dotenv/config'` instead of `
|
||||
|
||||
### And... that's it?
|
||||
|
||||
Yes, that's it. Here's a little FAQ to get you started. You can also join the [Discord](https://sern-handler.js.org/discord) for any problems.
|
||||
Yes, that's it. Here's a little FAQ to get you started. You can also join the [Discord](https://sern.dev/discord) for any problems.
|
||||
|
||||
### Extra: Video tutorial!
|
||||
|
||||
@@ -59,4 +59,4 @@ Yes, that's it. Here's a little FAQ to get you started. You can also join the [D
|
||||
**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-handler.js.org/discord). We're trying to get to 100 members!
|
||||
**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!
|
||||
|
||||
@@ -132,7 +132,7 @@ Post 2.0:
|
||||
|
||||
CommandPlugin<T\> and EventPlugin<T\> typings have also been static'ified, transformed from types to interfaces
|
||||
## Breaking Changes
|
||||
<img src="https://img.srizan.ml/Discord_z8Sn1UBfEe.png" />
|
||||
<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.
|
||||
|
||||
@@ -188,4 +188,4 @@ Including the previous section, some names to symbols and data structures were a
|
||||
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.
|
||||
|
||||
31
blog/2023-01-12-mdx-blog-post.md
Normal file
31
blog/2023-01-12-mdx-blog-post.md
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
slug: 2.5.0
|
||||
title: Release 2.5.0
|
||||
authors: [jacoobes]
|
||||
tags: [release]
|
||||
---
|
||||
|
||||
## 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?
|
||||
### 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)
|
||||
### 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
|
||||
- [CommandControlPlugin](../docs/api/modules#commandcontrolplugin)
|
||||
- [CommandInitPlugin](../docs/api/modules#commandinitplugin)
|
||||
- [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!
|
||||
102
blog/2023-06-18-mdx-blog-post.md
Normal file
102
blog/2023-06-18-mdx-blog-post.md
Normal file
@@ -0,0 +1,102 @@
|
||||
---
|
||||
slug: 3.0.0
|
||||
title: Release 3.0.0
|
||||
authors: [jacoobes]
|
||||
tags: [release]
|
||||
---
|
||||
|
||||
## 3.0 Release
|
||||
|
||||
### Join our [discord](https://sern.dev/discord) <br />
|
||||
|
||||
### 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
|
||||
- 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!
|
||||
- Emitter interface
|
||||
- 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()
|
||||
|
||||
async init() {
|
||||
await _pgsql.load()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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')
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
```
|
||||
|
||||
#### Quality of Life
|
||||
- faster module loading
|
||||
- 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
|
||||
- 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)
|
||||
|
||||
- `Service` API (recommended to use this over useContainer hooks)
|
||||
- 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`)
|
||||
- new SernEmitter event `modulesLoaded` , which allows users to customize behavior after all modules are loaded!
|
||||
- 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
|
||||
- init sern from `file` option
|
||||
- reads from local sern.config.json
|
||||
|
||||
```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
|
||||
- BaseOptions type removed
|
||||
|
||||
```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
|
||||
|
||||
34
blog/2023-7-4-mdx-blog-post.md
Normal file
34
blog/2023-7-4-mdx-blog-post.md
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
slug: newlogo
|
||||
title: New logo!
|
||||
authors: [sern]
|
||||
tags: [branding]
|
||||
---
|
||||
|
||||
Hey everyone! Today we have very special news for you all: We're changing our logo!
|
||||
|
||||
# Why?
|
||||
|
||||
You see, on today's standards, having a simple logo is essential. Our logo aligns perfectly with these design principles but it can always be improved.
|
||||
We were chilling, you know, cooking sern handler v3, sern gui, `npm create @sern/bot` and serncord when we thought about changing the logo to a sleek design with less colors.
|
||||
And here we are!
|
||||
|
||||
# Who did our new branding?
|
||||
|
||||
[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:
|
||||

|
||||
And there it all clicked:
|
||||

|
||||
seren tried by the way!
|
||||

|
||||
|
||||
# Anyways, here it is:
|
||||
|
||||

|
||||
|
||||
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 ❤️
|
||||
@@ -5,11 +5,15 @@ jacoobes:
|
||||
image_url: https://github.com/jacoobes.png
|
||||
Sr Izan:
|
||||
name: Sr Izan
|
||||
title: Contributor
|
||||
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
|
||||
image_url: https://github.com/Murtatrxx.png
|
||||
|
||||
202
docgen.docusaurus.config.js
Normal file
202
docgen.docusaurus.config.js
Normal file
@@ -0,0 +1,202 @@
|
||||
// @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']
|
||||
},
|
||||
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/',
|
||||
},
|
||||
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;
|
||||
@@ -6,53 +6,41 @@ sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
**`Deprecated`**
|
||||
|
||||
Will be removed in future
|
||||
|
||||
## Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `Type` | extends [`CommandType`](../enums/CommandType.md) |
|
||||
| `Type` | extends [`CommandType`](../enums/CommandType.md) = [`CommandType`](../enums/CommandType.md) |
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new CommandExecutable**<`Type`\>()
|
||||
• **new CommandExecutable**<`Type`\>(): [`CommandExecutable`](CommandExecutable.md)<`Type`\>
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `Type` | extends [`CommandType`](../enums/CommandType.md) |
|
||||
| `Type` | extends [`CommandType`](../enums/CommandType.md) = [`CommandType`](../enums/CommandType.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`CommandExecutable`](CommandExecutable.md)<`Type`\>
|
||||
|
||||
## Properties
|
||||
|
||||
### execute
|
||||
|
||||
• `Abstract` **execute**: [`CommandModuleDefs`](../modules.md#commandmoduledefs)[`Type`][``"execute"``]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/sern.ts:101](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/sern.ts#L101)
|
||||
|
||||
___
|
||||
|
||||
### onEvent
|
||||
|
||||
• **onEvent**: [`EventPlugin`](../interfaces/EventPlugin.md)<`Type`\>[] = `[]`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/sern.ts:100](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/sern.ts#L100)
|
||||
|
||||
___
|
||||
|
||||
### plugins
|
||||
|
||||
• **plugins**: [`CommandPlugin`](../interfaces/CommandPlugin.md)<`Type`\>[] = `[]`
|
||||
• **plugins**: [`AnyCommandPlugin`](../modules.md#anycommandplugin)[] = `[]`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/sern.ts:99](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/sern.ts#L99)
|
||||
[src/core/modules.ts:80](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L80)
|
||||
|
||||
___
|
||||
|
||||
@@ -62,4 +50,48 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/sern.ts:98](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/sern.ts#L98)
|
||||
[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)
|
||||
|
||||
@@ -6,14 +6,23 @@ sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
**`Since`**
|
||||
|
||||
1.0.0
|
||||
Provides values shared between
|
||||
Message and ChatInputCommandInteraction
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `CoreContext`<`Message`, `ChatInputCommandInteraction`\>
|
||||
|
||||
↳ **`Context`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• `Private` **new Context**(`ctx`)
|
||||
• **new Context**(`ctx`): [`Context`](Context.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -21,9 +30,31 @@ Message and ChatInputCommandInteraction
|
||||
| :------ | :------ |
|
||||
| `ctx` | `Result`<`Message`<`boolean`\>, `ChatInputCommandInteraction`<`CacheType`\>\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`Context`](Context.md)
|
||||
|
||||
#### Overrides
|
||||
|
||||
CoreContext\<Message, ChatInputCommandInteraction\>.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:23](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/context.ts#L23)
|
||||
[src/core/structures/context.ts:29](https://github.com/sern-handler/handler/blob/9d5c6c7/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/9d5c6c7/src/core/structures/context.ts#L29)
|
||||
|
||||
## Accessors
|
||||
|
||||
@@ -37,7 +68,21 @@ Message and ChatInputCommandInteraction
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:51](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/context.ts#L51)
|
||||
[src/core/structures/context.ts:39](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
### channelId
|
||||
|
||||
• `get` **channelId**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/structures/context.ts:45](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
@@ -51,7 +96,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:98](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/context.ts#L98)
|
||||
[src/core/structures/context.ts:91](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L91)
|
||||
|
||||
___
|
||||
|
||||
@@ -65,7 +110,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:67](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/context.ts#L67)
|
||||
[src/core/structures/context.ts:65](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L65)
|
||||
|
||||
___
|
||||
|
||||
@@ -79,7 +124,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:74](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/context.ts#L74)
|
||||
[src/core/structures/context.ts:71](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L71)
|
||||
|
||||
___
|
||||
|
||||
@@ -93,7 +138,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:81](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/context.ts#L81)
|
||||
[src/core/structures/context.ts:77](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L77)
|
||||
|
||||
___
|
||||
|
||||
@@ -107,7 +152,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:44](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/context.ts#L44)
|
||||
[src/core/structures/context.ts:33](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L33)
|
||||
|
||||
___
|
||||
|
||||
@@ -121,25 +166,25 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:105](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/context.ts#L105)
|
||||
[src/core/structures/context.ts:97](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L97)
|
||||
|
||||
___
|
||||
|
||||
### interaction
|
||||
|
||||
• `get` **interaction**(): `ChatInputCommandInteraction`<`CacheType`\>
|
||||
|
||||
Getting the ChatInputCommandInteraction object. Crashes if module type is
|
||||
CommandType.Text or the event fired in a Both command was
|
||||
Message
|
||||
• `get` **interaction**(): `I`
|
||||
|
||||
#### Returns
|
||||
|
||||
`ChatInputCommandInteraction`<`CacheType`\>
|
||||
`I`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
CoreContext.interaction
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:40](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/context.ts#L40)
|
||||
[src/core/structures/core-context.ts:15](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/core-context.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
@@ -153,25 +198,43 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:91](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/context.ts#L91)
|
||||
[src/core/structures/context.ts:85](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L85)
|
||||
|
||||
___
|
||||
|
||||
### message
|
||||
|
||||
• `get` **message**(): `Message`<`boolean`\>
|
||||
|
||||
Getting the Message object. Crashes if module type is
|
||||
CommandType.Slash or the event fired in a Both command was
|
||||
ChatInputCommandInteraction
|
||||
• `get` **message**(): `M`
|
||||
|
||||
#### Returns
|
||||
|
||||
`Message`<`boolean`\>
|
||||
`M`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
CoreContext.message
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:32](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/context.ts#L32)
|
||||
[src/core/structures/core-context.ts:12](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/core-context.ts#L12)
|
||||
|
||||
___
|
||||
|
||||
### options
|
||||
|
||||
• `get` **options**(): `Omit`<`CommandInteractionOptionResolver`<`CacheType`\>, ``"getMessage"`` \| ``"getFocused"``\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Omit`<`CommandInteractionOptionResolver`<`CacheType`\>, ``"getMessage"`` \| ``"getFocused"``\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
CoreContext.options
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/structures/context.ts:26](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
@@ -188,35 +251,57 @@ else, interaction.user
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:60](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/context.ts#L60)
|
||||
[src/core/structures/context.ts:55](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L55)
|
||||
|
||||
___
|
||||
|
||||
### userId
|
||||
|
||||
• `get` **userId**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/structures/context.ts:61](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L61)
|
||||
|
||||
## Methods
|
||||
|
||||
### isMessage
|
||||
|
||||
▸ **isMessage**(): `boolean`
|
||||
▸ **isMessage**(): this is CoreContext<Message<boolean\>, never\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
this is CoreContext<Message<boolean\>, never\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
CoreContext.isMessage
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:111](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/context.ts#L111)
|
||||
[src/core/structures/core-context.ts:19](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/core-context.ts#L19)
|
||||
|
||||
___
|
||||
|
||||
### isSlash
|
||||
|
||||
▸ **isSlash**(): `boolean`
|
||||
▸ **isSlash**(): this is CoreContext<never, ChatInputCommandInteraction<CacheType\>\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
this is CoreContext<never, ChatInputCommandInteraction<CacheType\>\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
CoreContext.isSlash
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:115](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/context.ts#L115)
|
||||
[src/core/structures/core-context.ts:23](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/core-context.ts#L23)
|
||||
|
||||
___
|
||||
|
||||
@@ -228,7 +313,7 @@ ___
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `content` | [`ReplyOptions`](../modules.md#replyoptions) |
|
||||
| `content` | `ReplyOptions` |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -236,24 +321,28 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:126](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/context.ts#L126)
|
||||
[src/core/structures/context.ts:103](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L103)
|
||||
|
||||
___
|
||||
|
||||
### wrap
|
||||
|
||||
▸ `Static` **wrap**(`wrappable`): [`Context`](Context.md)
|
||||
▸ **wrap**(`wrappable`): [`Context`](Context.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `wrappable` | `Message`<`boolean`\> \| `ChatInputCommandInteraction`<`CacheType`\> |
|
||||
| `wrappable` | `Message`<`boolean`\> \| `BaseInteraction`<`CacheType`\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`Context`](Context.md)
|
||||
|
||||
#### Overrides
|
||||
|
||||
CoreContext.wrap
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:119](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/context.ts#L119)
|
||||
[src/core/structures/context.ts:113](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L113)
|
||||
|
||||
@@ -6,6 +6,11 @@ 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)
|
||||
@@ -14,63 +19,63 @@ custom_edit_url: null
|
||||
|
||||
### constructor
|
||||
|
||||
• **new DefaultErrorHandling**()
|
||||
• **new DefaultErrorHandling**(): [`DefaultErrorHandling`](DefaultErrorHandling.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`DefaultErrorHandling`](DefaultErrorHandling.md)
|
||||
|
||||
## Properties
|
||||
|
||||
### keepAlive
|
||||
### #keepAlive
|
||||
|
||||
• **keepAlive**: `number` = `5`
|
||||
|
||||
Number of times the process should throw an error until crashing and exiting
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ErrorHandling](../interfaces/ErrorHandling.md).[keepAlive](../interfaces/ErrorHandling.md#keepalive)
|
||||
• `Private` **#keepAlive**: `number` = `5`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/contracts/errorHandling.ts:25](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/contracts/errorHandling.ts#L25)
|
||||
[src/core/structures/services/error-handling.ts:13](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/error-handling.ts#L13)
|
||||
|
||||
## Methods
|
||||
|
||||
### crash
|
||||
|
||||
▸ **crash**(`error`): `never`
|
||||
|
||||
Utility function to crash
|
||||
▸ **crash**(`err`): `never`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `error` | `Error` |
|
||||
| `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/handler/contracts/errorHandling.ts:26](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/contracts/errorHandling.ts#L26)
|
||||
[src/core/structures/services/error-handling.ts:9](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/error-handling.ts#L9)
|
||||
|
||||
___
|
||||
|
||||
### updateAlive
|
||||
|
||||
▸ **updateAlive**(`e`): `void`
|
||||
▸ **updateAlive**(`err`): `void`
|
||||
|
||||
A function that is called on every crash. Updates keepAlive
|
||||
A function that is called on every throw.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `e` | `Error` |
|
||||
| `err` | `Error` |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -82,4 +87,4 @@ A function that is called on every crash. Updates keepAlive
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/contracts/errorHandling.ts:29](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/contracts/errorHandling.ts#L29)
|
||||
[src/core/structures/services/error-handling.ts:15](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/error-handling.ts#L15)
|
||||
|
||||
@@ -6,6 +6,11 @@ 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)
|
||||
@@ -14,13 +19,17 @@ custom_edit_url: null
|
||||
|
||||
### constructor
|
||||
|
||||
• **new DefaultLogging**()
|
||||
• **new DefaultLogging**(): [`DefaultLogging`](DefaultLogging.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`DefaultLogging`](DefaultLogging.md)
|
||||
|
||||
## Methods
|
||||
|
||||
### date
|
||||
|
||||
▸ `Private` **date**(): `Date`
|
||||
▸ **date**(): `Date`
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -28,7 +37,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/contracts/logging.ts:11](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/contracts/logging.ts#L11)
|
||||
[src/core/structures/services/logger.ts:9](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/logger.ts#L9)
|
||||
|
||||
___
|
||||
|
||||
@@ -40,7 +49,7 @@ ___
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `payload` | [`LogPayload`](../modules.md#logpayload)<`unknown`\> |
|
||||
| `payload` | [`LogPayload`](../modules.md#logpayload) |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -52,7 +61,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/contracts/logging.ts:12](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/contracts/logging.ts#L12)
|
||||
[src/core/structures/services/logger.ts:10](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/logger.ts#L10)
|
||||
|
||||
___
|
||||
|
||||
@@ -64,7 +73,7 @@ ___
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `payload` | [`LogPayload`](../modules.md#logpayload)<`unknown`\> |
|
||||
| `payload` | [`LogPayload`](../modules.md#logpayload) |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -76,7 +85,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/contracts/logging.ts:16](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/contracts/logging.ts#L16)
|
||||
[src/core/structures/services/logger.ts:14](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/logger.ts#L14)
|
||||
|
||||
___
|
||||
|
||||
@@ -88,7 +97,7 @@ ___
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `payload` | [`LogPayload`](../modules.md#logpayload)<`unknown`\> |
|
||||
| `payload` | [`LogPayload`](../modules.md#logpayload) |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -100,7 +109,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/contracts/logging.ts:20](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/contracts/logging.ts#L20)
|
||||
[src/core/structures/services/logger.ts:18](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/logger.ts#L18)
|
||||
|
||||
___
|
||||
|
||||
@@ -112,7 +121,7 @@ ___
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `payload` | [`LogPayload`](../modules.md#logpayload)<`unknown`\> |
|
||||
| `payload` | [`LogPayload`](../modules.md#logpayload) |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -124,4 +133,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/contracts/logging.ts:24](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/contracts/logging.ts#L24)
|
||||
[src/core/structures/services/logger.ts:22](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/logger.ts#L22)
|
||||
|
||||
@@ -6,6 +6,11 @@ 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)
|
||||
@@ -14,23 +19,61 @@ custom_edit_url: null
|
||||
|
||||
### constructor
|
||||
|
||||
• **new DefaultModuleManager**(`moduleStore`)
|
||||
• **new DefaultModuleManager**(`moduleStore`): [`DefaultModuleManager`](DefaultModuleManager.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `moduleStore` | [`ModuleStore`](ModuleStore.md) |
|
||||
| `moduleStore` | [`CoreModuleStore`](../interfaces/CoreModuleStore.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`DefaultModuleManager`](DefaultModuleManager.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/contracts/moduleManager.ts:12](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/contracts/moduleManager.ts#L12)
|
||||
[src/core/structures/services/module-manager.ts:12](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/module-manager.ts#L12)
|
||||
|
||||
## Properties
|
||||
|
||||
### moduleStore
|
||||
|
||||
• `Private` **moduleStore**: [`CoreModuleStore`](../interfaces/CoreModuleStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/structures/services/module-manager.ts:12](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/module-manager.ts#L12)
|
||||
|
||||
## Methods
|
||||
|
||||
### get
|
||||
|
||||
▸ **get**<`T`\>(`strat`): `undefined` \| [`CommandModuleDefs`](../modules.md#commandmoduledefs)[`T`]
|
||||
▸ **get**(`id`): `undefined` \| `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `id` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| `string`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ModuleManager](../interfaces/ModuleManager.md).[get](../interfaces/ModuleManager.md#get)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/structures/services/module-manager.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/module-manager.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### getByNameCommandType
|
||||
|
||||
▸ **getByNameCommandType**<`T`\>(`name`, `commandType`): `undefined` \| `Promise`<[`CommandModuleDefs`](../interfaces/CommandModuleDefs.md)[`T`]\>
|
||||
|
||||
#### Type parameters
|
||||
|
||||
@@ -42,31 +85,75 @@ custom_edit_url: null
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `strat` | (`ms`: [`ModuleStore`](ModuleStore.md)) => `undefined` \| [`CommandModuleDefs`](../modules.md#commandmoduledefs)[`T`] |
|
||||
| `name` | `string` |
|
||||
| `commandType` | `T` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`CommandModuleDefs`](../modules.md#commandmoduledefs)[`T`]
|
||||
`undefined` \| `Promise`<[`CommandModuleDefs`](../interfaces/CommandModuleDefs.md)[`T`]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ModuleManager](../interfaces/ModuleManager.md).[get](../interfaces/ModuleManager.md#get)
|
||||
[ModuleManager](../interfaces/ModuleManager.md).[getByNameCommandType](../interfaces/ModuleManager.md#getbynamecommandtype)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/contracts/moduleManager.ts:13](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/contracts/moduleManager.ts#L13)
|
||||
[src/core/structures/services/module-manager.ts:15](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/module-manager.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
### set
|
||||
### getMetadata
|
||||
|
||||
▸ **set**(`strat`): `void`
|
||||
▸ **getMetadata**(`m`): `CommandMeta`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `strat` | (`ms`: [`ModuleStore`](ModuleStore.md)) => `void` |
|
||||
| `m` | `Module` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`CommandMeta`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ModuleManager](../interfaces/ModuleManager.md).[getMetadata](../interfaces/ModuleManager.md#getmetadata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/structures/services/module-manager.ts:27](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/module-manager.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
### getPublishableCommands
|
||||
|
||||
▸ **getPublishableCommands**(): `Promise`<[`CommandModule`](../modules.md#commandmodule)[]\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`CommandModule`](../modules.md#commandmodule)[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ModuleManager](../interfaces/ModuleManager.md).[getPublishableCommands](../interfaces/ModuleManager.md#getpublishablecommands)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/structures/services/module-manager.ts:42](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/module-manager.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
### set
|
||||
|
||||
▸ **set**(`id`, `path`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `id` | `string` |
|
||||
| `path` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -78,4 +165,29 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/contracts/moduleManager.ts:17](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/contracts/moduleManager.ts#L17)
|
||||
[src/core/structures/services/module-manager.ts:38](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/module-manager.ts#L38)
|
||||
|
||||
___
|
||||
|
||||
### 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:23](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/module-manager.ts#L23)
|
||||
|
||||
@@ -6,6 +6,10 @@ sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
**`Deprecated`**
|
||||
|
||||
Will be removed in future
|
||||
|
||||
## Type parameters
|
||||
|
||||
| Name | Type |
|
||||
@@ -16,7 +20,7 @@ custom_edit_url: null
|
||||
|
||||
### constructor
|
||||
|
||||
• **new EventExecutable**<`Type`\>()
|
||||
• **new EventExecutable**<`Type`\>(): [`EventExecutable`](EventExecutable.md)<`Type`\>
|
||||
|
||||
#### Type parameters
|
||||
|
||||
@@ -24,35 +28,19 @@ custom_edit_url: null
|
||||
| :------ | :------ |
|
||||
| `Type` | extends [`EventType`](../enums/EventType.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`EventExecutable`](EventExecutable.md)<`Type`\>
|
||||
|
||||
## Properties
|
||||
|
||||
### execute
|
||||
|
||||
• `Abstract` **execute**: [`EventModuleDefs`](../modules.md#eventmoduledefs)[`Type`][``"execute"``]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/sern.ts:108](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/sern.ts#L108)
|
||||
|
||||
___
|
||||
|
||||
### onEvent
|
||||
|
||||
• **onEvent**: [`EventModuleEventPluginDefs`](../modules.md#eventmoduleeventplugindefs)[`Type`][] = `[]`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/sern.ts:107](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/sern.ts#L107)
|
||||
|
||||
___
|
||||
|
||||
### plugins
|
||||
|
||||
• **plugins**: [`EventModuleCommandPluginDefs`](../modules.md#eventmodulecommandplugindefs)[`Type`][] = `[]`
|
||||
• **plugins**: [`AnyEventPlugin`](../modules.md#anyeventplugin)[] = `[]`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/sern.ts:106](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/sern.ts#L106)
|
||||
[src/core/modules.ts:101](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L101)
|
||||
|
||||
___
|
||||
|
||||
@@ -62,4 +50,48 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/sern.ts:105](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/sern.ts#L105)
|
||||
[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)
|
||||
|
||||
@@ -6,80 +6,46 @@ sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Storing all command modules
|
||||
This dependency is usually injected into ModuleManager
|
||||
Represents a core module store that stores IDs mapped to file paths.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`CoreModuleStore`](../interfaces/CoreModuleStore.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new ModuleStore**()
|
||||
• **new ModuleStore**(): [`ModuleStore`](ModuleStore.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ModuleStore`](ModuleStore.md)
|
||||
|
||||
## Properties
|
||||
|
||||
### ApplicationCommands
|
||||
### commands
|
||||
|
||||
• `Readonly` **ApplicationCommands**: `Object`
|
||||
• **commands**: `Map`<`string`, `string`\>
|
||||
|
||||
#### Type declaration
|
||||
#### Implementation of
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `1` | `Map`<`string`, [`CommandModule`](../modules.md#commandmodule)\> |
|
||||
| `2` | `Map`<`string`, [`CommandModule`](../modules.md#commandmodule)\> |
|
||||
| `3` | `Map`<`string`, [`CommandModule`](../modules.md#commandmodule)\> |
|
||||
[CoreModuleStore](../interfaces/CoreModuleStore.md).[commands](../interfaces/CoreModuleStore.md#commands)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/moduleStore.ts:10](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/moduleStore.ts#L10)
|
||||
[src/core/structures/module-store.ts:11](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/module-store.ts#L11)
|
||||
|
||||
___
|
||||
|
||||
### BothCommands
|
||||
### metadata
|
||||
|
||||
• `Readonly` **BothCommands**: `Map`<`string`, [`CommandModule`](../modules.md#commandmodule)\>
|
||||
• **metadata**: `WeakMap`<`Module`, `CommandMeta`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[CoreModuleStore](../interfaces/CoreModuleStore.md).[metadata](../interfaces/CoreModuleStore.md#metadata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/moduleStore.ts:9](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/moduleStore.ts#L9)
|
||||
|
||||
___
|
||||
|
||||
### InteractionHandlers
|
||||
|
||||
• `Readonly` **InteractionHandlers**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `2` | `Map`<`string`, [`CommandModule`](../modules.md#commandmodule)\> |
|
||||
| `3` | `Map`<`string`, [`CommandModule`](../modules.md#commandmodule)\> |
|
||||
| `5` | `Map`<`string`, [`CommandModule`](../modules.md#commandmodule)\> |
|
||||
| `6` | `Map`<`string`, [`CommandModule`](../modules.md#commandmodule)\> |
|
||||
| `7` | `Map`<`string`, [`CommandModule`](../modules.md#commandmodule)\> |
|
||||
| `8` | `Map`<`string`, [`CommandModule`](../modules.md#commandmodule)\> |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/moduleStore.ts:17](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/moduleStore.ts#L17)
|
||||
|
||||
___
|
||||
|
||||
### ModalSubmit
|
||||
|
||||
• `Readonly` **ModalSubmit**: `Map`<`string`, [`CommandModule`](../modules.md#commandmodule)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/moduleStore.ts:15](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/moduleStore.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
### TextCommands
|
||||
|
||||
• `Readonly` **TextCommands**: `Map`<`string`, [`CommandModule`](../modules.md#commandmodule)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/moduleStore.ts:16](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/moduleStore.ts#L16)
|
||||
[src/core/structures/module-store.ts:10](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/module-store.ts#L10)
|
||||
|
||||
@@ -6,6 +6,10 @@ sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
**`Since`**
|
||||
|
||||
1.0.0
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `EventEmitter`
|
||||
@@ -16,21 +20,19 @@ custom_edit_url: null
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SernEmitter**(`options?`)
|
||||
• **new SernEmitter**(): [`SernEmitter`](SernEmitter.md)
|
||||
|
||||
#### Parameters
|
||||
#### Returns
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `options?` | `EventEmitterOptions` |
|
||||
[`SernEmitter`](SernEmitter.md)
|
||||
|
||||
#### Inherited from
|
||||
#### Overrides
|
||||
|
||||
EventEmitter.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:74
|
||||
[src/core/structures/sern-emitter.ts:10](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/sern-emitter.ts#L10)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -44,7 +46,7 @@ EventEmitter.captureRejectionSymbol
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:291
|
||||
node_modules/@types/node/events.d.ts:357
|
||||
|
||||
___
|
||||
|
||||
@@ -60,7 +62,7 @@ EventEmitter.captureRejections
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:296
|
||||
node_modules/@types/node/events.d.ts:362
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +76,7 @@ EventEmitter.defaultMaxListeners
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:297
|
||||
node_modules/@types/node/events.d.ts:363
|
||||
|
||||
___
|
||||
|
||||
@@ -96,7 +98,7 @@ EventEmitter.errorMonitor
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:290
|
||||
node_modules/@types/node/events.d.ts:356
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -106,10 +108,6 @@ node_modules/@types/node/events.d.ts:290
|
||||
|
||||
Alias for `emitter.on(eventName, listener)`.
|
||||
|
||||
**`Since`**
|
||||
|
||||
v0.1.26
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
@@ -121,19 +119,23 @@ v0.1.26
|
||||
|
||||
[`SernEmitter`](SernEmitter.md)
|
||||
|
||||
**`Since`**
|
||||
|
||||
v0.1.26
|
||||
|
||||
#### Inherited from
|
||||
|
||||
EventEmitter.addListener
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:317
|
||||
node_modules/@types/node/events.d.ts:383
|
||||
|
||||
___
|
||||
|
||||
### emit
|
||||
|
||||
▸ **emit**<`T`\>(`eventName`, ...`args`): `boolean`
|
||||
▸ **emit**<`T`\>(`eventName`, `...args`): `boolean`
|
||||
|
||||
Listening to sern events with on. This event stays on until a crash or a normal exit
|
||||
|
||||
@@ -141,14 +143,14 @@ Listening to sern events with on. This event stays on until a crash or a normal
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `T` | extends keyof [`SernEventsMapping`](../modules.md#serneventsmapping) |
|
||||
| `T` | extends keyof [`SernEventsMapping`](../interfaces/SernEventsMapping.md) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `eventName` | `T` | |
|
||||
| `...args` | [`SernEventsMapping`](../modules.md#serneventsmapping)[`T`] | the arguments for emitting the eventName |
|
||||
| `...args` | [`SernEventsMapping`](../interfaces/SernEventsMapping.md)[`T`] | the arguments for emitting the eventName |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -160,7 +162,7 @@ EventEmitter.emit
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/sernEmitter.ts:32](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/sernEmitter.ts#L32)
|
||||
[src/core/structures/sern-emitter.ts:40](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/sern-emitter.ts#L40)
|
||||
|
||||
___
|
||||
|
||||
@@ -184,21 +186,21 @@ console.log(myEE.eventNames());
|
||||
// Prints: [ 'foo', 'bar', Symbol(symbol) ]
|
||||
```
|
||||
|
||||
**`Since`**
|
||||
|
||||
v6.0.0
|
||||
|
||||
#### Returns
|
||||
|
||||
(`string` \| `symbol`)[]
|
||||
|
||||
**`Since`**
|
||||
|
||||
v6.0.0
|
||||
|
||||
#### Inherited from
|
||||
|
||||
EventEmitter.eventNames
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:632
|
||||
node_modules/@types/node/events.d.ts:702
|
||||
|
||||
___
|
||||
|
||||
@@ -209,51 +211,55 @@ ___
|
||||
Returns the current max listener value for the `EventEmitter` which is either
|
||||
set by `emitter.setMaxListeners(n)` or defaults to [defaultMaxListeners](SernEmitter.md#defaultmaxlisteners).
|
||||
|
||||
**`Since`**
|
||||
|
||||
v1.0.0
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`
|
||||
|
||||
**`Since`**
|
||||
|
||||
v1.0.0
|
||||
|
||||
#### Inherited from
|
||||
|
||||
EventEmitter.getMaxListeners
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:489
|
||||
node_modules/@types/node/events.d.ts:555
|
||||
|
||||
___
|
||||
|
||||
### listenerCount
|
||||
|
||||
▸ **listenerCount**(`eventName`): `number`
|
||||
▸ **listenerCount**(`eventName`, `listener?`): `number`
|
||||
|
||||
Returns the number of listeners listening to the event named `eventName`.
|
||||
|
||||
**`Since`**
|
||||
|
||||
v3.2.0
|
||||
If `listener` is provided, it will return how many times the listener
|
||||
is found in the list of the listeners of the event.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `eventName` | `string` \| `symbol` | The name of the event being listened for |
|
||||
| `listener?` | `Function` | The event handler function |
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`
|
||||
|
||||
**`Since`**
|
||||
|
||||
v3.2.0
|
||||
|
||||
#### Inherited from
|
||||
|
||||
EventEmitter.listenerCount
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:579
|
||||
node_modules/@types/node/events.d.ts:649
|
||||
|
||||
___
|
||||
|
||||
@@ -271,10 +277,6 @@ console.log(util.inspect(server.listeners('connection')));
|
||||
// Prints: [ [Function] ]
|
||||
```
|
||||
|
||||
**`Since`**
|
||||
|
||||
v0.1.26
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
@@ -285,13 +287,17 @@ v0.1.26
|
||||
|
||||
`Function`[]
|
||||
|
||||
**`Since`**
|
||||
|
||||
v0.1.26
|
||||
|
||||
#### Inherited from
|
||||
|
||||
EventEmitter.listeners
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:502
|
||||
node_modules/@types/node/events.d.ts:568
|
||||
|
||||
___
|
||||
|
||||
@@ -301,10 +307,6 @@ ___
|
||||
|
||||
Alias for `emitter.removeListener()`.
|
||||
|
||||
**`Since`**
|
||||
|
||||
v10.0.0
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
@@ -316,13 +318,17 @@ v10.0.0
|
||||
|
||||
[`SernEmitter`](SernEmitter.md)
|
||||
|
||||
**`Since`**
|
||||
|
||||
v10.0.0
|
||||
|
||||
#### Inherited from
|
||||
|
||||
EventEmitter.off
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:462
|
||||
node_modules/@types/node/events.d.ts:528
|
||||
|
||||
___
|
||||
|
||||
@@ -336,14 +342,14 @@ Listening to sern events with on. This event stays on until a crash or a normal
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `T` | extends keyof [`SernEventsMapping`](../modules.md#serneventsmapping) |
|
||||
| `T` | extends keyof [`SernEventsMapping`](../interfaces/SernEventsMapping.md) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `eventName` | `T` | |
|
||||
| `listener` | (...`args`: [`SernEventsMapping`](../modules.md#serneventsmapping)[`T`][]) => `void` | what to do with the data |
|
||||
| `listener` | (...`args`: [`SernEventsMapping`](../interfaces/SernEventsMapping.md)[`T`][]) => `void` | what to do with the data |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -355,7 +361,7 @@ EventEmitter.on
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/sernEmitter.ts:10](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/sernEmitter.ts#L10)
|
||||
[src/core/structures/sern-emitter.ts:18](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/sern-emitter.ts#L18)
|
||||
|
||||
___
|
||||
|
||||
@@ -369,14 +375,14 @@ Listening to sern events with on. This event stays on until a crash or a normal
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `T` | extends keyof [`SernEventsMapping`](../modules.md#serneventsmapping) |
|
||||
| `T` | extends keyof [`SernEventsMapping`](../interfaces/SernEventsMapping.md) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `eventName` | `T` | |
|
||||
| `listener` | (...`args`: [`SernEventsMapping`](../modules.md#serneventsmapping)[`T`][]) => `void` | what to do with the data |
|
||||
| `listener` | (...`args`: [`SernEventsMapping`](../interfaces/SernEventsMapping.md)[`T`][]) => `void` | what to do with the data |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -388,7 +394,7 @@ EventEmitter.once
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/sernEmitter.ts:21](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/sernEmitter.ts#L21)
|
||||
[src/core/structures/sern-emitter.ts:29](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/sern-emitter.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
@@ -409,10 +415,6 @@ server.prependListener('connection', (stream) => {
|
||||
|
||||
Returns a reference to the `EventEmitter`, so that calls can be chained.
|
||||
|
||||
**`Since`**
|
||||
|
||||
v6.0.0
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
@@ -424,13 +426,17 @@ v6.0.0
|
||||
|
||||
[`SernEmitter`](SernEmitter.md)
|
||||
|
||||
**`Since`**
|
||||
|
||||
v6.0.0
|
||||
|
||||
#### Inherited from
|
||||
|
||||
EventEmitter.prependListener
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:597
|
||||
node_modules/@types/node/events.d.ts:667
|
||||
|
||||
___
|
||||
|
||||
@@ -449,10 +455,6 @@ server.prependOnceListener('connection', (stream) => {
|
||||
|
||||
Returns a reference to the `EventEmitter`, so that calls can be chained.
|
||||
|
||||
**`Since`**
|
||||
|
||||
v6.0.0
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
@@ -464,13 +466,17 @@ v6.0.0
|
||||
|
||||
[`SernEmitter`](SernEmitter.md)
|
||||
|
||||
**`Since`**
|
||||
|
||||
v6.0.0
|
||||
|
||||
#### Inherited from
|
||||
|
||||
EventEmitter.prependOnceListener
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:613
|
||||
node_modules/@types/node/events.d.ts:683
|
||||
|
||||
___
|
||||
|
||||
@@ -505,10 +511,6 @@ newListeners[0]();
|
||||
emitter.emit('log');
|
||||
```
|
||||
|
||||
**`Since`**
|
||||
|
||||
v9.4.0
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
@@ -519,13 +521,17 @@ v9.4.0
|
||||
|
||||
`Function`[]
|
||||
|
||||
**`Since`**
|
||||
|
||||
v9.4.0
|
||||
|
||||
#### Inherited from
|
||||
|
||||
EventEmitter.rawListeners
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:532
|
||||
node_modules/@types/node/events.d.ts:598
|
||||
|
||||
___
|
||||
|
||||
@@ -541,10 +547,6 @@ component or module (e.g. sockets or file streams).
|
||||
|
||||
Returns a reference to the `EventEmitter`, so that calls can be chained.
|
||||
|
||||
**`Since`**
|
||||
|
||||
v0.1.26
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
@@ -555,13 +557,17 @@ v0.1.26
|
||||
|
||||
[`SernEmitter`](SernEmitter.md)
|
||||
|
||||
**`Since`**
|
||||
|
||||
v0.1.26
|
||||
|
||||
#### Inherited from
|
||||
|
||||
EventEmitter.removeAllListeners
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:473
|
||||
node_modules/@types/node/events.d.ts:539
|
||||
|
||||
___
|
||||
|
||||
@@ -646,10 +652,6 @@ ee.emit('ping');
|
||||
|
||||
Returns a reference to the `EventEmitter`, so that calls can be chained.
|
||||
|
||||
**`Since`**
|
||||
|
||||
v0.1.26
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
@@ -661,13 +663,17 @@ v0.1.26
|
||||
|
||||
[`SernEmitter`](SernEmitter.md)
|
||||
|
||||
**`Since`**
|
||||
|
||||
v0.1.26
|
||||
|
||||
#### Inherited from
|
||||
|
||||
EventEmitter.removeListener
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:457
|
||||
node_modules/@types/node/events.d.ts:523
|
||||
|
||||
___
|
||||
|
||||
@@ -682,10 +688,6 @@ modified for this specific `EventEmitter` instance. The value can be set to`Infi
|
||||
|
||||
Returns a reference to the `EventEmitter`, so that calls can be chained.
|
||||
|
||||
**`Since`**
|
||||
|
||||
v0.3.5
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
@@ -696,19 +698,52 @@ v0.3.5
|
||||
|
||||
[`SernEmitter`](SernEmitter.md)
|
||||
|
||||
**`Since`**
|
||||
|
||||
v0.3.5
|
||||
|
||||
#### Inherited from
|
||||
|
||||
EventEmitter.setMaxListeners
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:483
|
||||
node_modules/@types/node/events.d.ts:549
|
||||
|
||||
___
|
||||
|
||||
### failure
|
||||
|
||||
▸ **failure**(`module?`, `reason?`): `Object`
|
||||
|
||||
Creates a compliant SernEmitter failure payload
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `module?` | `Module` |
|
||||
| `reason?` | `unknown` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `module?` | `AnyModule` |
|
||||
| `reason` | `string` \| `Error` |
|
||||
| `type` | [`Failure`](../enums/PayloadType.md#failure) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/structures/sern-emitter.ts:59](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/sern-emitter.ts#L59)
|
||||
|
||||
___
|
||||
|
||||
### getEventListeners
|
||||
|
||||
▸ `Static` **getEventListeners**(`emitter`, `name`): `Function`[]
|
||||
▸ **getEventListeners**(`emitter`, `name`): `Function`[]
|
||||
|
||||
Returns a copy of the array of listeners for the event named `eventName`.
|
||||
|
||||
@@ -735,34 +770,88 @@ const { getEventListeners, EventEmitter } = require('events');
|
||||
}
|
||||
```
|
||||
|
||||
**`Since`**
|
||||
|
||||
v15.2.0, v14.17.0
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `emitter` | `EventEmitter` \| `DOMEventTarget` |
|
||||
| `emitter` | `EventEmitter` \| `_DOMEventTarget` |
|
||||
| `name` | `string` \| `symbol` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Function`[]
|
||||
|
||||
**`Since`**
|
||||
|
||||
v15.2.0, v14.17.0
|
||||
|
||||
#### Inherited from
|
||||
|
||||
EventEmitter.getEventListeners
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:262
|
||||
node_modules/@types/node/events.d.ts:299
|
||||
|
||||
___
|
||||
|
||||
### getMaxListeners
|
||||
|
||||
▸ **getMaxListeners**(`emitter`): `number`
|
||||
|
||||
Returns the currently set max amount of listeners.
|
||||
|
||||
For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on
|
||||
the emitter.
|
||||
|
||||
For `EventTarget`s this is the only way to get the max event listeners for the
|
||||
event target. If the number of event handlers on a single EventTarget exceeds
|
||||
the max set, the EventTarget will print a warning.
|
||||
|
||||
```js
|
||||
import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events';
|
||||
|
||||
{
|
||||
const ee = new EventEmitter();
|
||||
console.log(getMaxListeners(ee)); // 10
|
||||
setMaxListeners(11, ee);
|
||||
console.log(getMaxListeners(ee)); // 11
|
||||
}
|
||||
{
|
||||
const et = new EventTarget();
|
||||
console.log(getMaxListeners(et)); // 10
|
||||
setMaxListeners(11, et);
|
||||
console.log(getMaxListeners(et)); // 11
|
||||
}
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `emitter` | `EventEmitter` \| `_DOMEventTarget` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`
|
||||
|
||||
**`Since`**
|
||||
|
||||
v18.17.0
|
||||
|
||||
#### Inherited from
|
||||
|
||||
EventEmitter.getMaxListeners
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:328
|
||||
|
||||
___
|
||||
|
||||
### listenerCount
|
||||
|
||||
▸ `Static` **listenerCount**(`emitter`, `eventName`): `number`
|
||||
▸ **listenerCount**(`emitter`, `eventName`): `number`
|
||||
|
||||
A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
|
||||
|
||||
@@ -775,14 +864,6 @@ console.log(listenerCount(myEmitter, 'event'));
|
||||
// Prints: 2
|
||||
```
|
||||
|
||||
**`Since`**
|
||||
|
||||
v0.9.12
|
||||
|
||||
**`Deprecated`**
|
||||
|
||||
Since v3.2.0 - Use `listenerCount` instead.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
@@ -794,19 +875,27 @@ Since v3.2.0 - Use `listenerCount` instead.
|
||||
|
||||
`number`
|
||||
|
||||
**`Since`**
|
||||
|
||||
v0.9.12
|
||||
|
||||
**`Deprecated`**
|
||||
|
||||
Since v3.2.0 - Use `listenerCount` instead.
|
||||
|
||||
#### Inherited from
|
||||
|
||||
EventEmitter.listenerCount
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:234
|
||||
node_modules/@types/node/events.d.ts:271
|
||||
|
||||
___
|
||||
|
||||
### on
|
||||
|
||||
▸ `Static` **on**(`emitter`, `eventName`, `options?`): `AsyncIterableIterator`<`any`\>
|
||||
▸ **on**(`emitter`, `eventName`, `options?`): `AsyncIterableIterator`<`any`\>
|
||||
|
||||
```js
|
||||
const { on, EventEmitter } = require('events');
|
||||
@@ -862,10 +951,6 @@ const ac = new AbortController();
|
||||
process.nextTick(() => ac.abort());
|
||||
```
|
||||
|
||||
**`Since`**
|
||||
|
||||
v13.6.0, v12.16.0
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
@@ -880,33 +965,37 @@ v13.6.0, v12.16.0
|
||||
|
||||
that iterates `eventName` events emitted by the `emitter`
|
||||
|
||||
**`Since`**
|
||||
|
||||
v13.6.0, v12.16.0
|
||||
|
||||
#### Inherited from
|
||||
|
||||
EventEmitter.on
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:217
|
||||
node_modules/@types/node/events.d.ts:254
|
||||
|
||||
▸ `Static` **on**<`E`, `K`\>(`eventEmitter`, `eventName`): `AsyncIterableIterator`<`E` extends `Client`<`boolean`\> ? `ClientEvents`[`K`] : `any`\>
|
||||
▸ **on**<`Emitter`, `Events`\>(`eventEmitter`, `eventName`): `AsyncIterableIterator`<`Emitter` extends `Client`<`boolean`\> ? `ClientEvents`[`Events`] : `any`\>
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `E` | extends `__module` |
|
||||
| `K` | extends keyof `ClientEvents` |
|
||||
| `Emitter` | extends `__module` |
|
||||
| `Events` | extends keyof `ClientEvents` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `eventEmitter` | `E` |
|
||||
| `eventName` | `E` extends `Client`<`boolean`\> ? `K` : `string` |
|
||||
| `eventEmitter` | `Emitter` |
|
||||
| `eventName` | `Emitter` extends `Client`<`boolean`\> ? `Events` : `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`AsyncIterableIterator`<`E` extends `Client`<`boolean`\> ? `ClientEvents`[`K`] : `any`\>
|
||||
`AsyncIterableIterator`<`Emitter` extends `Client`<`boolean`\> ? `ClientEvents`[`Events`] : `any`\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
@@ -914,13 +1003,13 @@ EventEmitter.on
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/discord.js/typings/index.d.ts:222
|
||||
node_modules/discord.js/typings/index.d.ts:243
|
||||
|
||||
___
|
||||
|
||||
### once
|
||||
|
||||
▸ `Static` **once**(`emitter`, `eventName`, `options?`): `Promise`<`any`[]\>
|
||||
▸ **once**(`emitter`, `eventName`, `options?`): `Promise`<`any`[]\>
|
||||
|
||||
Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given
|
||||
event or that is rejected if the `EventEmitter` emits `'error'` while waiting.
|
||||
@@ -1002,15 +1091,11 @@ ac.abort(); // Abort waiting for the event
|
||||
ee.emit('foo'); // Prints: Waiting for the event was canceled!
|
||||
```
|
||||
|
||||
**`Since`**
|
||||
|
||||
v11.13.0, v10.16.0
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `emitter` | `NodeEventTarget` |
|
||||
| `emitter` | `_NodeEventTarget` |
|
||||
| `eventName` | `string` \| `symbol` |
|
||||
| `options?` | `StaticEventEmitterOptions` |
|
||||
|
||||
@@ -1018,21 +1103,25 @@ v11.13.0, v10.16.0
|
||||
|
||||
`Promise`<`any`[]\>
|
||||
|
||||
**`Since`**
|
||||
|
||||
v11.13.0, v10.16.0
|
||||
|
||||
#### Inherited from
|
||||
|
||||
EventEmitter.once
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:157
|
||||
node_modules/@types/node/events.d.ts:194
|
||||
|
||||
▸ `Static` **once**(`emitter`, `eventName`, `options?`): `Promise`<`any`[]\>
|
||||
▸ **once**(`emitter`, `eventName`, `options?`): `Promise`<`any`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `emitter` | `DOMEventTarget` |
|
||||
| `emitter` | `_DOMEventTarget` |
|
||||
| `eventName` | `string` |
|
||||
| `options?` | `StaticEventEmitterOptions` |
|
||||
|
||||
@@ -1046,27 +1135,27 @@ EventEmitter.once
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:158
|
||||
node_modules/@types/node/events.d.ts:195
|
||||
|
||||
▸ `Static` **once**<`E`, `K`\>(`eventEmitter`, `eventName`): `Promise`<`E` extends `Client`<`boolean`\> ? `ClientEvents`[`K`] : `any`[]\>
|
||||
▸ **once**<`Emitter`, `Event`\>(`eventEmitter`, `eventName`): `Promise`<`Emitter` extends `Client`<`boolean`\> ? `ClientEvents`[`Event`] : `any`[]\>
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `E` | extends `__module` |
|
||||
| `K` | extends keyof `ClientEvents` |
|
||||
| `Emitter` | extends `__module` |
|
||||
| `Event` | extends keyof `ClientEvents` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `eventEmitter` | `E` |
|
||||
| `eventName` | `E` extends `Client`<`boolean`\> ? `K` : `string` |
|
||||
| `eventEmitter` | `Emitter` |
|
||||
| `eventName` | `Emitter` extends `Client`<`boolean`\> ? `Event` : `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`E` extends `Client`<`boolean`\> ? `ClientEvents`[`K`] : `any`[]\>
|
||||
`Promise`<`Emitter` extends `Client`<`boolean`\> ? `ClientEvents`[`Event`] : `any`[]\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
@@ -1074,13 +1163,41 @@ EventEmitter.once
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/discord.js/typings/index.d.ts:218
|
||||
node_modules/discord.js/typings/index.d.ts:239
|
||||
|
||||
___
|
||||
|
||||
### payload
|
||||
|
||||
▸ **payload**<`T`\>(`type`, `module?`, `reason?`): `T`
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `T` | extends [`Payload`](../modules.md#payload) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `type` | [`PayloadType`](../enums/PayloadType.md) |
|
||||
| `module?` | `Module` |
|
||||
| `reason?` | `unknown` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`T`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/structures/sern-emitter.ts:46](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/sern-emitter.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
### setMaxListeners
|
||||
|
||||
▸ `Static` **setMaxListeners**(`n?`, ...`eventTargets`): `void`
|
||||
▸ **setMaxListeners**(`n?`, `...eventTargets`): `void`
|
||||
|
||||
```js
|
||||
const {
|
||||
@@ -1094,25 +1211,79 @@ const emitter = new EventEmitter();
|
||||
setMaxListeners(5, target, emitter);
|
||||
```
|
||||
|
||||
**`Since`**
|
||||
|
||||
v15.4.0
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `n?` | `number` | A non-negative number. The maximum number of listeners per `EventTarget` event. |
|
||||
| `...eventTargets` | (`EventEmitter` \| `DOMEventTarget`)[] | - |
|
||||
| `...eventTargets` | (`EventEmitter` \| `_DOMEventTarget`)[] | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
**`Since`**
|
||||
|
||||
v15.4.0
|
||||
|
||||
#### Inherited from
|
||||
|
||||
EventEmitter.setMaxListeners
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/@types/node/events.d.ts:280
|
||||
node_modules/@types/node/events.d.ts:346
|
||||
|
||||
___
|
||||
|
||||
### success
|
||||
|
||||
▸ **success**(`module`): `Object`
|
||||
|
||||
Creates a compliant SernEmitter module success payload
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `module` | `Module` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `module` | `AnyModule` |
|
||||
| `type` | [`Success`](../enums/PayloadType.md#success) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/structures/sern-emitter.ts:72](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/sern-emitter.ts#L72)
|
||||
|
||||
___
|
||||
|
||||
### warning
|
||||
|
||||
▸ **warning**(`reason`): `Object`
|
||||
|
||||
Creates a compliant SernEmitter module warning payload
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `reason` | `unknown` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `reason` | `string` |
|
||||
| `type` | [`Warning`](../enums/PayloadType.md#warning) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/structures/sern-emitter.ts:82](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/sern-emitter.ts#L82)
|
||||
|
||||
@@ -6,6 +6,9 @@ sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
**`Since`**
|
||||
|
||||
1.0.0
|
||||
A bitfield that discriminates command modules
|
||||
|
||||
**`Example`**
|
||||
@@ -27,11 +30,9 @@ export default commandModule({
|
||||
|
||||
• **Both** = ``3``
|
||||
|
||||
The CommandType for hybrid commands, text and slash
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:28](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/enums.ts#L28)
|
||||
[src/core/structures/enums.ts:20](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L20)
|
||||
|
||||
___
|
||||
|
||||
@@ -39,23 +40,19 @@ ___
|
||||
|
||||
• **Button** = ``16``
|
||||
|
||||
The CommandType for ButtonInteraction commands
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:40](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/enums.ts#L40)
|
||||
[src/core/structures/enums.ts:23](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L23)
|
||||
|
||||
___
|
||||
|
||||
### ChannelSelect
|
||||
|
||||
• **ChannelSelect** = ``256``
|
||||
|
||||
The CommandType for the other SelectMenuInteractions
|
||||
• **ChannelSelect** = ``1024``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:52](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/enums.ts#L52)
|
||||
[src/core/structures/enums.ts:29](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
@@ -63,11 +60,9 @@ ___
|
||||
|
||||
• **CtxMsg** = ``8``
|
||||
|
||||
The CommandType for MessageContextMenuInteraction commands
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:36](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/enums.ts#L36)
|
||||
[src/core/structures/enums.ts:22](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L22)
|
||||
|
||||
___
|
||||
|
||||
@@ -75,11 +70,9 @@ ___
|
||||
|
||||
• **CtxUser** = ``4``
|
||||
|
||||
The CommandType for UserContextMenuInteraction commands
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:32](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/enums.ts#L32)
|
||||
[src/core/structures/enums.ts:21](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
@@ -89,7 +82,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:53](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/enums.ts#L53)
|
||||
[src/core/structures/enums.ts:28](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L28)
|
||||
|
||||
___
|
||||
|
||||
@@ -97,21 +90,19 @@ ___
|
||||
|
||||
• **Modal** = ``64``
|
||||
|
||||
The CommandType for ModalSubmitInteraction commands
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:48](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/enums.ts#L48)
|
||||
[src/core/structures/enums.ts:25](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L25)
|
||||
|
||||
___
|
||||
|
||||
### RoleSelect
|
||||
|
||||
• **RoleSelect** = ``1024``
|
||||
• **RoleSelect** = ``256``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:54](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/enums.ts#L54)
|
||||
[src/core/structures/enums.ts:27](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
@@ -119,11 +110,9 @@ ___
|
||||
|
||||
• **Slash** = ``2``
|
||||
|
||||
The CommandType for slash commands
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:24](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/enums.ts#L24)
|
||||
[src/core/structures/enums.ts:19](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L19)
|
||||
|
||||
___
|
||||
|
||||
@@ -131,11 +120,9 @@ ___
|
||||
|
||||
• **StringSelect** = ``32``
|
||||
|
||||
The CommandType for StringSelectMenuInteraction commands
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:44](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/enums.ts#L44)
|
||||
[src/core/structures/enums.ts:24](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L24)
|
||||
|
||||
___
|
||||
|
||||
@@ -143,18 +130,16 @@ ___
|
||||
|
||||
• **Text** = ``1``
|
||||
|
||||
The CommandType for text commands
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:20](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/enums.ts#L20)
|
||||
[src/core/structures/enums.ts:18](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L18)
|
||||
|
||||
___
|
||||
|
||||
### UserSelect
|
||||
|
||||
• **UserSelect** = ``2048``
|
||||
• **UserSelect** = ``128``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:55](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/enums.ts#L55)
|
||||
[src/core/structures/enums.ts:26](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L26)
|
||||
|
||||
@@ -31,7 +31,7 @@ The EventType for handling discord events
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:77](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/enums.ts#L77)
|
||||
[src/core/structures/enums.ts:51](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L51)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,7 +44,7 @@ Could be for example, `process` events, database events
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:86](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/enums.ts#L86)
|
||||
[src/core/structures/enums.ts:60](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L60)
|
||||
|
||||
___
|
||||
|
||||
@@ -56,4 +56,4 @@ The EventType for handling sern events
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:81](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/enums.ts#L81)
|
||||
[src/core/structures/enums.ts:55](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L55)
|
||||
|
||||
@@ -16,7 +16,7 @@ The PayloadType for a SernEmitter failure event
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:124](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/enums.ts#L124)
|
||||
[src/core/structures/enums.ts:98](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L98)
|
||||
|
||||
___
|
||||
|
||||
@@ -28,7 +28,7 @@ The PayloadType for a SernEmitter success event
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:120](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/enums.ts#L120)
|
||||
[src/core/structures/enums.ts:94](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L94)
|
||||
|
||||
___
|
||||
|
||||
@@ -40,4 +40,4 @@ The PayloadType for a SernEmitter warning event
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:128](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/enums.ts#L128)
|
||||
[src/core/structures/enums.ts:102](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L102)
|
||||
|
||||
@@ -22,24 +22,24 @@ export default function myPlugin() : EventPlugin<CommandType.Text> {
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### Command
|
||||
### Control
|
||||
|
||||
• **Command** = ``1``
|
||||
|
||||
The PluginType for CommandPlugins
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:107](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/enums.ts#L107)
|
||||
|
||||
___
|
||||
|
||||
### Event
|
||||
|
||||
• **Event** = ``2``
|
||||
• **Control** = ``2``
|
||||
|
||||
The PluginType for EventPlugins
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:111](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/enums.ts#L111)
|
||||
[src/core/structures/enums.ts:85](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L85)
|
||||
|
||||
___
|
||||
|
||||
### Init
|
||||
|
||||
• **Init** = ``1``
|
||||
|
||||
The PluginType for InitPlugins
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/structures/enums.ts:81](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L81)
|
||||
|
||||
104
docs/api/enums/SernError.md
Normal file
104
docs/api/enums/SernError.md
Normal 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)
|
||||
@@ -11,86 +11,74 @@ custom_edit_url: null
|
||||
</div>
|
||||
|
||||
<h1 align="center">Handlers. Redefined.</h1>
|
||||
<h4 align="center">A customizable, batteries-included, powerful discord.js framework to streamline bot development.</h4>
|
||||
<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-handler.js.org"><img alt="docs.rs" src="https://img.shields.io/docsrs/docs" /></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
|
||||
|
||||
```sh
|
||||
npm install @sern/handler
|
||||
```
|
||||
|
||||
```sh
|
||||
yarn add @sern/handler
|
||||
```
|
||||
|
||||
```sh
|
||||
pnpm add @sern/handler
|
||||
```
|
||||
|
||||
## 👀 Quick Look
|
||||
|
||||
* Support for discord.js v14 and all interactions
|
||||
* Hybrid commands
|
||||
* lightweight and customizable
|
||||
* ESM, CommonJS and TypeScript support
|
||||
* A powerful cli and awesome community-made plugins
|
||||
[Start here!!](https://sern.dev/docs/guide/walkthrough/new-project)
|
||||
|
||||
## 👶 Basic Usage
|
||||
<details><summary>ping.ts</summary>
|
||||
|
||||
#### ` index.js (CommonJS)`
|
||||
|
||||
```js
|
||||
// Import the discord.js Client and GatewayIntentBits
|
||||
const { Client, GatewayIntentBits } = require('discord.js');
|
||||
|
||||
// Import Sern namespace
|
||||
const { Sern } = require('@sern/handler');
|
||||
|
||||
// Our configuration file
|
||||
const { defaultPrefix, token } = require('./config.json');
|
||||
|
||||
const client = new Client({
|
||||
intents: [
|
||||
GatewayIntentBits.Guilds,
|
||||
GatewayIntentBits.GuildMembers,
|
||||
GatewayIntentBits.GuildMessages
|
||||
]
|
||||
});
|
||||
|
||||
Sern.init({
|
||||
client,
|
||||
defaultPrefix,
|
||||
commands : 'src/commands',
|
||||
});
|
||||
|
||||
client.login(token);
|
||||
```
|
||||
|
||||
#### ` ping.js (CommonJS)`
|
||||
|
||||
```js
|
||||
const { CommandType, commandModule } = require('@sern/handler');
|
||||
|
||||
exports.default = commandModule({
|
||||
name: 'ping',
|
||||
description: 'A ping pong command',
|
||||
```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('pong!');
|
||||
ctx.reply('Hello owner of the bot');
|
||||
}
|
||||
});
|
||||
```
|
||||
</details>
|
||||
<details><summary>modal.ts</summary>
|
||||
|
||||
See our [templates](https://github.com/sern-handler/templates) for TypeScript examples and more
|
||||
```ts
|
||||
export default commandModule({
|
||||
type: CommandType.Modal,
|
||||
//Installed a plugin to make sure modal fields pass a validation.
|
||||
plugins : [
|
||||
assertFields({
|
||||
fields: {
|
||||
name: /^([^0-9]*)$/
|
||||
},
|
||||
failure: (errors, modal) => modal.reply('your submission did not pass the validations')
|
||||
})
|
||||
],
|
||||
execute : (modal) => {
|
||||
modal.reply('thanks for the submission!');
|
||||
}
|
||||
})
|
||||
```
|
||||
</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.
|
||||
|
||||
## 💻 CLI
|
||||
|
||||
@@ -98,15 +86,10 @@ It is **highly encouraged** to use the [command line interface](https://github.c
|
||||
|
||||
## 🔗 Links
|
||||
|
||||
- [Official Documentation and Guide](https://sern-handler.js.org)
|
||||
- [Support Server](https://discord.com/invite/mmyCTnYtbF)
|
||||
- [Official Documentation and Guide](https://sern.dev)
|
||||
- [Support Server](https://sern.dev/discord)
|
||||
|
||||
## 👋 Contribute
|
||||
|
||||
- Read our contribution [guidelines](https://github.com/sern-handler/handler) carefully
|
||||
- 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.
|
||||
|
||||
## 🚈 Roadmap
|
||||
|
||||
You can check our [roadmap](https://github.com/sern-handler/roadmap) to see what's going to be added or patched in the future.
|
||||
|
||||
@@ -8,26 +8,12 @@ custom_edit_url: null
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`Module`](Module.md)
|
||||
- `Omit`<[`Module`](Module.md), ``"name"`` \| ``"type"`` \| ``"plugins"`` \| ``"description"``\>
|
||||
|
||||
↳ **`AutocompleteCommand`**
|
||||
|
||||
## Properties
|
||||
|
||||
### description
|
||||
|
||||
• `Optional` **description**: `undefined`
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[description](Module.md#description)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:132](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L132)
|
||||
|
||||
___
|
||||
|
||||
### execute
|
||||
|
||||
• **execute**: (`ctx`: `AutocompleteInteraction`<`CacheType`\>) => `unknown`
|
||||
@@ -48,46 +34,22 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[execute](Module.md#execute)
|
||||
Omit.execute
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:135](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L135)
|
||||
|
||||
___
|
||||
|
||||
### name
|
||||
|
||||
• `Optional` **name**: `undefined`
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[name](Module.md#name)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:131](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L131)
|
||||
[src/types/module.ts:111](https://github.com/sern-handler/handler/blob/c1f6906/src/types/module.ts#L111)
|
||||
|
||||
___
|
||||
|
||||
### onEvent
|
||||
|
||||
• **onEvent**: [`AutocompletePlugin`](AutocompletePlugin.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:134](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L134)
|
||||
|
||||
___
|
||||
|
||||
### type
|
||||
|
||||
• `Optional` **type**: `undefined`
|
||||
• **onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[type](Module.md#type)
|
||||
Omit.onEvent
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:133](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L133)
|
||||
[src/types/module.ts:110](https://github.com/sern-handler/handler/blob/c1f6906/src/types/module.ts#L110)
|
||||
|
||||
@@ -8,7 +8,7 @@ custom_edit_url: null
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`Module`](Module.md)
|
||||
- `Module`
|
||||
|
||||
↳ **`BothCommand`**
|
||||
|
||||
@@ -20,21 +20,21 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:62](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L62)
|
||||
[src/types/core-modules.ts:126](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L126)
|
||||
|
||||
___
|
||||
|
||||
### description
|
||||
|
||||
• `Optional` **description**: `string`
|
||||
• **description**: `string`
|
||||
|
||||
#### Inherited from
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[description](Module.md#description)
|
||||
Module.description
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:38](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L38)
|
||||
[src/types/core-modules.ts:127](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L127)
|
||||
|
||||
___
|
||||
|
||||
@@ -59,11 +59,11 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[execute](Module.md#execute)
|
||||
Module.execute
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:64](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L64)
|
||||
[src/types/core-modules.ts:129](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L129)
|
||||
|
||||
___
|
||||
|
||||
@@ -73,41 +73,49 @@ ___
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[name](Module.md#name)
|
||||
Module.name
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:37](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L37)
|
||||
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### onEvent
|
||||
|
||||
• **onEvent**: [`EventPlugin`](EventPlugin.md)<[`Both`](../enums/CommandType.md#both)\>[]
|
||||
• **onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.onEvent
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:60](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L60)
|
||||
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### options
|
||||
|
||||
• `Optional` **options**: ([`SernSubCommandData`](SernSubCommandData.md) \| [`SernSubCommandGroupData`](SernSubCommandGroupData.md) \| [`BaseOptions`](../modules.md#baseoptions))[]
|
||||
• `Optional` **options**: [`SernOptionsData`](../modules.md#sernoptionsdata)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:63](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L63)
|
||||
[src/types/core-modules.ts:128](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L128)
|
||||
|
||||
___
|
||||
|
||||
### plugins
|
||||
|
||||
• **plugins**: [`CommandPlugin`](CommandPlugin.md)<keyof [`CommandModuleDefs`](../modules.md#commandmoduledefs)\>[]
|
||||
• **plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.plugins
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:61](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L61)
|
||||
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
@@ -117,8 +125,8 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[type](Module.md#type)
|
||||
Module.type
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:59](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L59)
|
||||
[src/types/core-modules.ts:125](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L125)
|
||||
|
||||
@@ -8,7 +8,7 @@ custom_edit_url: null
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`Module`](Module.md)
|
||||
- `Module`
|
||||
|
||||
↳ **`ButtonCommand`**
|
||||
|
||||
@@ -20,11 +20,11 @@ custom_edit_url: null
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[description](Module.md#description)
|
||||
Module.description
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:38](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L38)
|
||||
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37)
|
||||
|
||||
___
|
||||
|
||||
@@ -48,11 +48,11 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[execute](Module.md#execute)
|
||||
Module.execute
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:85](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L85)
|
||||
[src/types/core-modules.ts:66](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L66)
|
||||
|
||||
___
|
||||
|
||||
@@ -62,31 +62,39 @@ ___
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[name](Module.md#name)
|
||||
Module.name
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:37](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L37)
|
||||
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### onEvent
|
||||
|
||||
• **onEvent**: [`EventPlugin`](EventPlugin.md)<[`Button`](../enums/CommandType.md#button)\>[]
|
||||
• **onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.onEvent
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:83](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L83)
|
||||
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### plugins
|
||||
|
||||
• **plugins**: [`CommandPlugin`](CommandPlugin.md)<keyof [`CommandModuleDefs`](../modules.md#commandmoduledefs)\>[]
|
||||
• **plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.plugins
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:84](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L84)
|
||||
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
@@ -96,8 +104,8 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[type](Module.md#type)
|
||||
Module.type
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:82](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L82)
|
||||
[src/types/core-modules.ts:65](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L65)
|
||||
|
||||
@@ -8,7 +8,7 @@ custom_edit_url: null
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`Module`](Module.md)
|
||||
- `Module`
|
||||
|
||||
↳ **`ChannelSelectCommand`**
|
||||
|
||||
@@ -20,11 +20,11 @@ custom_edit_url: null
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[description](Module.md#description)
|
||||
Module.description
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:38](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L38)
|
||||
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37)
|
||||
|
||||
___
|
||||
|
||||
@@ -48,11 +48,11 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[execute](Module.md#execute)
|
||||
Module.execute
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:99](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L99)
|
||||
[src/types/core-modules.ts:76](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L76)
|
||||
|
||||
___
|
||||
|
||||
@@ -62,31 +62,39 @@ ___
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[name](Module.md#name)
|
||||
Module.name
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:37](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L37)
|
||||
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### onEvent
|
||||
|
||||
• **onEvent**: [`EventPlugin`](EventPlugin.md)<[`ChannelSelect`](../enums/CommandType.md#channelselect)\>[]
|
||||
• **onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.onEvent
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:97](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L97)
|
||||
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### plugins
|
||||
|
||||
• **plugins**: [`CommandPlugin`](CommandPlugin.md)<keyof [`CommandModuleDefs`](../modules.md#commandmoduledefs)\>[]
|
||||
• **plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.plugins
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:98](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L98)
|
||||
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
@@ -96,8 +104,8 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[type](Module.md#type)
|
||||
Module.type
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:96](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L96)
|
||||
[src/types/core-modules.ts:75](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L75)
|
||||
|
||||
45
docs/api/interfaces/CommandError.Response.md
Normal file
45
docs/api/interfaces/CommandError.Response.md
Normal 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)
|
||||
127
docs/api/interfaces/CommandModuleDefs.md
Normal file
127
docs/api/interfaces/CommandModuleDefs.md
Normal file
@@ -0,0 +1,127 @@
|
||||
---
|
||||
id: "CommandModuleDefs"
|
||||
title: "Interface: CommandModuleDefs"
|
||||
sidebar_label: "CommandModuleDefs"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
### 1
|
||||
|
||||
• **1**: [`TextCommand`](TextCommand.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:151](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L151)
|
||||
|
||||
___
|
||||
|
||||
### 1024
|
||||
|
||||
• **1024**: [`ChannelSelectCommand`](ChannelSelectCommand.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:159](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L159)
|
||||
|
||||
___
|
||||
|
||||
### 128
|
||||
|
||||
• **128**: [`UserSelectCommand`](UserSelectCommand.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:161](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L161)
|
||||
|
||||
___
|
||||
|
||||
### 16
|
||||
|
||||
• **16**: [`ButtonCommand`](ButtonCommand.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:156](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L156)
|
||||
|
||||
___
|
||||
|
||||
### 2
|
||||
|
||||
• **2**: [`SlashCommand`](SlashCommand.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:152](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L152)
|
||||
|
||||
___
|
||||
|
||||
### 256
|
||||
|
||||
• **256**: [`RoleSelectCommand`](RoleSelectCommand.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:158](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L158)
|
||||
|
||||
___
|
||||
|
||||
### 3
|
||||
|
||||
• **3**: [`BothCommand`](BothCommand.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:153](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L153)
|
||||
|
||||
___
|
||||
|
||||
### 32
|
||||
|
||||
• **32**: [`StringSelectCommand`](StringSelectCommand.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:157](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L157)
|
||||
|
||||
___
|
||||
|
||||
### 4
|
||||
|
||||
• **4**: [`ContextMenuUser`](ContextMenuUser.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:155](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L155)
|
||||
|
||||
___
|
||||
|
||||
### 512
|
||||
|
||||
• **512**: [`MentionableSelectCommand`](MentionableSelectCommand.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:160](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L160)
|
||||
|
||||
___
|
||||
|
||||
### 64
|
||||
|
||||
• **64**: [`ModalSubmitCommand`](ModalSubmitCommand.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:162](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L162)
|
||||
|
||||
___
|
||||
|
||||
### 8
|
||||
|
||||
• **8**: [`ContextMenuMsg`](ContextMenuMsg.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:154](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L154)
|
||||
@@ -6,17 +6,15 @@ 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 keyof [`CommandModuleDefs`](../modules.md#commandmoduledefs) = keyof [`CommandModuleDefs`](../modules.md#commandmoduledefs) |
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`Plugin`](Plugin.md)
|
||||
|
||||
↳ **`CommandPlugin`**
|
||||
| `T` | extends [`CommandType`](../enums/CommandType.md) = [`CommandType`](../enums/CommandType.md) |
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -24,44 +22,34 @@ custom_edit_url: null
|
||||
|
||||
• `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)
|
||||
[src/types/plugin.ts:51](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L51)
|
||||
|
||||
___
|
||||
|
||||
### execute
|
||||
|
||||
• **execute**: (`payload`: { `absPath`: `string` ; `mod`: [`CommandModuleDefs`](../modules.md#commandmoduledefs)[`T`] & { `description`: `string` ; `name`: `string` } }, `controller`: [`Controller`](Controller.md)) => `Awaitable`<`Result`<`void`, `void`\>\>
|
||||
• **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
|
||||
|
||||
▸ (`payload`, `controller`): `Awaitable`<`Result`<`void`, `void`\>\>
|
||||
▸ (`m`, `controller?`): [`PluginResult`](../modules.md#pluginresult)
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `payload` | `Object` |
|
||||
| `payload.absPath` | `string` |
|
||||
| `payload.mod` | [`CommandModuleDefs`](../modules.md#commandmoduledefs)[`T`] & { `description`: `string` ; `name`: `string` } |
|
||||
| `controller` | [`Controller`](Controller.md) |
|
||||
| `m` | [`InitArgs`](InitArgs.md)<[`Processed`](../modules.md#processed)<[`CommandModule`](../modules.md#commandmodule)\>\> |
|
||||
| `controller?` | [`Deprecated`](../modules.md#deprecated)<``"Please import controller instead"``\> |
|
||||
|
||||
##### Returns
|
||||
|
||||
`Awaitable`<`Result`<`void`, `void`\>\>
|
||||
[`PluginResult`](../modules.md#pluginresult)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:39](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L39)
|
||||
[src/types/plugin.ts:53](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
@@ -69,28 +57,16 @@ ___
|
||||
|
||||
• `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)
|
||||
[src/types/plugin.ts:50](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L50)
|
||||
|
||||
___
|
||||
|
||||
### type
|
||||
|
||||
• **type**: [`Command`](../enums/PluginType.md#command)
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Plugin](Plugin.md).[type](Plugin.md#type)
|
||||
• **type**: [`Init`](../enums/PluginType.md#init)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:38](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L38)
|
||||
[src/types/plugin.ts:52](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L52)
|
||||
|
||||
@@ -8,7 +8,7 @@ custom_edit_url: null
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`Module`](Module.md)
|
||||
- `Module`
|
||||
|
||||
↳ **`ContextMenuMsg`**
|
||||
|
||||
@@ -20,11 +20,11 @@ custom_edit_url: null
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[description](Module.md#description)
|
||||
Module.description
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:38](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L38)
|
||||
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37)
|
||||
|
||||
___
|
||||
|
||||
@@ -48,11 +48,11 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[execute](Module.md#execute)
|
||||
Module.execute
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:78](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L78)
|
||||
[src/types/core-modules.ts:61](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L61)
|
||||
|
||||
___
|
||||
|
||||
@@ -62,31 +62,39 @@ ___
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[name](Module.md#name)
|
||||
Module.name
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:37](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L37)
|
||||
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### onEvent
|
||||
|
||||
• **onEvent**: [`EventPlugin`](EventPlugin.md)<[`CtxMsg`](../enums/CommandType.md#ctxmsg)\>[]
|
||||
• **onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.onEvent
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:76](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L76)
|
||||
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### plugins
|
||||
|
||||
• **plugins**: [`CommandPlugin`](CommandPlugin.md)<keyof [`CommandModuleDefs`](../modules.md#commandmoduledefs)\>[]
|
||||
• **plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.plugins
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:77](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L77)
|
||||
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
@@ -96,8 +104,8 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[type](Module.md#type)
|
||||
Module.type
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:75](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L75)
|
||||
[src/types/core-modules.ts:60](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L60)
|
||||
|
||||
@@ -8,7 +8,7 @@ custom_edit_url: null
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`Module`](Module.md)
|
||||
- `Module`
|
||||
|
||||
↳ **`ContextMenuUser`**
|
||||
|
||||
@@ -20,11 +20,11 @@ custom_edit_url: null
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[description](Module.md#description)
|
||||
Module.description
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:38](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L38)
|
||||
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37)
|
||||
|
||||
___
|
||||
|
||||
@@ -48,11 +48,11 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[execute](Module.md#execute)
|
||||
Module.execute
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:71](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L71)
|
||||
[src/types/core-modules.ts:56](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L56)
|
||||
|
||||
___
|
||||
|
||||
@@ -62,31 +62,39 @@ ___
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[name](Module.md#name)
|
||||
Module.name
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:37](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L37)
|
||||
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### onEvent
|
||||
|
||||
• **onEvent**: [`EventPlugin`](EventPlugin.md)<[`CtxUser`](../enums/CommandType.md#ctxuser)\>[]
|
||||
• **onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.onEvent
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:69](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L69)
|
||||
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### plugins
|
||||
|
||||
• **plugins**: [`CommandPlugin`](CommandPlugin.md)<keyof [`CommandModuleDefs`](../modules.md#commandmoduledefs)\>[]
|
||||
• **plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.plugins
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:70](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L70)
|
||||
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
@@ -96,8 +104,8 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[type](Module.md#type)
|
||||
Module.type
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:68](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L68)
|
||||
[src/types/core-modules.ts:55](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L55)
|
||||
|
||||
47
docs/api/interfaces/ControlPlugin.md
Normal file
47
docs/api/interfaces/ControlPlugin.md
Normal 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/9d5c6c7/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/9d5c6c7/src/types/core-plugin.ts#L72)
|
||||
@@ -22,7 +22,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:26](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L26)
|
||||
[src/types/core-plugin.ts:59](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-plugin.ts#L59)
|
||||
|
||||
___
|
||||
|
||||
@@ -40,4 +40,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:27](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L27)
|
||||
[src/types/core-plugin.ts:60](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-plugin.ts#L60)
|
||||
|
||||
115
docs/api/interfaces/CoreDependencies.md
Normal file
115
docs/api/interfaces/CoreDependencies.md
Normal file
@@ -0,0 +1,115 @@
|
||||
---
|
||||
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/9d5c6c7/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:30](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/ioc.ts#L30)
|
||||
|
||||
___
|
||||
|
||||
### @sern/errors
|
||||
|
||||
• **@sern/errors**: () => [`ErrorHandling`](ErrorHandling.md)
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (): [`ErrorHandling`](ErrorHandling.md)
|
||||
|
||||
##### Returns
|
||||
|
||||
[`ErrorHandling`](ErrorHandling.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/ioc.ts:33](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/ioc.ts#L33)
|
||||
|
||||
___
|
||||
|
||||
### @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:29](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/ioc.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
### @sern/modules
|
||||
|
||||
• **@sern/modules**: () => [`ModuleManager`](ModuleManager.md)
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (): [`ModuleManager`](ModuleManager.md)
|
||||
|
||||
##### Returns
|
||||
|
||||
[`ModuleManager`](ModuleManager.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/ioc.ts:32](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/ioc.ts#L32)
|
||||
|
||||
___
|
||||
|
||||
### @sern/store
|
||||
|
||||
• **@sern/store**: () => [`CoreModuleStore`](CoreModuleStore.md)
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (): [`CoreModuleStore`](CoreModuleStore.md)
|
||||
|
||||
##### Returns
|
||||
|
||||
[`CoreModuleStore`](CoreModuleStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/ioc.ts:31](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/ioc.ts#L31)
|
||||
33
docs/api/interfaces/CoreModuleStore.md
Normal file
33
docs/api/interfaces/CoreModuleStore.md
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
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.
|
||||
|
||||
## Implemented by
|
||||
|
||||
- [`ModuleStore`](../classes/ModuleStore.md)
|
||||
|
||||
## Properties
|
||||
|
||||
### commands
|
||||
|
||||
• **commands**: `Map`<`string`, `string`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/contracts/module-store.ts:7](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/module-store.ts#L7)
|
||||
|
||||
___
|
||||
|
||||
### metadata
|
||||
|
||||
• **metadata**: `WeakMap`<`Module`, `CommandMeta`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/contracts/module-store.ts:8](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/module-store.ts#L8)
|
||||
@@ -14,7 +14,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:41](https://github.com/sern-handler/handler/blob/3daacfc/src/types/handler.ts#L41)
|
||||
[src/types/handler.ts:40](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L40)
|
||||
|
||||
___
|
||||
|
||||
@@ -24,7 +24,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:43](https://github.com/sern-handler/handler/blob/3daacfc/src/types/handler.ts#L43)
|
||||
[src/types/handler.ts:42](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
@@ -34,7 +34,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:46](https://github.com/sern-handler/handler/blob/3daacfc/src/types/handler.ts#L46)
|
||||
[src/types/handler.ts:45](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,7 +44,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:42](https://github.com/sern-handler/handler/blob/3daacfc/src/types/handler.ts#L42)
|
||||
[src/types/handler.ts:41](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L41)
|
||||
|
||||
___
|
||||
|
||||
@@ -54,7 +54,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:45](https://github.com/sern-handler/handler/blob/3daacfc/src/types/handler.ts#L45)
|
||||
[src/types/handler.ts:44](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L44)
|
||||
|
||||
___
|
||||
|
||||
@@ -64,4 +64,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:44](https://github.com/sern-handler/handler/blob/3daacfc/src/types/handler.ts#L44)
|
||||
[src/types/handler.ts:43](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L43)
|
||||
|
||||
47
docs/api/interfaces/DependencyConfiguration.md
Normal file
47
docs/api/interfaces/DependencyConfiguration.md
Normal 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)
|
||||
113
docs/api/interfaces/DiscordEventCommand.md
Normal file
113
docs/api/interfaces/DiscordEventCommand.md
Normal file
@@ -0,0 +1,113 @@
|
||||
---
|
||||
id: "DiscordEventCommand"
|
||||
title: "Interface: DiscordEventCommand<T>"
|
||||
sidebar_label: "DiscordEventCommand"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `T` | extends keyof `ClientEvents` = keyof `ClientEvents` |
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `Module`
|
||||
|
||||
↳ **`DiscordEventCommand`**
|
||||
|
||||
## Properties
|
||||
|
||||
### description
|
||||
|
||||
• `Optional` **description**: `string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.description
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37)
|
||||
|
||||
___
|
||||
|
||||
### name
|
||||
|
||||
• `Optional` **name**: `T`
|
||||
|
||||
#### Overrides
|
||||
|
||||
Module.name
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:107](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L107)
|
||||
|
||||
___
|
||||
|
||||
### onEvent
|
||||
|
||||
• **onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.onEvent
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### plugins
|
||||
|
||||
• **plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.plugins
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
### type
|
||||
|
||||
• **type**: [`Discord`](../enums/EventType.md#discord)
|
||||
|
||||
#### Overrides
|
||||
|
||||
Module.type
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:108](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L108)
|
||||
|
||||
## Methods
|
||||
|
||||
### execute
|
||||
|
||||
▸ **execute**(`...args`): `unknown`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `...args` | `ClientEvents`[`T`] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`unknown`
|
||||
|
||||
#### Overrides
|
||||
|
||||
Module.execute
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:109](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L109)
|
||||
24
docs/api/interfaces/Disposable.md
Normal file
24
docs/api/interfaces/Disposable.md
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
id: "Disposable"
|
||||
title: "Interface: Disposable"
|
||||
sidebar_label: "Disposable"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Represents a Disposable contract.
|
||||
Let dependencies implement this to dispose and cleanup.
|
||||
|
||||
## Methods
|
||||
|
||||
### dispose
|
||||
|
||||
▸ **dispose**(): `unknown`
|
||||
|
||||
#### Returns
|
||||
|
||||
`unknown`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/contracts/disposable.ts:8](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/disposable.ts#L8)
|
||||
70
docs/api/interfaces/Emitter.md
Normal file
70
docs/api/interfaces/Emitter.md
Normal 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`): [`Emitter`](Emitter.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `eventName` | `string` \| `symbol` |
|
||||
| `listener` | `AnyFunction` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`Emitter`](Emitter.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/contracts/emitter.ts:4](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/emitter.ts#L4)
|
||||
|
||||
___
|
||||
|
||||
### emit
|
||||
|
||||
▸ **emit**(`eventName`, `...payload`): `boolean`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `eventName` | `string` \| `symbol` |
|
||||
| `...payload` | `any`[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/contracts/emitter.ts:6](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/emitter.ts#L6)
|
||||
|
||||
___
|
||||
|
||||
### removeListener
|
||||
|
||||
▸ **removeListener**(`eventName`, `listener`): [`Emitter`](Emitter.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `eventName` | `string` \| `symbol` |
|
||||
| `listener` | `AnyFunction` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`Emitter`](Emitter.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/contracts/emitter.ts:5](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/emitter.ts#L5)
|
||||
@@ -6,43 +6,37 @@ sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
**`Since`**
|
||||
|
||||
2.0.0
|
||||
|
||||
## Implemented by
|
||||
|
||||
- [`DefaultErrorHandling`](../classes/DefaultErrorHandling.md)
|
||||
|
||||
## Properties
|
||||
|
||||
### keepAlive
|
||||
|
||||
• **keepAlive**: `number`
|
||||
|
||||
Number of times the process should throw an error until crashing and exiting
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/contracts/errorHandling.ts:9](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/contracts/errorHandling.ts#L9)
|
||||
|
||||
## Methods
|
||||
|
||||
### crash
|
||||
|
||||
▸ **crash**(`error`): `never`
|
||||
|
||||
Utility function to crash
|
||||
▸ **crash**(`err`): `never`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `error` | `Error` |
|
||||
| `err` | `Error` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`never`
|
||||
|
||||
**`Deprecated`**
|
||||
|
||||
Version 4 will remove this method
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/contracts/errorHandling.ts:15](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/contracts/errorHandling.ts#L15)
|
||||
[src/core/contracts/error-handling.ts:11](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/error-handling.ts#L11)
|
||||
|
||||
___
|
||||
|
||||
@@ -50,7 +44,7 @@ ___
|
||||
|
||||
▸ **updateAlive**(`error`): `void`
|
||||
|
||||
A function that is called on every crash. Updates keepAlive
|
||||
A function that is called on every throw.
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -64,4 +58,4 @@ A function that is called on every crash. Updates keepAlive
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/contracts/errorHandling.ts:21](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/contracts/errorHandling.ts#L21)
|
||||
[src/core/contracts/error-handling.ts:16](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/error-handling.ts#L16)
|
||||
|
||||
37
docs/api/interfaces/EventModuleDefs.md
Normal file
37
docs/api/interfaces/EventModuleDefs.md
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
id: "EventModuleDefs"
|
||||
title: "Interface: EventModuleDefs"
|
||||
sidebar_label: "EventModuleDefs"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
### 1
|
||||
|
||||
• **1**: [`DiscordEventCommand`](DiscordEventCommand.md)<keyof `ClientEvents`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:167](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L167)
|
||||
|
||||
___
|
||||
|
||||
### 2
|
||||
|
||||
• **2**: [`SernEventCommand`](SernEventCommand.md)<keyof [`SernEventsMapping`](SernEventsMapping.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:166](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L166)
|
||||
|
||||
___
|
||||
|
||||
### 3
|
||||
|
||||
• **3**: [`ExternalEventCommand`](ExternalEventCommand.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:168](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L168)
|
||||
@@ -1,22 +1,20 @@
|
||||
---
|
||||
id: "EventPlugin"
|
||||
title: "Interface: EventPlugin<K>"
|
||||
title: "Interface: EventPlugin<T>"
|
||||
sidebar_label: "EventPlugin"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
**`Deprecated`**
|
||||
|
||||
Use the newer helper functions
|
||||
|
||||
## Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `K` | extends keyof [`CommandModuleDefs`](../modules.md#commandmoduledefs) = keyof [`CommandModuleDefs`](../modules.md#commandmoduledefs) |
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`Plugin`](Plugin.md)
|
||||
|
||||
↳ **`EventPlugin`**
|
||||
| `T` | extends [`CommandType`](../enums/CommandType.md) |
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -24,42 +22,34 @@ custom_edit_url: null
|
||||
|
||||
• `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)
|
||||
[src/types/plugin.ts:64](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L64)
|
||||
|
||||
___
|
||||
|
||||
### execute
|
||||
|
||||
• **execute**: (`event`: `Parameters`<[`CommandModuleDefs`](../modules.md#commandmoduledefs)[`K`][``"execute"``]\>, `controller`: [`Controller`](Controller.md)) => `Awaitable`<`Result`<`void`, `void`\>\>
|
||||
• **execute**: (`args`: [`CommandArgs`](../modules.md#commandargs)<`T`, [`Event`](../enums/PluginType.md#event)\>, `controller?`: [`Controller`](Controller.md)) => [`PluginResult`](../modules.md#pluginresult)
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`event`, `controller`): `Awaitable`<`Result`<`void`, `void`\>\>
|
||||
▸ (`args`, `controller?`): [`PluginResult`](../modules.md#pluginresult)
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `event` | `Parameters`<[`CommandModuleDefs`](../modules.md#commandmoduledefs)[`K`][``"execute"``]\> |
|
||||
| `controller` | [`Controller`](Controller.md) |
|
||||
| `args` | [`CommandArgs`](../modules.md#commandargs)<`T`, [`Event`](../enums/PluginType.md#event)\> |
|
||||
| `controller?` | [`Controller`](Controller.md) |
|
||||
|
||||
##### Returns
|
||||
|
||||
`Awaitable`<`Result`<`void`, `void`\>\>
|
||||
[`PluginResult`](../modules.md#pluginresult)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:82](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L82)
|
||||
[src/types/plugin.ts:66](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L66)
|
||||
|
||||
___
|
||||
|
||||
@@ -67,17 +57,9 @@ ___
|
||||
|
||||
• `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)
|
||||
[src/types/plugin.ts:63](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L63)
|
||||
|
||||
___
|
||||
|
||||
@@ -85,10 +67,6 @@ ___
|
||||
|
||||
• **type**: [`Event`](../enums/PluginType.md#event)
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Plugin](Plugin.md).[type](Plugin.md#type)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:81](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L81)
|
||||
[src/types/plugin.ts:65](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L65)
|
||||
|
||||
117
docs/api/interfaces/ExternalEventCommand.md
Normal file
117
docs/api/interfaces/ExternalEventCommand.md
Normal file
@@ -0,0 +1,117 @@
|
||||
---
|
||||
id: "ExternalEventCommand"
|
||||
title: "Interface: ExternalEventCommand"
|
||||
sidebar_label: "ExternalEventCommand"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `Module`
|
||||
|
||||
↳ **`ExternalEventCommand`**
|
||||
|
||||
## Properties
|
||||
|
||||
### description
|
||||
|
||||
• `Optional` **description**: `string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.description
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37)
|
||||
|
||||
___
|
||||
|
||||
### emitter
|
||||
|
||||
• **emitter**: keyof `Dependencies`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:49](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
### name
|
||||
|
||||
• `Optional` **name**: `string`
|
||||
|
||||
#### Overrides
|
||||
|
||||
Module.name
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:48](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L48)
|
||||
|
||||
___
|
||||
|
||||
### onEvent
|
||||
|
||||
• **onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.onEvent
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### plugins
|
||||
|
||||
• **plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.plugins
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
### type
|
||||
|
||||
• **type**: [`External`](../enums/EventType.md#external)
|
||||
|
||||
#### Overrides
|
||||
|
||||
Module.type
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:50](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L50)
|
||||
|
||||
## Methods
|
||||
|
||||
### execute
|
||||
|
||||
▸ **execute**(`...args`): `unknown`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `...args` | `unknown`[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`unknown`
|
||||
|
||||
#### Overrides
|
||||
|
||||
Module.execute
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:51](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L51)
|
||||
24
docs/api/interfaces/Init.md
Normal file
24
docs/api/interfaces/Init.md
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
id: "Init"
|
||||
title: "Interface: Init"
|
||||
sidebar_label: "Init"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Represents an initialization contract.
|
||||
Let dependencies implement this to initiate some logic.
|
||||
|
||||
## Methods
|
||||
|
||||
### init
|
||||
|
||||
▸ **init**(): `unknown`
|
||||
|
||||
#### Returns
|
||||
|
||||
`unknown`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/contracts/init.ts:8](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/init.ts#L8)
|
||||
33
docs/api/interfaces/InitArgs.md
Normal file
33
docs/api/interfaces/InitArgs.md
Normal 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)
|
||||
47
docs/api/interfaces/InitPlugin.md
Normal file
47
docs/api/interfaces/InitPlugin.md
Normal 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/9d5c6c7/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/9d5c6c7/src/types/core-plugin.ts#L68)
|
||||
@@ -6,6 +6,10 @@ sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
**`Since`**
|
||||
|
||||
2.0.0
|
||||
|
||||
## Type parameters
|
||||
|
||||
| Name | Type |
|
||||
@@ -34,7 +38,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/contracts/logging.ts:7](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/contracts/logging.ts#L7)
|
||||
[src/core/contracts/logging.ts:8](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/logging.ts#L8)
|
||||
|
||||
___
|
||||
|
||||
@@ -54,7 +58,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/contracts/logging.ts:4](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/contracts/logging.ts#L4)
|
||||
[src/core/contracts/logging.ts:5](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/logging.ts#L5)
|
||||
|
||||
___
|
||||
|
||||
@@ -74,7 +78,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/contracts/logging.ts:6](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/contracts/logging.ts#L6)
|
||||
[src/core/contracts/logging.ts:7](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/logging.ts#L7)
|
||||
|
||||
___
|
||||
|
||||
@@ -94,4 +98,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/contracts/logging.ts:5](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/contracts/logging.ts#L5)
|
||||
[src/core/contracts/logging.ts:6](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/logging.ts#L6)
|
||||
|
||||
@@ -8,7 +8,7 @@ custom_edit_url: null
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`Module`](Module.md)
|
||||
- `Module`
|
||||
|
||||
↳ **`MentionableSelectCommand`**
|
||||
|
||||
@@ -20,11 +20,11 @@ custom_edit_url: null
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[description](Module.md#description)
|
||||
Module.description
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:38](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L38)
|
||||
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37)
|
||||
|
||||
___
|
||||
|
||||
@@ -48,11 +48,11 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[execute](Module.md#execute)
|
||||
Module.execute
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:113](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L113)
|
||||
[src/types/core-modules.ts:86](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L86)
|
||||
|
||||
___
|
||||
|
||||
@@ -62,31 +62,39 @@ ___
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[name](Module.md#name)
|
||||
Module.name
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:37](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L37)
|
||||
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### onEvent
|
||||
|
||||
• **onEvent**: [`EventPlugin`](EventPlugin.md)<[`MentionableSelect`](../enums/CommandType.md#mentionableselect)\>[]
|
||||
• **onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.onEvent
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:111](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L111)
|
||||
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### plugins
|
||||
|
||||
• **plugins**: [`CommandPlugin`](CommandPlugin.md)<keyof [`CommandModuleDefs`](../modules.md#commandmoduledefs)\>[]
|
||||
• **plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.plugins
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:112](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L112)
|
||||
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
@@ -96,8 +104,8 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[type](Module.md#type)
|
||||
Module.type
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:110](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L110)
|
||||
[src/types/core-modules.ts:85](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L85)
|
||||
|
||||
@@ -8,7 +8,7 @@ custom_edit_url: null
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`Module`](Module.md)
|
||||
- `Module`
|
||||
|
||||
↳ **`ModalSubmitCommand`**
|
||||
|
||||
@@ -20,11 +20,11 @@ custom_edit_url: null
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[description](Module.md#description)
|
||||
Module.description
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:38](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L38)
|
||||
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37)
|
||||
|
||||
___
|
||||
|
||||
@@ -48,11 +48,11 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[execute](Module.md#execute)
|
||||
Module.execute
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:127](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L127)
|
||||
[src/types/core-modules.ts:96](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L96)
|
||||
|
||||
___
|
||||
|
||||
@@ -62,31 +62,39 @@ ___
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[name](Module.md#name)
|
||||
Module.name
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:37](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L37)
|
||||
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### onEvent
|
||||
|
||||
• **onEvent**: [`EventPlugin`](EventPlugin.md)<[`Modal`](../enums/CommandType.md#modal)\>[]
|
||||
• **onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.onEvent
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:125](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L125)
|
||||
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### plugins
|
||||
|
||||
• **plugins**: [`CommandPlugin`](CommandPlugin.md)<keyof [`CommandModuleDefs`](../modules.md#commandmoduledefs)\>[]
|
||||
• **plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.plugins
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:126](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L126)
|
||||
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
@@ -96,8 +104,8 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[type](Module.md#type)
|
||||
Module.type
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:124](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L124)
|
||||
[src/types/core-modules.ts:95](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L95)
|
||||
|
||||
@@ -34,7 +34,11 @@ custom_edit_url: null
|
||||
|
||||
↳ [`ModalSubmitCommand`](ModalSubmitCommand.md)
|
||||
|
||||
↳ [`AutocompleteCommand`](AutocompleteCommand.md)
|
||||
↳ [`SernEventCommand`](SernEventCommand.md)
|
||||
|
||||
↳ [`DiscordEventCommand`](DiscordEventCommand.md)
|
||||
|
||||
↳ [`ExternalEventCommand`](ExternalEventCommand.md)
|
||||
|
||||
## Properties
|
||||
|
||||
@@ -44,7 +48,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:38](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L38)
|
||||
[src/types/module.ts:38](https://github.com/sern-handler/handler/blob/c1f6906/src/types/module.ts#L38)
|
||||
|
||||
___
|
||||
|
||||
@@ -68,7 +72,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:39](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L39)
|
||||
[src/types/module.ts:39](https://github.com/sern-handler/handler/blob/c1f6906/src/types/module.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
@@ -78,14 +82,34 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:37](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L37)
|
||||
[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
|
||||
|
||||
• `Optional` **type**: [`CommandType`](../enums/CommandType.md) \| [`EventType`](../enums/EventType.md)
|
||||
• **type**: [`CommandType`](../enums/CommandType.md) \| [`EventType`](../enums/EventType.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:36](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L36)
|
||||
[src/types/module.ts:34](https://github.com/sern-handler/handler/blob/c1f6906/src/types/module.ts#L34)
|
||||
|
||||
@@ -6,6 +6,17 @@ 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)
|
||||
@@ -14,7 +25,27 @@ custom_edit_url: null
|
||||
|
||||
### get
|
||||
|
||||
▸ **get**<`T`\>(`strat`): `undefined` \| [`CommandModuleDefs`](../modules.md#commandmoduledefs)[`T`]
|
||||
▸ **get**(`id`): `undefined` \| `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `id` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/contracts/module-manager.ts:19](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/module-manager.ts#L19)
|
||||
|
||||
___
|
||||
|
||||
### getByNameCommandType
|
||||
|
||||
▸ **getByNameCommandType**<`T`\>(`name`, `commandType`): `undefined` \| `Promise`<[`CommandModuleDefs`](CommandModuleDefs.md)[`T`]\>
|
||||
|
||||
#### Type parameters
|
||||
|
||||
@@ -26,27 +57,67 @@ custom_edit_url: null
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `strat` | (`ms`: [`ModuleStore`](../classes/ModuleStore.md)) => `undefined` \| [`CommandModuleDefs`](../modules.md#commandmoduledefs)[`T`] |
|
||||
| `name` | `string` |
|
||||
| `commandType` | `T` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`CommandModuleDefs`](../modules.md#commandmoduledefs)[`T`]
|
||||
`undefined` \| `Promise`<[`CommandModuleDefs`](CommandModuleDefs.md)[`T`]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/contracts/moduleManager.ts:7](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/contracts/moduleManager.ts#L7)
|
||||
[src/core/contracts/module-manager.ts:23](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/module-manager.ts#L23)
|
||||
|
||||
___
|
||||
|
||||
### set
|
||||
### getMetadata
|
||||
|
||||
▸ **set**(`strat`): `void`
|
||||
▸ **getMetadata**(`m`): `undefined` \| `CommandMeta`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `strat` | (`ms`: [`ModuleStore`](../classes/ModuleStore.md)) => `void` |
|
||||
| `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/9d5c6c7/src/core/contracts/module-manager.ts#L10)
|
||||
|
||||
___
|
||||
|
||||
### getPublishableCommands
|
||||
|
||||
▸ **getPublishableCommands**(): `Promise`<[`CommandModule`](../modules.md#commandmodule)[]\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`CommandModule`](../modules.md#commandmodule)[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/contracts/module-manager.ts:22](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/module-manager.ts#L22)
|
||||
|
||||
___
|
||||
|
||||
### set
|
||||
|
||||
▸ **set**(`id`, `path`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `id` | `string` |
|
||||
| `path` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -54,4 +125,29 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/contracts/moduleManager.ts:8](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/contracts/moduleManager.ts#L8)
|
||||
[src/core/contracts/module-manager.ts:21](https://github.com/sern-handler/handler/blob/9d5c6c7/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/9d5c6c7/src/core/contracts/module-manager.ts#L11)
|
||||
|
||||
@@ -1,60 +1,40 @@
|
||||
---
|
||||
id: "Plugin"
|
||||
title: "Interface: Plugin"
|
||||
title: "Interface: Plugin<Args>"
|
||||
sidebar_label: "Plugin"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
## Type parameters
|
||||
|
||||
- **`Plugin`**
|
||||
|
||||
↳ [`CommandPlugin`](CommandPlugin.md)
|
||||
|
||||
↳ [`DiscordEmitterPlugin`](DiscordEmitterPlugin.md)
|
||||
|
||||
↳ [`ExternalEmitterPlugin`](ExternalEmitterPlugin.md)
|
||||
|
||||
↳ [`SernEmitterPlugin`](SernEmitterPlugin.md)
|
||||
|
||||
↳ [`AutocompletePlugin`](AutocompletePlugin.md)
|
||||
|
||||
↳ [`EventPlugin`](EventPlugin.md)
|
||||
|
||||
↳ [`SernEventPlugin`](SernEventPlugin.md)
|
||||
|
||||
↳ [`ExternalEventPlugin`](ExternalEventPlugin.md)
|
||||
|
||||
↳ [`DiscordEventPlugin`](DiscordEventPlugin.md)
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `Args` | extends `any`[] = `any`[] |
|
||||
|
||||
## Properties
|
||||
|
||||
### description
|
||||
### execute
|
||||
|
||||
• `Optional` **description**: `string`
|
||||
• **execute**: (...`args`: `Args`) => [`PluginResult`](../modules.md#pluginresult)
|
||||
|
||||
**`Deprecated`**
|
||||
#### Type declaration
|
||||
|
||||
will be removed in the next update
|
||||
▸ (`...args`): [`PluginResult`](../modules.md#pluginresult)
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `...args` | `Args` |
|
||||
|
||||
##### Returns
|
||||
|
||||
[`PluginResult`](../modules.md#pluginresult)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:33](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L33)
|
||||
|
||||
___
|
||||
|
||||
### name
|
||||
|
||||
• `Optional` **name**: `string`
|
||||
|
||||
**`Deprecated`**
|
||||
|
||||
will be removed in the next update
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:31](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L31)
|
||||
[src/types/core-plugin.ts:64](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-plugin.ts#L64)
|
||||
|
||||
___
|
||||
|
||||
@@ -64,4 +44,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:34](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L34)
|
||||
[src/types/core-plugin.ts:63](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-plugin.ts#L63)
|
||||
|
||||
82
docs/api/interfaces/Presence.Result.md
Normal file
82
docs/api/interfaces/Presence.Result.md
Normal file
@@ -0,0 +1,82 @@
|
||||
---
|
||||
id: "Presence.Result"
|
||||
title: "Interface: Result"
|
||||
sidebar_label: "Result"
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
[Presence](../namespaces/Presence.md).Result
|
||||
|
||||
## Properties
|
||||
|
||||
### activities
|
||||
|
||||
• `Optional` **activities**: `ActivitiesOptions`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/presences.ts:11](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/presences.ts#L11)
|
||||
|
||||
___
|
||||
|
||||
### afk
|
||||
|
||||
• `Optional` **afk**: `boolean`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/presences.ts:10](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/presences.ts#L10)
|
||||
|
||||
___
|
||||
|
||||
### onRepeat
|
||||
|
||||
• `Optional` **onRepeat**: (`previous`: [`Result`](Presence.Result.md)) => [`Result`](Presence.Result.md)
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`previous`): [`Result`](Presence.Result.md)
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `previous` | [`Result`](Presence.Result.md) |
|
||||
|
||||
##### Returns
|
||||
|
||||
[`Result`](Presence.Result.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/presences.ts:14](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/presences.ts#L14)
|
||||
|
||||
___
|
||||
|
||||
### repeat
|
||||
|
||||
• `Optional` **repeat**: `number` \| [[`Emitter`](Emitter.md), `string`]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/presences.ts:13](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/presences.ts#L13)
|
||||
|
||||
___
|
||||
|
||||
### shardId
|
||||
|
||||
• `Optional` **shardId**: `number`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/presences.ts:12](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/presences.ts#L12)
|
||||
|
||||
___
|
||||
|
||||
### status
|
||||
|
||||
• `Optional` **status**: `Status`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/core/presences.ts:9](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/presences.ts#L9)
|
||||
@@ -8,7 +8,7 @@ custom_edit_url: null
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`Module`](Module.md)
|
||||
- `Module`
|
||||
|
||||
↳ **`RoleSelectCommand`**
|
||||
|
||||
@@ -20,11 +20,11 @@ custom_edit_url: null
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[description](Module.md#description)
|
||||
Module.description
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:38](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L38)
|
||||
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37)
|
||||
|
||||
___
|
||||
|
||||
@@ -48,11 +48,11 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[execute](Module.md#execute)
|
||||
Module.execute
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:106](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L106)
|
||||
[src/types/core-modules.ts:81](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L81)
|
||||
|
||||
___
|
||||
|
||||
@@ -62,31 +62,39 @@ ___
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[name](Module.md#name)
|
||||
Module.name
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:37](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L37)
|
||||
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### onEvent
|
||||
|
||||
• **onEvent**: [`EventPlugin`](EventPlugin.md)<[`RoleSelect`](../enums/CommandType.md#roleselect)\>[]
|
||||
• **onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.onEvent
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:104](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L104)
|
||||
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### plugins
|
||||
|
||||
• **plugins**: [`CommandPlugin`](CommandPlugin.md)<keyof [`CommandModuleDefs`](../modules.md#commandmoduledefs)\>[]
|
||||
• **plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.plugins
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:105](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L105)
|
||||
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
@@ -96,8 +104,8 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[type](Module.md#type)
|
||||
Module.type
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:103](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L103)
|
||||
[src/types/core-modules.ts:80](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L80)
|
||||
|
||||
@@ -20,17 +20,17 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:179](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L179)
|
||||
[src/types/core-modules.ts:173](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L173)
|
||||
|
||||
___
|
||||
|
||||
### command
|
||||
|
||||
• **command**: [`AutocompleteCommand`](AutocompleteCommand.md)
|
||||
• **command**: `AutocompleteCommand`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:184](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L184)
|
||||
[src/types/core-modules.ts:178](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L178)
|
||||
|
||||
___
|
||||
|
||||
@@ -44,13 +44,13 @@ Omit.description
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/discord.js/typings/index.d.ts:4200
|
||||
node_modules/discord.js/typings/index.d.ts:4493
|
||||
|
||||
___
|
||||
|
||||
### descriptionLocalizations
|
||||
|
||||
• `Optional` **descriptionLocalizations**: `Partial`<`Record`<``"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`\>\>
|
||||
• `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
|
||||
|
||||
@@ -58,7 +58,7 @@ Omit.descriptionLocalizations
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/discord.js/typings/index.d.ts:4201
|
||||
node_modules/discord.js/typings/index.d.ts:4494
|
||||
|
||||
___
|
||||
|
||||
@@ -72,13 +72,13 @@ Omit.name
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/discord.js/typings/index.d.ts:4198
|
||||
node_modules/discord.js/typings/index.d.ts:4491
|
||||
|
||||
___
|
||||
|
||||
### nameLocalizations
|
||||
|
||||
• `Optional` **nameLocalizations**: `Partial`<`Record`<``"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`\>\>
|
||||
• `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
|
||||
|
||||
@@ -86,7 +86,7 @@ Omit.nameLocalizations
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/discord.js/typings/index.d.ts:4199
|
||||
node_modules/discord.js/typings/index.d.ts:4492
|
||||
|
||||
___
|
||||
|
||||
@@ -100,7 +100,7 @@ Omit.required
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/discord.js/typings/index.d.ts:4202
|
||||
node_modules/discord.js/typings/index.d.ts:4495
|
||||
|
||||
___
|
||||
|
||||
@@ -110,4 +110,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:180](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L180)
|
||||
[src/types/core-modules.ts:174](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L174)
|
||||
|
||||
113
docs/api/interfaces/SernEventCommand.md
Normal file
113
docs/api/interfaces/SernEventCommand.md
Normal file
@@ -0,0 +1,113 @@
|
||||
---
|
||||
id: "SernEventCommand"
|
||||
title: "Interface: SernEventCommand<T>"
|
||||
sidebar_label: "SernEventCommand"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `T` | extends keyof [`SernEventsMapping`](SernEventsMapping.md) = keyof [`SernEventsMapping`](SernEventsMapping.md) |
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `Module`
|
||||
|
||||
↳ **`SernEventCommand`**
|
||||
|
||||
## Properties
|
||||
|
||||
### description
|
||||
|
||||
• `Optional` **description**: `string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.description
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37)
|
||||
|
||||
___
|
||||
|
||||
### name
|
||||
|
||||
• `Optional` **name**: `T`
|
||||
|
||||
#### Overrides
|
||||
|
||||
Module.name
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:43](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L43)
|
||||
|
||||
___
|
||||
|
||||
### onEvent
|
||||
|
||||
• **onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.onEvent
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### plugins
|
||||
|
||||
• **plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.plugins
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
### type
|
||||
|
||||
• **type**: [`Sern`](../enums/EventType.md#sern)
|
||||
|
||||
#### Overrides
|
||||
|
||||
Module.type
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:44](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L44)
|
||||
|
||||
## Methods
|
||||
|
||||
### execute
|
||||
|
||||
▸ **execute**(`...args`): `unknown`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `...args` | [`SernEventsMapping`](SernEventsMapping.md)[`T`] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`unknown`
|
||||
|
||||
#### Overrides
|
||||
|
||||
Module.execute
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core-modules.ts:45](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L45)
|
||||
57
docs/api/interfaces/SernEventsMapping.md
Normal file
57
docs/api/interfaces/SernEventsMapping.md
Normal file
@@ -0,0 +1,57 @@
|
||||
---
|
||||
id: "SernEventsMapping"
|
||||
title: "Interface: SernEventsMapping"
|
||||
sidebar_label: "SernEventsMapping"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
### error
|
||||
|
||||
• **error**: [[`Payload`](../modules.md#payload)]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/utility.ts:21](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/utility.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
### module.activate
|
||||
|
||||
• **module.activate**: [[`Payload`](../modules.md#payload)]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/utility.ts:20](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/utility.ts#L20)
|
||||
|
||||
___
|
||||
|
||||
### module.register
|
||||
|
||||
• **module.register**: [[`Payload`](../modules.md#payload)]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/utility.ts:19](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/utility.ts#L19)
|
||||
|
||||
___
|
||||
|
||||
### modulesLoaded
|
||||
|
||||
• **modulesLoaded**: [undefined?]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/utility.ts:23](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/utility.ts#L23)
|
||||
|
||||
___
|
||||
|
||||
### warning
|
||||
|
||||
• **warning**: [[`Payload`](../modules.md#payload)]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/utility.ts:22](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/utility.ts#L22)
|
||||
@@ -8,51 +8,37 @@ custom_edit_url: null
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `BaseApplicationCommandOptionsData`
|
||||
- `APIApplicationCommandOptionBase`<`ApplicationCommandOptionType.Subcommand`\>
|
||||
|
||||
↳ **`SernSubCommandData`**
|
||||
|
||||
## Properties
|
||||
|
||||
### autocomplete
|
||||
|
||||
• `Optional` **autocomplete**: `undefined`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseApplicationCommandOptionsData.autocomplete
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/discord.js/typings/index.d.ts:4203
|
||||
|
||||
___
|
||||
|
||||
### description
|
||||
|
||||
• **description**: `string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseApplicationCommandOptionsData.description
|
||||
APIApplicationCommandOptionBase.description
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/discord.js/typings/index.d.ts:4200
|
||||
node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.d.ts:7
|
||||
|
||||
___
|
||||
|
||||
### descriptionLocalizations
|
||||
### description\_localizations
|
||||
|
||||
• `Optional` **descriptionLocalizations**: `Partial`<`Record`<``"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`\>\>
|
||||
• `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
|
||||
|
||||
BaseApplicationCommandOptionsData.descriptionLocalizations
|
||||
APIApplicationCommandOptionBase.description\_localizations
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/discord.js/typings/index.d.ts:4201
|
||||
node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.d.ts:8
|
||||
|
||||
___
|
||||
|
||||
@@ -62,49 +48,49 @@ ___
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseApplicationCommandOptionsData.name
|
||||
APIApplicationCommandOptionBase.name
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/discord.js/typings/index.d.ts:4198
|
||||
node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.d.ts:5
|
||||
|
||||
___
|
||||
|
||||
### nameLocalizations
|
||||
### name\_localizations
|
||||
|
||||
• `Optional` **nameLocalizations**: `Partial`<`Record`<``"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`\>\>
|
||||
• `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
|
||||
|
||||
BaseApplicationCommandOptionsData.nameLocalizations
|
||||
APIApplicationCommandOptionBase.name\_localizations
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/discord.js/typings/index.d.ts:4199
|
||||
node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.d.ts:6
|
||||
|
||||
___
|
||||
|
||||
### options
|
||||
|
||||
• `Optional` **options**: [`BaseOptions`](../modules.md#baseoptions)[]
|
||||
• `Optional` **options**: [`SernOptionsData`](../modules.md#sernoptionsdata)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:201](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L201)
|
||||
[src/types/core-modules.ts:210](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L210)
|
||||
|
||||
___
|
||||
|
||||
### required
|
||||
|
||||
• `Optional` **required**: `undefined`
|
||||
• `Optional` **required**: `boolean`
|
||||
|
||||
#### Overrides
|
||||
#### Inherited from
|
||||
|
||||
BaseApplicationCommandOptionsData.required
|
||||
APIApplicationCommandOptionBase.required
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:200](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L200)
|
||||
node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.d.ts:9
|
||||
|
||||
___
|
||||
|
||||
@@ -112,6 +98,10 @@ ___
|
||||
|
||||
• **type**: `Subcommand`
|
||||
|
||||
#### Overrides
|
||||
|
||||
APIApplicationCommandOptionBase.type
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:199](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L199)
|
||||
[src/types/core-modules.ts:209](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L209)
|
||||
|
||||
@@ -24,7 +24,7 @@ BaseApplicationCommandOptionsData.autocomplete
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/discord.js/typings/index.d.ts:4203
|
||||
node_modules/discord.js/typings/index.d.ts:4496
|
||||
|
||||
___
|
||||
|
||||
@@ -38,13 +38,13 @@ BaseApplicationCommandOptionsData.description
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/discord.js/typings/index.d.ts:4200
|
||||
node_modules/discord.js/typings/index.d.ts:4493
|
||||
|
||||
___
|
||||
|
||||
### descriptionLocalizations
|
||||
|
||||
• `Optional` **descriptionLocalizations**: `Partial`<`Record`<``"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`\>\>
|
||||
• `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
|
||||
|
||||
@@ -52,7 +52,7 @@ BaseApplicationCommandOptionsData.descriptionLocalizations
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/discord.js/typings/index.d.ts:4201
|
||||
node_modules/discord.js/typings/index.d.ts:4494
|
||||
|
||||
___
|
||||
|
||||
@@ -66,13 +66,13 @@ BaseApplicationCommandOptionsData.name
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/discord.js/typings/index.d.ts:4198
|
||||
node_modules/discord.js/typings/index.d.ts:4491
|
||||
|
||||
___
|
||||
|
||||
### nameLocalizations
|
||||
|
||||
• `Optional` **nameLocalizations**: `Partial`<`Record`<``"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`\>\>
|
||||
• `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
|
||||
|
||||
@@ -80,7 +80,7 @@ BaseApplicationCommandOptionsData.nameLocalizations
|
||||
|
||||
#### Defined in
|
||||
|
||||
node_modules/discord.js/typings/index.d.ts:4199
|
||||
node_modules/discord.js/typings/index.d.ts:4492
|
||||
|
||||
___
|
||||
|
||||
@@ -90,21 +90,21 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:207](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L207)
|
||||
[src/types/core-modules.ts:215](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L215)
|
||||
|
||||
___
|
||||
|
||||
### required
|
||||
|
||||
• `Optional` **required**: `undefined`
|
||||
• `Optional` **required**: `boolean`
|
||||
|
||||
#### Overrides
|
||||
#### Inherited from
|
||||
|
||||
BaseApplicationCommandOptionsData.required
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:206](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L206)
|
||||
node_modules/discord.js/typings/index.d.ts:4495
|
||||
|
||||
___
|
||||
|
||||
@@ -114,4 +114,4 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:205](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L205)
|
||||
[src/types/core-modules.ts:214](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L214)
|
||||
|
||||
@@ -8,7 +8,7 @@ custom_edit_url: null
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`Module`](Module.md)
|
||||
- `Module`
|
||||
|
||||
↳ **`SlashCommand`**
|
||||
|
||||
@@ -16,15 +16,15 @@ custom_edit_url: null
|
||||
|
||||
### description
|
||||
|
||||
• `Optional` **description**: `string`
|
||||
• **description**: `string`
|
||||
|
||||
#### Inherited from
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[description](Module.md#description)
|
||||
Module.description
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:38](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L38)
|
||||
[src/types/core-modules.ts:119](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L119)
|
||||
|
||||
___
|
||||
|
||||
@@ -49,11 +49,11 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[execute](Module.md#execute)
|
||||
Module.execute
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:55](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L55)
|
||||
[src/types/core-modules.ts:121](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L121)
|
||||
|
||||
___
|
||||
|
||||
@@ -63,41 +63,49 @@ ___
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[name](Module.md#name)
|
||||
Module.name
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:37](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L37)
|
||||
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### onEvent
|
||||
|
||||
• **onEvent**: [`EventPlugin`](EventPlugin.md)<[`Slash`](../enums/CommandType.md#slash)\>[]
|
||||
• **onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.onEvent
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:52](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L52)
|
||||
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### options
|
||||
|
||||
• `Optional` **options**: ([`SernSubCommandData`](SernSubCommandData.md) \| [`SernSubCommandGroupData`](SernSubCommandGroupData.md) \| [`BaseOptions`](../modules.md#baseoptions))[]
|
||||
• `Optional` **options**: [`SernOptionsData`](../modules.md#sernoptionsdata)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:54](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L54)
|
||||
[src/types/core-modules.ts:120](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L120)
|
||||
|
||||
___
|
||||
|
||||
### plugins
|
||||
|
||||
• **plugins**: [`CommandPlugin`](CommandPlugin.md)<keyof [`CommandModuleDefs`](../modules.md#commandmoduledefs)\>[]
|
||||
• **plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.plugins
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:53](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L53)
|
||||
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
@@ -107,8 +115,8 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[type](Module.md#type)
|
||||
Module.type
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:51](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L51)
|
||||
[src/types/core-modules.ts:118](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L118)
|
||||
|
||||
@@ -8,7 +8,7 @@ custom_edit_url: null
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`Module`](Module.md)
|
||||
- `Module`
|
||||
|
||||
↳ **`StringSelectCommand`**
|
||||
|
||||
@@ -20,11 +20,11 @@ custom_edit_url: null
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[description](Module.md#description)
|
||||
Module.description
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:38](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L38)
|
||||
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37)
|
||||
|
||||
___
|
||||
|
||||
@@ -48,11 +48,11 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[execute](Module.md#execute)
|
||||
Module.execute
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:92](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L92)
|
||||
[src/types/core-modules.ts:71](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L71)
|
||||
|
||||
___
|
||||
|
||||
@@ -62,31 +62,39 @@ ___
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[name](Module.md#name)
|
||||
Module.name
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:37](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L37)
|
||||
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### onEvent
|
||||
|
||||
• **onEvent**: [`EventPlugin`](EventPlugin.md)<[`StringSelect`](../enums/CommandType.md#stringselect)\>[]
|
||||
• **onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.onEvent
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:90](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L90)
|
||||
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### plugins
|
||||
|
||||
• **plugins**: [`CommandPlugin`](CommandPlugin.md)<keyof [`CommandModuleDefs`](../modules.md#commandmoduledefs)\>[]
|
||||
• **plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.plugins
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:91](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L91)
|
||||
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
@@ -96,8 +104,8 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[type](Module.md#type)
|
||||
Module.type
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:89](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L89)
|
||||
[src/types/core-modules.ts:70](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L70)
|
||||
|
||||
@@ -8,7 +8,7 @@ custom_edit_url: null
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`Module`](Module.md)
|
||||
- `Module`
|
||||
|
||||
↳ **`TextCommand`**
|
||||
|
||||
@@ -20,7 +20,7 @@ custom_edit_url: null
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:46](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L46)
|
||||
[src/types/core-modules.ts:113](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L113)
|
||||
|
||||
___
|
||||
|
||||
@@ -30,11 +30,11 @@ ___
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[description](Module.md#description)
|
||||
Module.description
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:38](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L38)
|
||||
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37)
|
||||
|
||||
___
|
||||
|
||||
@@ -59,11 +59,11 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[execute](Module.md#execute)
|
||||
Module.execute
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:47](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L47)
|
||||
[src/types/core-modules.ts:114](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L114)
|
||||
|
||||
___
|
||||
|
||||
@@ -73,31 +73,39 @@ ___
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[name](Module.md#name)
|
||||
Module.name
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:37](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L37)
|
||||
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### onEvent
|
||||
|
||||
• **onEvent**: [`EventPlugin`](EventPlugin.md)<[`Text`](../enums/CommandType.md#text)\>[]
|
||||
• **onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.onEvent
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:44](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L44)
|
||||
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### plugins
|
||||
|
||||
• **plugins**: [`CommandPlugin`](CommandPlugin.md)<keyof [`CommandModuleDefs`](../modules.md#commandmoduledefs)\>[]
|
||||
• **plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.plugins
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:45](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L45)
|
||||
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
@@ -107,8 +115,8 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[type](Module.md#type)
|
||||
Module.type
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:43](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L43)
|
||||
[src/types/core-modules.ts:112](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L112)
|
||||
|
||||
@@ -8,7 +8,7 @@ custom_edit_url: null
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`Module`](Module.md)
|
||||
- `Module`
|
||||
|
||||
↳ **`UserSelectCommand`**
|
||||
|
||||
@@ -20,11 +20,11 @@ custom_edit_url: null
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[description](Module.md#description)
|
||||
Module.description
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:38](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L38)
|
||||
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37)
|
||||
|
||||
___
|
||||
|
||||
@@ -48,11 +48,11 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[execute](Module.md#execute)
|
||||
Module.execute
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:120](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L120)
|
||||
[src/types/core-modules.ts:91](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L91)
|
||||
|
||||
___
|
||||
|
||||
@@ -62,31 +62,39 @@ ___
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Module](Module.md).[name](Module.md#name)
|
||||
Module.name
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:37](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L37)
|
||||
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### onEvent
|
||||
|
||||
• **onEvent**: [`EventPlugin`](EventPlugin.md)<[`UserSelect`](../enums/CommandType.md#userselect)\>[]
|
||||
• **onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.onEvent
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:118](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L118)
|
||||
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### plugins
|
||||
|
||||
• **plugins**: [`CommandPlugin`](CommandPlugin.md)<keyof [`CommandModuleDefs`](../modules.md#commandmoduledefs)\>[]
|
||||
• **plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
Module.plugins
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:119](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L119)
|
||||
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
@@ -96,8 +104,8 @@ ___
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Module](Module.md).[type](Module.md#type)
|
||||
Module.type
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:117](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L117)
|
||||
[src/types/core-modules.ts:90](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L90)
|
||||
|
||||
@@ -6,50 +6,64 @@ sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
An object to be passed into Sern#init() function.
|
||||
|
||||
## Properties
|
||||
|
||||
### commands
|
||||
|
||||
• `Readonly` **commands**: `string`
|
||||
• **commands**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/wrapper.ts:9](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/wrapper.ts#L9)
|
||||
[src/types/core.ts:9](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core.ts#L9)
|
||||
|
||||
___
|
||||
|
||||
### containerConfig
|
||||
|
||||
• `Readonly` **containerConfig**: `Object`
|
||||
• `Optional` **containerConfig**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `get` | (...`keys`: keyof [`Dependencies`](Dependencies.md)[]) => `unknown`[] |
|
||||
| `get` | (...`keys`: keyof `Dependencies`[]) => `unknown`[] |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/wrapper.ts:11](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/wrapper.ts#L11)
|
||||
[src/types/core.ts:20](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core.ts#L20)
|
||||
|
||||
___
|
||||
|
||||
### defaultPrefix
|
||||
|
||||
• `Optional` `Readonly` **defaultPrefix**: `string`
|
||||
• `Optional` **defaultPrefix**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/wrapper.ts:8](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/wrapper.ts#L8)
|
||||
[src/types/core.ts:10](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core.ts#L10)
|
||||
|
||||
___
|
||||
|
||||
### events
|
||||
|
||||
• `Optional` `Readonly` **events**: `string`
|
||||
• `Optional` **events**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/wrapper.ts:10](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/structures/wrapper.ts#L10)
|
||||
[src/types/core.ts:11](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core.ts#L11)
|
||||
|
||||
___
|
||||
|
||||
### mode
|
||||
|
||||
• `Optional` **mode**: `string`
|
||||
|
||||
Overload to enable mode in case developer does not use a .env file.
|
||||
|
||||
**`Deprecated`**
|
||||
|
||||
- https://github.com/sern-handler/handler/pull/325
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/core.ts:16](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core.ts#L16)
|
||||
|
||||
@@ -8,6 +8,7 @@ custom_edit_url: null
|
||||
|
||||
## Namespaces
|
||||
|
||||
- [Presence](namespaces/Presence.md)
|
||||
- [Sern](namespaces/Sern.md)
|
||||
|
||||
## Enumerations
|
||||
@@ -30,32 +31,33 @@ custom_edit_url: null
|
||||
|
||||
## Interfaces
|
||||
|
||||
- [AutocompleteCommand](interfaces/AutocompleteCommand.md)
|
||||
- [AutocompletePlugin](interfaces/AutocompletePlugin.md)
|
||||
- [BothCommand](interfaces/BothCommand.md)
|
||||
- [ButtonCommand](interfaces/ButtonCommand.md)
|
||||
- [ChannelSelectCommand](interfaces/ChannelSelectCommand.md)
|
||||
- [CommandPlugin](interfaces/CommandPlugin.md)
|
||||
- [CommandModuleDefs](interfaces/CommandModuleDefs.md)
|
||||
- [ContextMenuMsg](interfaces/ContextMenuMsg.md)
|
||||
- [ContextMenuUser](interfaces/ContextMenuUser.md)
|
||||
- [ControlPlugin](interfaces/ControlPlugin.md)
|
||||
- [Controller](interfaces/Controller.md)
|
||||
- [Dependencies](interfaces/Dependencies.md)
|
||||
- [DiscordEmitterPlugin](interfaces/DiscordEmitterPlugin.md)
|
||||
- [DiscordEventPlugin](interfaces/DiscordEventPlugin.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)
|
||||
- [EventPlugin](interfaces/EventPlugin.md)
|
||||
- [ExternalEmitterPlugin](interfaces/ExternalEmitterPlugin.md)
|
||||
- [ExternalEventPlugin](interfaces/ExternalEventPlugin.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)
|
||||
- [Module](interfaces/Module.md)
|
||||
- [ModuleManager](interfaces/ModuleManager.md)
|
||||
- [Plugin](interfaces/Plugin.md)
|
||||
- [RoleSelectCommand](interfaces/RoleSelectCommand.md)
|
||||
- [SernAutocompleteData](interfaces/SernAutocompleteData.md)
|
||||
- [SernEmitterPlugin](interfaces/SernEmitterPlugin.md)
|
||||
- [SernEventPlugin](interfaces/SernEventPlugin.md)
|
||||
- [SernEventCommand](interfaces/SernEventCommand.md)
|
||||
- [SernEventsMapping](interfaces/SernEventsMapping.md)
|
||||
- [SernSubCommandData](interfaces/SernSubCommandData.md)
|
||||
- [SernSubCommandGroupData](interfaces/SernSubCommandGroupData.md)
|
||||
- [SlashCommand](interfaces/SlashCommand.md)
|
||||
@@ -66,45 +68,33 @@ custom_edit_url: null
|
||||
|
||||
## Type Aliases
|
||||
|
||||
### AnyDefinedModule
|
||||
### AnyCommandPlugin
|
||||
|
||||
Ƭ **AnyDefinedModule**: [`DefinedCommandModule`](modules.md#definedcommandmodule) \| [`DefinedEventModule`](modules.md#definedeventmodule)
|
||||
Ƭ **AnyCommandPlugin**: [`ControlPlugin`](interfaces/ControlPlugin.md) \| [`InitPlugin`](interfaces/InitPlugin.md)<[`InitArgs`<`Processed`<[`CommandModule`](modules.md#commandmodule)\>\>]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:25](https://github.com/sern-handler/handler/blob/3daacfc/src/types/handler.ts#L25)
|
||||
[src/types/core-plugin.ts:76](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-plugin.ts#L76)
|
||||
|
||||
___
|
||||
|
||||
### AnyModule
|
||||
### AnyEventPlugin
|
||||
|
||||
Ƭ **AnyModule**: [`CommandModule`](modules.md#commandmodule) \| [`EventModule`](modules.md#eventmodule)
|
||||
Ƭ **AnyEventPlugin**: [`ControlPlugin`](interfaces/ControlPlugin.md) \| [`InitPlugin`](interfaces/InitPlugin.md)<[`InitArgs`<`Processed`<[`EventModule`](modules.md#eventmodule)\>\>]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:153](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L153)
|
||||
[src/types/core-plugin.ts:77](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-plugin.ts#L77)
|
||||
|
||||
___
|
||||
|
||||
### Args
|
||||
|
||||
Ƭ **Args**: [`ParseType`](modules.md#parsetype)<{ `slash`: [`SlashOptions`](modules.md#slashoptions) ; `text`: `string`[] }\>
|
||||
Ƭ **Args**: `ParseType`<\{ `slash`: [`SlashOptions`](modules.md#slashoptions) ; `text`: `string`[] }\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:15](https://github.com/sern-handler/handler/blob/3daacfc/src/types/handler.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
### BaseOptions
|
||||
|
||||
Ƭ **BaseOptions**: `ApplicationCommandChoicesData` \| `ApplicationCommandNonOptionsData` \| `ApplicationCommandChannelOptionData` \| `ApplicationCommandNumericOptionData` \| `ApplicationCommandAttachmentOption` \| [`SernAutocompleteData`](interfaces/SernAutocompleteData.md)
|
||||
|
||||
Type that replaces autocomplete with [SernAutocompleteData](interfaces/SernAutocompleteData.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:190](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L190)
|
||||
[src/types/utility.ts:16](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/utility.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
@@ -114,199 +104,36 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:139](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L139)
|
||||
|
||||
___
|
||||
|
||||
### CommandModuleDefs
|
||||
|
||||
Ƭ **CommandModuleDefs**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `1` | [`TextCommand`](interfaces/TextCommand.md) |
|
||||
| `1024` | [`RoleSelectCommand`](interfaces/RoleSelectCommand.md) |
|
||||
| `16` | [`ButtonCommand`](interfaces/ButtonCommand.md) |
|
||||
| `2` | [`SlashCommand`](interfaces/SlashCommand.md) |
|
||||
| `2048` | [`UserSelectCommand`](interfaces/UserSelectCommand.md) |
|
||||
| `256` | [`ChannelSelectCommand`](interfaces/ChannelSelectCommand.md) |
|
||||
| `3` | [`BothCommand`](interfaces/BothCommand.md) |
|
||||
| `32` | [`StringSelectCommand`](interfaces/StringSelectCommand.md) |
|
||||
| `4` | [`ContextMenuUser`](interfaces/ContextMenuUser.md) |
|
||||
| `512` | [`MentionableSelectCommand`](interfaces/MentionableSelectCommand.md) |
|
||||
| `64` | [`ModalSubmitCommand`](interfaces/ModalSubmitCommand.md) |
|
||||
| `8` | [`ContextMenuMsg`](interfaces/ContextMenuMsg.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:157](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L157)
|
||||
|
||||
___
|
||||
|
||||
### CommandModuleNoPlugins
|
||||
|
||||
Ƭ **CommandModuleNoPlugins**: { [T in CommandType]: Omit<CommandModuleDefs[T], "plugins" \| "onEvent"\> }
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:108](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L108)
|
||||
|
||||
___
|
||||
|
||||
### CommandModulePlugin
|
||||
|
||||
Ƭ **CommandModulePlugin**<`T`\>: [`EventPlugin`](interfaces/EventPlugin.md)<`T`\> \| [`CommandPlugin`](interfaces/CommandPlugin.md)<`T`\>
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `T` | extends [`CommandType`](enums/CommandType.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:136](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L136)
|
||||
|
||||
___
|
||||
|
||||
### DefinedCommandModule
|
||||
|
||||
Ƭ **DefinedCommandModule**: [`CommandModule`](modules.md#commandmodule) & { `description`: `string` ; `name`: `string` }
|
||||
|
||||
After modules are transformed, name and description are given default values if none
|
||||
are provided to Module. This type represents that transformation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:23](https://github.com/sern-handler/handler/blob/3daacfc/src/types/handler.ts#L23)
|
||||
|
||||
___
|
||||
|
||||
### DefinedEventModule
|
||||
|
||||
Ƭ **DefinedEventModule**: [`EventModule`](modules.md#eventmodule) & { `name`: `string` }
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:24](https://github.com/sern-handler/handler/blob/3daacfc/src/types/handler.ts#L24)
|
||||
[src/types/core-modules.ts:133](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L133)
|
||||
|
||||
___
|
||||
|
||||
### EventModule
|
||||
|
||||
Ƭ **EventModule**: `DiscordEventCommand` \| `SernEventCommand` \| `ExternalEventCommand`
|
||||
Ƭ **EventModule**: [`DiscordEventCommand`](interfaces/DiscordEventCommand.md) \| [`SernEventCommand`](interfaces/SernEventCommand.md) \| [`ExternalEventCommand`](interfaces/ExternalEventCommand.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:138](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L138)
|
||||
[src/types/core-modules.ts:132](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L132)
|
||||
|
||||
___
|
||||
|
||||
### EventModuleCommandPluginDefs
|
||||
### Initializable
|
||||
|
||||
Ƭ **EventModuleCommandPluginDefs**: `Object`
|
||||
Ƭ **Initializable**<`T`\>: `T`
|
||||
|
||||
Event Module Command Plugins
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `1` | [`DiscordEmitterPlugin`](interfaces/DiscordEmitterPlugin.md) |
|
||||
| `2` | [`SernEmitterPlugin`](interfaces/SernEmitterPlugin.md) |
|
||||
| `3` | [`ExternalEmitterPlugin`](interfaces/ExternalEmitterPlugin.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:126](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L126)
|
||||
|
||||
___
|
||||
|
||||
### EventModuleDefs
|
||||
|
||||
Ƭ **EventModuleDefs**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `1` | `DiscordEventCommand` |
|
||||
| `2` | `SernEventCommand` |
|
||||
| `3` | `ExternalEventCommand` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:172](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L172)
|
||||
|
||||
___
|
||||
|
||||
### EventModuleEventPluginDefs
|
||||
|
||||
Ƭ **EventModuleEventPluginDefs**: `Object`
|
||||
|
||||
Event Module Event Plugins
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `1` | [`DiscordEventPlugin`](interfaces/DiscordEventPlugin.md) |
|
||||
| `2` | [`SernEventPlugin`](interfaces/SernEventPlugin.md) |
|
||||
| `3` | [`ExternalEventPlugin`](interfaces/ExternalEventPlugin.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:117](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L117)
|
||||
|
||||
___
|
||||
|
||||
### EventModulePlugin
|
||||
|
||||
Ƭ **EventModulePlugin**<`T`\>: [`EventModuleEventPluginDefs`](modules.md#eventmoduleeventplugindefs)[`T`] \| [`EventModuleCommandPluginDefs`](modules.md#eventmodulecommandplugindefs)[`T`]
|
||||
Type to annotate that something is initializable.
|
||||
If T has an init method, this will be called.
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `T` | extends [`EventType`](enums/EventType.md) |
|
||||
| `T` | extends [`Init`](interfaces/Init.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:132](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L132)
|
||||
|
||||
___
|
||||
|
||||
### EventModulesNoPlugins
|
||||
|
||||
Ƭ **EventModulesNoPlugins**: { [T in EventType]: Omit<EventModuleDefs[T], "plugins" \| "onEvent"\> }
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:111](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L111)
|
||||
|
||||
___
|
||||
|
||||
### InputCommandModule
|
||||
|
||||
Ƭ **InputCommandModule**: { [T in CommandType]: CommandModuleNoPlugins[T] & Object }[[`CommandType`](enums/CommandType.md)]
|
||||
|
||||
User inputs this type. Sern processes behind the scenes for better usage
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:141](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L141)
|
||||
|
||||
___
|
||||
|
||||
### InputEventModule
|
||||
|
||||
Ƭ **InputEventModule**: { [T in EventType]: EventModulesNoPlugins[T] & Object }[[`EventType`](enums/EventType.md)]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:145](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/plugins/plugin.ts#L145)
|
||||
[src/types/ioc.ts:17](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/ioc.ts#L17)
|
||||
|
||||
___
|
||||
|
||||
@@ -328,105 +155,39 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:36](https://github.com/sern-handler/handler/blob/3daacfc/src/types/handler.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
### MapDeps
|
||||
|
||||
Ƭ **MapDeps**<`Deps`, `T`\>: `T` extends [infer First, ...(infer Rest extends readonly unknown[])] ? [`UnpackFunction`<`Deps`[`First`]\>, ...(MapDeps<Deps, Rest\> extends [never] ? [] : MapDeps<Deps, Rest\>)] : [`never`]
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `Deps` | extends [`Dependencies`](interfaces/Dependencies.md) |
|
||||
| `T` | extends readonly `unknown`[] |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:51](https://github.com/sern-handler/handler/blob/3daacfc/src/types/handler.ts#L51)
|
||||
|
||||
___
|
||||
|
||||
### OptionalDependencies
|
||||
|
||||
Ƭ **OptionalDependencies**: ``"@sern/logger"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:57](https://github.com/sern-handler/handler/blob/3daacfc/src/types/handler.ts#L57)
|
||||
|
||||
___
|
||||
|
||||
### ParseType
|
||||
|
||||
Ƭ **ParseType**<`T`\>: { [K in keyof T]: T[K] extends unknown ? [k: K, args: T[K]] : never }[keyof `T`]
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name |
|
||||
| :------ |
|
||||
| `T` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:11](https://github.com/sern-handler/handler/blob/3daacfc/src/types/handler.ts#L11)
|
||||
[src/core/contracts/logging.ts:11](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/logging.ts#L11)
|
||||
|
||||
___
|
||||
|
||||
### Payload
|
||||
|
||||
Ƭ **Payload**: { `module`: [`AnyModule`](modules.md#anymodule) ; `type`: [`Success`](enums/PayloadType.md#success) } \| { `module?`: [`AnyModule`](modules.md#anymodule) ; `reason`: `string` \| `Error` ; `type`: [`Failure`](enums/PayloadType.md#failure) } \| { `reason`: `string` ; `type`: [`Warning`](enums/PayloadType.md#warning) }
|
||||
Ƭ **Payload**: \{ `module`: `AnyModule` ; `type`: [`Success`](enums/PayloadType.md#success) } \| \{ `module?`: `AnyModule` ; `reason`: `string` \| `Error` ; `type`: [`Failure`](enums/PayloadType.md#failure) } \| \{ `reason`: `string` ; `type`: [`Warning`](enums/PayloadType.md#warning) }
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:26](https://github.com/sern-handler/handler/blob/3daacfc/src/types/handler.ts#L26)
|
||||
[src/types/utility.ts:26](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/utility.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
### ReplyOptions
|
||||
### PluginResult
|
||||
|
||||
Ƭ **ReplyOptions**: `string` \| `Omit`<`InteractionReplyOptions`, ``"fetchReply"``\> \| `MessageReplyOptions`
|
||||
Ƭ **PluginResult**: `Awaitable`<`VoidResult`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:49](https://github.com/sern-handler/handler/blob/3daacfc/src/types/handler.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
### SernEventsMapping
|
||||
|
||||
Ƭ **SernEventsMapping**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `error` | [[`Payload`](modules.md#payload)] |
|
||||
| `module.activate` | [[`Payload`](modules.md#payload)] |
|
||||
| `module.register` | [[`Payload`](modules.md#payload)] |
|
||||
| `warning` | [[`Payload`](modules.md#payload)] |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:30](https://github.com/sern-handler/handler/blob/3daacfc/src/types/handler.ts#L30)
|
||||
[src/types/core-plugin.ts:51](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-plugin.ts#L51)
|
||||
|
||||
___
|
||||
|
||||
### SernOptionsData
|
||||
|
||||
Ƭ **SernOptionsData**<`U`\>: `U` extends `ApplicationCommandSubCommandData` ? [`SernSubCommandData`](interfaces/SernSubCommandData.md) : `U` extends `ApplicationCommandSubGroupData` ? [`SernSubCommandGroupData`](interfaces/SernSubCommandGroupData.md) : [`BaseOptions`](modules.md#baseoptions)
|
||||
Ƭ **SernOptionsData**: [`SernSubCommandData`](interfaces/SernSubCommandData.md) \| [`SernSubCommandGroupData`](interfaces/SernSubCommandGroupData.md) \| `APIApplicationCommandBasicOption` \| [`SernAutocompleteData`](interfaces/SernAutocompleteData.md)
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `U` | extends `ApplicationCommandOptionData` = `ApplicationCommandOptionData` |
|
||||
Type that replaces autocomplete with [SernAutocompleteData](interfaces/SernAutocompleteData.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/module.ts:210](https://github.com/sern-handler/handler/blob/3daacfc/src/types/module.ts#L210)
|
||||
[src/types/core-modules.ts:201](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L201)
|
||||
|
||||
___
|
||||
|
||||
@@ -444,13 +205,16 @@ ___
|
||||
|
||||
▸ (): `T`
|
||||
|
||||
Type to annotate that something is a singleton.
|
||||
T is created once and lazily.
|
||||
|
||||
##### Returns
|
||||
|
||||
`T`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:37](https://github.com/sern-handler/handler/blob/3daacfc/src/types/handler.ts#L37)
|
||||
[src/types/ioc.ts:7](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/ioc.ts#L7)
|
||||
|
||||
___
|
||||
|
||||
@@ -460,7 +224,7 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:17](https://github.com/sern-handler/handler/blob/3daacfc/src/types/handler.ts#L17)
|
||||
[src/types/utility.ts:14](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/utility.ts#L14)
|
||||
|
||||
___
|
||||
|
||||
@@ -478,6 +242,9 @@ ___
|
||||
|
||||
▸ (): () => `T`
|
||||
|
||||
Type to annotate that something is transient.
|
||||
Every time this is called, a new object is created
|
||||
|
||||
##### Returns
|
||||
|
||||
`fn`
|
||||
@@ -490,29 +257,321 @@ ___
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:38](https://github.com/sern-handler/handler/blob/3daacfc/src/types/handler.ts#L38)
|
||||
[src/types/ioc.ts:12](https://github.com/sern-handler/handler/blob/9d5c6c7/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/9d5c6c7/src/core/create-plugins.ts#L69)
|
||||
|
||||
## Functions
|
||||
|
||||
### commandModule
|
||||
### CommandControlPlugin
|
||||
|
||||
▸ **commandModule**(`mod`): [`CommandModule`](modules.md#commandmodule)
|
||||
▸ **CommandControlPlugin**<`I`\>(`execute`): [`Plugin`](interfaces/Plugin.md)<`unknown`[]\>
|
||||
|
||||
The wrapper function to define command modules for sern
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `I` | extends [`CommandType`](enums/CommandType.md) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `mod` | [`InputCommandModule`](modules.md#inputcommandmodule) |
|
||||
| `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/9d5c6c7/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/9d5c6c7/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/9d5c6c7/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/9d5c6c7/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/9d5c6c7/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.
|
||||
|
||||
#### 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:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/ioc/dependency-injection.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
### 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:44](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/ioc/dependency-injection.ts#L44)
|
||||
|
||||
___
|
||||
|
||||
### 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/handler/sern.ts:64](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/sern.ts#L64)
|
||||
[src/core/modules.ts:25](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L25)
|
||||
|
||||
___
|
||||
|
||||
### 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:53](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
@@ -520,30 +579,85 @@ ___
|
||||
|
||||
▸ **eventModule**(`mod`): [`EventModule`](modules.md#eventmodule)
|
||||
|
||||
The wrapper function to define event modules for sern
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `mod` | [`InputEventModule`](modules.md#inputeventmodule) |
|
||||
| `mod` | `InputEvent` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`EventModule`](modules.md#eventmodule)
|
||||
|
||||
**`Since`**
|
||||
|
||||
1.0.0
|
||||
The wrapper function to define event modules for sern
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/sern.ts:76](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/sern.ts#L76)
|
||||
[src/core/modules.ts:38](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L38)
|
||||
|
||||
___
|
||||
|
||||
### many
|
||||
### makeDependencies
|
||||
|
||||
▸ **many**<`T`\>(`value`): () => () => `T`
|
||||
▸ **makeDependencies**<`T`\>(`conf`): `Promise`<<V\>(...`keys`: [...V[]]) => `IntoDependencies`<`V`\>\>
|
||||
|
||||
A function that returns another function
|
||||
Used for transient in iti
|
||||
#### 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:90](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/ioc/base.ts#L90)
|
||||
|
||||
___
|
||||
|
||||
### 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/9d5c6c7/src/core/create-plugins.ts#L6)
|
||||
|
||||
___
|
||||
|
||||
### single
|
||||
|
||||
▸ **single**<`T`\>(`cb`): () => `T`
|
||||
|
||||
@__PURE__
|
||||
|
||||
#### Type parameters
|
||||
|
||||
@@ -555,7 +669,46 @@ Used for transient in iti
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `value` | `T` |
|
||||
| `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/9d5c6c7/src/core/ioc/dependency-injection.ts#L11)
|
||||
|
||||
___
|
||||
|
||||
### transient
|
||||
|
||||
▸ **transient**<`T`\>(`cb`): () => () => `T`
|
||||
|
||||
@__PURE__
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name |
|
||||
| :------ |
|
||||
| `T` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `cb` | () => () => `T` |
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -573,58 +726,31 @@ Used for transient in iti
|
||||
|
||||
`T`
|
||||
|
||||
#### Defined in
|
||||
**`Since`**
|
||||
|
||||
[src/handler/utilities/functions.ts:16](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/utilities/functions.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
### single
|
||||
|
||||
▸ **single**<`T`\>(`value`): () => `T`
|
||||
|
||||
A function that returns whatever value is provided.
|
||||
Used for singleton in iti
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name |
|
||||
| :------ |
|
||||
| `T` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `value` | `T` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`fn`
|
||||
|
||||
▸ (): `T`
|
||||
|
||||
##### Returns
|
||||
|
||||
`T`
|
||||
2.0.0
|
||||
Creates a transient object
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/utilities/functions.ts:10](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/utilities/functions.ts#L10)
|
||||
[src/core/ioc/dependency-injection.ts:21](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/ioc/dependency-injection.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
### useContainerRaw
|
||||
|
||||
▸ **useContainerRaw**(): ``null`` \| `Container`<[`Dependencies`](interfaces/Dependencies.md), `Partial`<[`Dependencies`](interfaces/Dependencies.md)\>\>
|
||||
|
||||
Returns the underlying data structure holding all dependencies.
|
||||
Exposes some methods from iti
|
||||
▸ **useContainerRaw**(): `CoreContainer`<`Partial`<`Dependencies`\>\>
|
||||
|
||||
#### Returns
|
||||
|
||||
``null`` \| `Container`<[`Dependencies`](interfaces/Dependencies.md), `Partial`<[`Dependencies`](interfaces/Dependencies.md)\>\>
|
||||
`CoreContainer`<`Partial`<`Dependencies`\>\>
|
||||
|
||||
**`Deprecated`**
|
||||
|
||||
Returns the underlying data structure holding all dependencies.
|
||||
Exposes methods from iti
|
||||
Use the Service API. The container should be readonly
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/dependencies/provider.ts:74](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/dependencies/provider.ts#L74)
|
||||
[src/core/ioc/base.ts:18](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/ioc/base.ts#L18)
|
||||
|
||||
31
docs/api/namespaces/CommandError.md
Normal file
31
docs/api/namespaces/CommandError.md
Normal 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)
|
||||
93
docs/api/namespaces/Presence.md
Normal file
93
docs/api/namespaces/Presence.md
Normal 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/9d5c6c7/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/9d5c6c7/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 |
|
||||
| :------ | :------ |
|
||||
| `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:39](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/presences.ts#L39)
|
||||
@@ -6,124 +6,35 @@ sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## References
|
||||
|
||||
### CommandExecutable
|
||||
|
||||
Re-exports [CommandExecutable](../classes/CommandExecutable.md)
|
||||
|
||||
___
|
||||
|
||||
### EventExecutable
|
||||
|
||||
Re-exports [EventExecutable](../classes/EventExecutable.md)
|
||||
|
||||
___
|
||||
|
||||
### commandModule
|
||||
|
||||
Re-exports [commandModule](../modules.md#commandmodule-1)
|
||||
|
||||
___
|
||||
|
||||
### eventModule
|
||||
|
||||
Re-exports [eventModule](../modules.md#eventmodule-1)
|
||||
|
||||
## Variables
|
||||
|
||||
### controller
|
||||
|
||||
• `Const` **controller**: `Object`
|
||||
|
||||
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/handler/sern.ts:55](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/sern.ts#L55)
|
||||
|
||||
## Functions
|
||||
|
||||
### init
|
||||
|
||||
▸ **init**(`wrapper`): `void`
|
||||
|
||||
**`Example`**
|
||||
|
||||
```ts title="src/index.ts"
|
||||
Sern.init({
|
||||
defaultPrefix: '!',
|
||||
commands: 'dist/commands',
|
||||
events: 'dist/events',
|
||||
containerConfig : {
|
||||
get: useContainer
|
||||
}
|
||||
})
|
||||
```
|
||||
▸ **init**(`maybeWrapper`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `wrapper` | [`Wrapper`](../interfaces/Wrapper.md) | Options to pass into sern. Function to start the handler up |
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `maybeWrapper` | [`Wrapper`](../interfaces/Wrapper.md) \| ``"file"`` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
**`Since`**
|
||||
|
||||
[src/handler/sern.ts:38](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/sern.ts#L38)
|
||||
1.0.0
|
||||
|
||||
___
|
||||
**`Example`**
|
||||
|
||||
### makeDependencies
|
||||
|
||||
▸ **makeDependencies**<`T`\>(`conf`): <V\>(...`keys`: [...V[]]) => [`MapDeps`](../modules.md#mapdeps)<`T`, `V`\>
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `T` | extends [`Dependencies`](../interfaces/Dependencies.md) |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `conf` | `Object` | a configuration for creating your project dependencies |
|
||||
| `conf.build` | (`root`: `Container`<`Record`<`string`, `unknown`\>, {}\>) => `Container`<`Partial`<`T`\>, {}\> | - |
|
||||
| `conf.exclude?` | `Set`<``"@sern/logger"``\> | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
`fn`
|
||||
|
||||
▸ <`V`\>(...`keys`): [`MapDeps`](../modules.md#mapdeps)<`T`, `V`\>
|
||||
|
||||
##### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `V` | extends keyof `T`[] |
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `...keys` | [...V[]] |
|
||||
|
||||
##### Returns
|
||||
|
||||
[`MapDeps`](../modules.md#mapdeps)<`T`, `V`\>
|
||||
```ts title="src/index.ts"
|
||||
Sern.init({
|
||||
commands: 'dist/commands',
|
||||
events: 'dist/events',
|
||||
})
|
||||
```
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/sern.ts:87](https://github.com/sern-handler/handler/blob/3daacfc/src/handler/sern.ts#L87)
|
||||
[src/sern.ts:27](https://github.com/sern-handler/handler/blob/9d5c6c7/src/sern.ts#L27)
|
||||
|
||||
30
docs/cli/README.md
Normal file
30
docs/cli/README.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# 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.
|
||||
```
|
||||
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 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]
|
||||
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
|
||||
help [command] display help for command
|
||||
```
|
||||
211
docs/cli/build.md
Normal file
211
docs/cli/build.md
Normal file
@@ -0,0 +1,211 @@
|
||||
```sh
|
||||
Usage: sern build [options]
|
||||
|
||||
Build your bot
|
||||
|
||||
Options:
|
||||
-f --format [fmt] The module system of your application. `cjs` or `esm` (default: "esm")
|
||||
-m --mode [mode] the mode for sern to build in. `production` or `development` (default: "development")
|
||||
-W --suppress-warnings suppress experimental warning
|
||||
-p --project [filePath] build with this sern.build file
|
||||
-h, --help display help for command
|
||||
```
|
||||
|
||||
## Guiding Principles
|
||||
|
||||
When designing the `sern build` command, our aim was to make building bot applications as simple as possible for the majority of developers. The setup process has been streamlined, and most of the configuration details have been handled for you. Here are some key points to keep in mind:
|
||||
|
||||
1. **Minimal Configuration**: In the vast majority (99%) of use cases, developers do not need to configure the bot application building process. We believe that simplicity is key, so only a few decisions need to be made on the developer's end.
|
||||
|
||||
2. **Optimal Defaults**: We've chosen sensible defaults. This means you can get started without getting bogged down by complex, unneeded configurations.
|
||||
|
||||
3. **Finetuned for production bots**: Our CLI leverages an opinionated build solution powered by esbuild. This ensures that bots are built without issues and can be shipped easily.
|
||||
|
||||
## Experimental Features
|
||||
|
||||
Both the `sern build` and `sern publish` commands are marked as experimental. While they might not be completely stable, they are designed to work for the majority of users. We appreciate any feedback in helping us make these features even better.
|
||||
|
||||
## Features
|
||||
|
||||
The `sern build` command comes equipped with a range of features designed to enhance your development process. Here's a glimpse of what it offers:
|
||||
|
||||
- **esbuild Integration**: our CLI takes inspiration from the efficiency of SvelteKit, ensuring your bot application is built effectively and with type safety. Leverage the [esbuild plugin ecosystem](https://github.com/esbuild/community-plugins).
|
||||
|
||||
- **Zero Configuration**: Building your bot application without additional configuration. The CLI handles most of the setup for you.
|
||||
|
||||
- **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.
|
||||
|
||||
- **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
|
||||
- command line arguments take precendence over sern.build configuration file
|
||||
- default build format is ESM
|
||||
- defineVersion = true
|
||||
- __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
|
||||
{
|
||||
// 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.
|
||||
[Here](https://esbuild.github.io/api/#drop-labels) is the esbuild full API documentation
|
||||
### drop labels
|
||||
|
||||
```sh
|
||||
# mode is set to production
|
||||
sern build
|
||||
```
|
||||
|
||||
|
||||
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>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### constants
|
||||
sern builds with three default constants. \_\_DEV\_\_, \_\_PROD\_\_, \_\_VERSION\_\_.
|
||||
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="input" label="Preprocess">
|
||||
|
||||
```sh
|
||||
sern build
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="sh" label="Constants available and typesafe!">
|
||||
|
||||
```ts
|
||||
if(__PROD__) {
|
||||
console.log('Bot version: ' + __VERSION__)
|
||||
}
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
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
|
||||
DISCORD_TOKEN=<your token>
|
||||
```
|
||||
```ts
|
||||
process.env.DISCORD_TOKEN // string | undefined (not typesafe :()
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="sh" label="sern build">
|
||||
|
||||
```sh
|
||||
sern build
|
||||
```
|
||||
```ts
|
||||
process.env.DISCORD_TOKEN // string (typesafe :))
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
28
docs/cli/clear.md
Normal file
28
docs/cli/clear.md
Normal file
@@ -0,0 +1,28 @@
|
||||
```sh
|
||||
Usage: sern commands clear [options]
|
||||
|
||||
Clear and reset commands-data-remote.json and the api
|
||||
|
||||
Options:
|
||||
-y, --yes Say yes to all prompts
|
||||
-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:
|
||||
```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.
|
||||
|
||||
- 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)
|
||||
|
||||
- Automatically confirm with the **-y** flag.
|
||||
|
||||
## Features
|
||||
- Clears all application data and sern-commands-data.json
|
||||
|
||||
|
||||
11
docs/cli/extra.md
Normal file
11
docs/cli/extra.md
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
```sh
|
||||
Usage: sern extra [options]
|
||||
|
||||
Easy way to add extra things in your sern project
|
||||
|
||||
Options:
|
||||
-h, --help display help for command
|
||||
```
|
||||
|
||||
This command is pretty straightfoward. Install utilities into your application. Assumes you have a sern.config.json.
|
||||
92
docs/cli/publish.md
Normal file
92
docs/cli/publish.md
Normal file
@@ -0,0 +1,92 @@
|
||||
```sh
|
||||
Usage: sern commands publish [options] [path]
|
||||
|
||||
New way to manage your slash commands
|
||||
|
||||
Arguments:
|
||||
path path with respect to current working directory that will locate all published files
|
||||
|
||||
Options:
|
||||
-i, --import [scriptPath...] Prerequire a script to load into publisher
|
||||
-t, --token [token]
|
||||
--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:
|
||||
```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.
|
||||
|
||||
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
|
||||
|
||||

|
||||
|
||||
|
||||
## Features
|
||||
- Automatically syncs api with your command base
|
||||
- generates JSON file of output (**.sern/command-data-remote.json**)
|
||||
- supports publishing direct esm typescript files
|
||||
- commonjs users need to compile first and then run sern publish on the dist/ output
|
||||
- prerequire scripts.
|
||||
- supports a configuration that is the same as the original publish plugin.
|
||||
|
||||
|
||||
Each command file can have an extra config that follows this typescript interface:
|
||||
PermissionResolvable is a discord.js type, but it will accept anything that the discord API accepts
|
||||
|
||||
```ts
|
||||
interface ValidPublishOptions {
|
||||
guildIds: string[];
|
||||
dmPermission: boolean;
|
||||
defaultMemberPermissions: PermissionResolvable;
|
||||
}
|
||||
|
||||
```
|
||||
## Prerequiring
|
||||
Is there a [service](../guide/walkthrough/services) that is required at the top level of a command?
|
||||
- Create an ES6 script anywhere:
|
||||
|
||||
```ts title="scripts/prerequire.mjs"
|
||||
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()
|
||||
```
|
||||
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 = {
|
||||
guildIds: ["889026545715400705"]
|
||||
}
|
||||
|
||||
export default commandModule( {
|
||||
type: CommandType.Slash
|
||||
description: `${client.user.username}'s ping`,
|
||||
execute: (ctx) => {
|
||||
ctx.reply('pong')
|
||||
}
|
||||
})
|
||||
|
||||
```
|
||||
@@ -4,6 +4,9 @@ Welcome to our official guide. This guide will go through all the core features
|
||||
- 💖 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
|
||||
|
||||
@@ -12,11 +15,13 @@ Welcome to our official guide. This guide will go through all the core features
|
||||
* 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)
|
||||
- [Command Plugins](walkthrough/plugins.md#command-plugins)
|
||||
- [Event Plugins](walkthrough/plugins.md#event-plugins)
|
||||
- [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)
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
# Choosing an IDE
|
||||
|
||||
Choosing an IDE is a matter of personal preference. The following are some
|
||||
Choosing an IDE is a matter of personal preference. They make programming easier. The following are some
|
||||
suggestions for choosing an IDE:
|
||||
|
||||
* [Visual Studio Code](https://code.visualstudio.com)
|
||||
* we have an [snippet extension](https://marketplace.visualstudio.com/items?itemName=SrIzan.sern-snippets) to help automate development :)
|
||||
* [Sublime Text](https://www.sublimetext.com/)
|
||||
* [NotePad++](https://notepad-plus-plus.org/)
|
||||
* [nvim](https://neovim.io/) (chad)
|
||||
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
|
||||
# Preparing to Code
|
||||
|
||||
After installing and IDE you need to install node.
|
||||
After installing an IDE, you need to install node.
|
||||
|
||||
You can download the LTS version of node right [here](https://nodejs.org/en/download/)
|
||||
[Click to download the LTS version of node right here](https://nodejs.org/en/download/).
|
||||
|
||||
After you downloaded node you will need:
|
||||
|
||||
#### [Discord token](https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-&-getting-a-token)
|
||||
|
||||
|
||||
CONTINUE 🤓
|
||||
|
||||
Install discord.js with
|
||||
```shell
|
||||
npm install discord.js@latest
|
||||
```
|
||||
|
||||
45
docs/guide/walkthrough/autocomplete.md
Normal file
45
docs/guide/walkthrough/autocomplete.md
Normal file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
sidebar_position: 7
|
||||
---
|
||||
|
||||
# Autocomplete
|
||||
|
||||
|
||||
Autocomplete is a special interaction where it can happen on multiple options on a single command. We've handled this with a simple
|
||||
tree search algorithm in a nested options tree.
|
||||
|
||||
## Example
|
||||
|
||||
```ts title="src/commands/cheese.ts" {11-18}
|
||||
export default commandModule({
|
||||
type: CommandType.Slash,
|
||||
description: "show me cheese",
|
||||
options: [
|
||||
{
|
||||
name: "list",
|
||||
type: ApplicationCommandOptionType.String,
|
||||
description: "pick a cheese to show",
|
||||
required: true,
|
||||
autocomplete: true,
|
||||
command: {
|
||||
onEvent: [],
|
||||
execute: (ctx) => {
|
||||
const focus = ctx.options.getFocused();
|
||||
ctx.respond(['gouda', 'parmesan', 'harvati']
|
||||
.map((cheese) => ({ name: cheese, value: cheese })));
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
execute: (ctx, [, args]) => {
|
||||
const cheese = args.getString('list', true);
|
||||
ctx.reply('selected cheese');
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
```
|
||||
|
||||
Sern will handle autocomplete interactions at arbitrary depths and subcommand levels.
|
||||
|
||||
|
||||
@@ -5,25 +5,24 @@ sidebar_position: 2
|
||||
# CLI
|
||||
|
||||
Setting up the [CLI](https://github.com/sern-handler/cli) is easy. <br />
|
||||
- To start a brand-new project, run :
|
||||
The cli is your plug to the sern ecosystem. This will allow you to install plugins with ease, install extra utilities, and much more.
|
||||
If you haven't yet:
|
||||
```sh
|
||||
sern init (-y)
|
||||
npm install -g @sern/cli
|
||||
```
|
||||
|
||||
:::tip
|
||||
It creates a directory for you so you don't need to!
|
||||
:::
|
||||
|
||||
Include the `-y` flag if you want to set up defaults. The default langauge is [Typescript](https://www.typescriptlang.org/) <br />
|
||||
|
||||
- To install [plugins](plugins.md) maintained by the community [repository](https://github.com/sern-handler/awesome-plugins),
|
||||
|
||||
```
|
||||
sern plugins
|
||||
```
|
||||
:::info
|
||||
Make sure to have a correct [sern.config.json](./good-to-know.md#sernconfigjson)
|
||||
:::
|
||||
|
||||
|
||||
This will display a menu selection of all installable plugins. <br />
|
||||
|
||||
**Note**: You must have a [sern.config.json](good-to-know.md) to use this command.
|
||||
If you want to view plugins, visit the repository linked above.
|
||||
|
||||
@@ -32,3 +31,4 @@ If you want to view plugins, visit the repository linked above.
|
||||
sern extra
|
||||
```
|
||||
|
||||
We have a more in depth [guide](../../cli/README.md) of the CLI
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
---
|
||||
sidebar_position: 8
|
||||
sidebar_position: 9
|
||||
---
|
||||
|
||||
# Conclusion
|
||||
If you reached this far, thank you for reading! We hope you have learned the necessities you need
|
||||
to create a bot with the sern framework. If you have any other questions, bugs, feature requests, concerns, please join our
|
||||
[community server](https://sern.dev/discord), and we'll be glad to answer your questions.
|
||||
[community server](https://sern.dev/discord), and we'll be glad to answer your questions.
|
||||
|
||||

|
||||
|
||||
|
||||
107
docs/guide/walkthrough/dependency-injection.md
Normal file
107
docs/guide/walkthrough/dependency-injection.md
Normal file
@@ -0,0 +1,107 @@
|
||||
---
|
||||
sidebar_position: 7
|
||||
---
|
||||
:::warning
|
||||
This contains version 2 code. Please view [transitioning to v3](../transition)
|
||||
:::
|
||||
|
||||
Since version 2.0.0, dependency injection, thanks to [iti](https://github.com/molszanski/iti), is a feature to customize your bot's utilities and structures.
|
||||
|
||||
Minimal setup for any project.
|
||||
|
||||
```ts
|
||||
const client = new Client({
|
||||
...options
|
||||
})
|
||||
Sern.makeDependencies<MyDependencies>({
|
||||
build: root =>
|
||||
root.add({
|
||||
'@sern/client': single(() => client)
|
||||
})
|
||||
})
|
||||
|
||||
```
|
||||
For any typescript project, you'll need to add an interface to get intellisense and typings.
|
||||
```typescript
|
||||
interface MyDependencies extends Dependencies {
|
||||
'@sern/client': Singleton<Client>
|
||||
}
|
||||
```
|
||||
Full Dependency Injection setup
|
||||
```typescript
|
||||
const client = new Client({
|
||||
...options
|
||||
})
|
||||
|
||||
interface MyDependencies extends Dependencies {
|
||||
'@sern/client': Singleton<Client>
|
||||
}
|
||||
|
||||
export const useContainer = Sern.makeDependencies<MyDependencies>({
|
||||
build: root =>
|
||||
root.add({
|
||||
'@sern/client': single(() => client)
|
||||
})
|
||||
})
|
||||
|
||||
```
|
||||
Everything else is handled. However, you may want customize things.
|
||||
|
||||
## Adding dependencies to root
|
||||
Each sern built dependency must implement its contracts.
|
||||
- `@sern/logger`: Log data. [Logging](../../api/interfaces/Logging)
|
||||
- `@sern/errors`: Handling errors and lifetime. [ErrorHandling](../../api/interfaces/ErrorHandling)
|
||||
- `@sern/modules`: Managing all command modules. [ModuleManager](../../api/interfaces/ModuleManager)
|
||||
- `@sern/emitter`: is the key to emit events and occurences in a project. [SernEmitter](../../api/classes/SernEmitter)
|
||||
|
||||
|
||||
You may also add disposers so that when the application crashes, the targeted dependency calls that function.
|
||||
|
||||
```typescript
|
||||
export const useContainer = Sern.makeDependencies<MyDependencies>({
|
||||
build: root =>
|
||||
root.add({
|
||||
'@sern/client': single(() => client)
|
||||
})
|
||||
.addDisposer({ '@sern/client': client => client.destroy() })
|
||||
})
|
||||
|
||||
```
|
||||
|
||||
:::tip
|
||||
Below is v3 api.
|
||||
:::
|
||||
|
||||
## Init
|
||||
Do you need to perform intializing behavor for a dependency?
|
||||
|
||||
```ts
|
||||
import { Init } from '@sern/handler';
|
||||
class Database implements Init {
|
||||
init() {
|
||||
await this.connect()
|
||||
console.log('Connected');
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Modify you Dependencies interface:
|
||||
```ts title="src/dependencies.d.ts"
|
||||
import type { Initializable } from '@sern/handler'
|
||||
|
||||
interface Dependencies extends CoreDependencies {
|
||||
database: Initializable<Database>
|
||||
}
|
||||
|
||||
```
|
||||
Make sure its been added:
|
||||
```ts title="src/index.ts"
|
||||
await makeDependencies({
|
||||
build: root => root
|
||||
.add({ database => new Database() })
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +1,41 @@
|
||||
---
|
||||
sidebar_position: 3
|
||||
sidebar_position: 4
|
||||
---
|
||||
|
||||
# First Command
|
||||
|
||||
We will dissect a basic command.
|
||||
If you installed a new project via the cli, This is the `ping` command located in src/commands folder.
|
||||
|
||||
Typescript
|
||||
```typescript
|
||||
:::tip
|
||||
TLDR: command modules are discord bot commands. There are many types, and each one will correspond to an event from discord.
|
||||
For example, CommandType.Slash commands will listen to slash command interactions.
|
||||
:::
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="js" label="JavaScript">
|
||||
|
||||
```js
|
||||
const { CommandType, commandModule } = require('@sern/handler');
|
||||
|
||||
export default commandModule({
|
||||
type: CommandType.Both,
|
||||
plugins: [],
|
||||
description: 'A ping command',
|
||||
// alias : [],
|
||||
execute: async (ctx, args) => {
|
||||
await ctx.reply('Pong 🏓');
|
||||
},
|
||||
})
|
||||
```
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="ts" label="Typescript">
|
||||
|
||||
```ts
|
||||
import { commandModule, CommandType } from '@sern/handler';
|
||||
|
||||
export default commandModule({
|
||||
@@ -19,21 +47,14 @@ export default commandModule({
|
||||
await ctx.reply({ content: 'Pong 🏓' });
|
||||
},
|
||||
});
|
||||
```
|
||||
Javascript
|
||||
```javascript
|
||||
const { CommandType, commandModule } = require('@sern/handler');
|
||||
|
||||
exports.default = commandModule({
|
||||
type: CommandType.Both,
|
||||
plugins: [],
|
||||
description: 'A ping command',
|
||||
// alias : [],
|
||||
execute: async (ctx, args) => {
|
||||
await ctx.reply('Pong 🏓');
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
|
||||
To view what each of these properties mean in depth, visit the [official documentation](https://sern.dev/docs/api/enums/CommandType).
|
||||
### Types of command modules
|
||||
Every command module `type` is part of an enum. This field allows type inference for the rest of a module's fields. <br />
|
||||
@@ -43,7 +64,27 @@ All the command types can be found in the [official documentation](https://sern.
|
||||
**Note**: Keep in mind you'll need to send a modal with a custom id `dm-me`. This example below is the response to a modal being sent.
|
||||
<br />
|
||||
|
||||
Typescript:
|
||||
<Tabs>
|
||||
<TabItem value="js" label="JavaScript">
|
||||
|
||||
```javascript
|
||||
const { CommandType, commandModule } = require('@sern/handler');
|
||||
exports.default = commandModule({
|
||||
name: 'dm-me',
|
||||
type: CommandType.Modal,
|
||||
async execute (modal) {
|
||||
const value = modal.fields.getTextInputValue('message');
|
||||
modal.client.users.fetch('182326315813306368').then( u =>
|
||||
u.send(value + ` from ${modal.user}`)
|
||||
);
|
||||
modal.reply( { ephemeral:true, content: 'Sent' })
|
||||
}
|
||||
});
|
||||
```
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="ts" label="Typescript">
|
||||
|
||||
```typescript
|
||||
import { commandModule, CommandType } from '@sern/handler';
|
||||
export default commandModule({
|
||||
@@ -58,21 +99,12 @@ export default commandModule({
|
||||
}
|
||||
});
|
||||
```
|
||||
Javascript:
|
||||
```javascript
|
||||
const { CommandType, commandModule } = require('@sern/handler');
|
||||
exports.default = commandModule({
|
||||
name: 'dm-me',
|
||||
type: CommandType.Modal,
|
||||
async execute (modal) {
|
||||
const value = modal.fields.getTextInputValue('message');
|
||||
modal.client.users.fetch('182326315813306368').then( u =>
|
||||
u.send(value + ` from ${modal.user}`)
|
||||
);
|
||||
modal.reply( { ephemeral:true, content: 'Sent' })
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
|
||||
Commands are straight forward. Keep in mind, every other property on the commandModule object is
|
||||
optional **except** the type and execute function.
|
||||
|
||||
@@ -85,31 +117,4 @@ The Context class is passed into modules with type:
|
||||
- `CommandType.Text`
|
||||
|
||||
This data structure helps interop between legacy commands and slash commands with ease.
|
||||
:::note
|
||||
View the [docs](../../api/classes/Context.md)
|
||||
:::
|
||||
|
||||
Typescript:
|
||||
```typescript
|
||||
export default commandModule({
|
||||
name: 'ping',
|
||||
type: CommandType.Both,
|
||||
async execute(ctx: Context) {
|
||||
await ctx.reply(`pong ${ctx.user}`)
|
||||
// .reply is shared between both message and interaction!
|
||||
// So is an User object!
|
||||
}
|
||||
});
|
||||
```
|
||||
Javascript:
|
||||
```javascript
|
||||
exports.default = commandModule({
|
||||
name: 'ping',
|
||||
type: CommandType.Both,
|
||||
async execute(ctx) { //ctx is a Context instance
|
||||
await ctx.reply(`pong ${ctx.user}`)
|
||||
// .reply is shared between both message and interaction!
|
||||
// So is an User object!
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
@@ -1,63 +1,76 @@
|
||||
---
|
||||
sidebar_position: 4
|
||||
sidebar_position: 5
|
||||
---
|
||||
|
||||
# First Event Module
|
||||
We will dissect a basic event module. <br />
|
||||
Typescript:
|
||||
```typescript
|
||||
export default eventModule({
|
||||
type: EventType.Sern,
|
||||
plugins : [], //NOT SUPPORTED YET!!
|
||||
name: 'module.activate', //name of event.
|
||||
execute(event) {
|
||||
console.log(event);
|
||||
}
|
||||
})
|
||||
```
|
||||
Javascript:
|
||||
|
||||
:::tip
|
||||
TLDR: event modules are event listeners. there are three types EventType.Discord, EventType.Sern, EventType.External
|
||||
:::
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="js" label="JavaScript">
|
||||
|
||||
```javascript
|
||||
exports.default = eventModule({
|
||||
type: EventType.Sern,
|
||||
plugins : [], //NOT SUPPORTED YET!!
|
||||
plugins : [],
|
||||
name: 'module.activate',
|
||||
execute(event) {
|
||||
console.log(event);
|
||||
}
|
||||
})
|
||||
```
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="ts" label="Typescript">
|
||||
|
||||
```typescript
|
||||
export default eventModule({
|
||||
type: EventType.Sern,
|
||||
plugins : [],
|
||||
name: 'module.activate', //name of event.
|
||||
execute(event) {
|
||||
console.log(event);
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
Like command modules, the `type` property denotes what kind of event it is, which
|
||||
can be found [here](https://sern.dev/docs/api/enums/EventType).
|
||||
|
||||
To view what each of these properties mean in depth, visit the [official documentation](https://sern.dev/docs/api/enums/EventType).
|
||||
|
||||
<br />
|
||||
Event modules are laid out similarly to command modules. These listen to any and all event you provide.
|
||||
In the current version 1.1.0-beta, plugins are not supported.
|
||||
## External
|
||||
|
||||
### Another example of an event module
|
||||
In version 2 & 3, any dependency that you have passed into makeDependencies can be registered here as well.
|
||||
|
||||
Typescript:
|
||||
```typescript
|
||||
export default eventModule({
|
||||
type: EventType.Discord,
|
||||
plugins : [],
|
||||
name: 'guildMemberAdd', //name of event.
|
||||
async execute(member: GuildMember) {
|
||||
(await member.guild.channels.fetch('channel-id') as TextChannel).send(`Welcome, ${member}`);
|
||||
}
|
||||
```ts title="src/index.ts"
|
||||
await makeDependencies({
|
||||
build: root => root.add({
|
||||
eventlistener: single(() => new EventEmitter())
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
Javascript:
|
||||
```javascript
|
||||
```ts title="events/myevent.ts"
|
||||
export default eventModule({
|
||||
type: EventType.External,
|
||||
emitter: 'eventlistener',
|
||||
execute: (args) => {
|
||||
console.log('Got event from eventlistener: ', args);
|
||||
}
|
||||
|
||||
exports.default = eventModule({
|
||||
type: EventType.Discord,
|
||||
plugins : [], //NOT SUPPORTED YET!!
|
||||
name: 'guildMemberAdd', //name of event.
|
||||
async execute(member) {
|
||||
(await member.guild.channels.fetch('channel-id')).send(`Welcome, ${member}`);
|
||||
}
|
||||
})
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -2,8 +2,50 @@
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Goal
|
||||
|
||||
sern strives to be minimalist, but with all batteries included. Meaning, this framework provides the necessary tools
|
||||
to start up a bot in minutes, and leaves plenty room space to customize your experience and create an amazing project.
|
||||
It should include all the tools for any bot at any scale.
|
||||
|
||||
# Goal
|
||||
|
||||
This walkthrough will be written in [TypeScript](https://www.typescriptlang.org/) but will have JavaScript snippets throughout.
|
||||
|
||||
# Make robust, modular, bots
|
||||
|
||||
- *Modularity*: sern is built with modularity in mind. You can swap pieces and parts easily.
|
||||
- *Familiar*: commands and structures are similar to classic v12 handlers and the official discord.js command handler guide, while packing many features
|
||||
- *Concise*: Too much code is a liability. with sern, write less for more 🤯
|
||||
|
||||
|
||||
### Using @sapphire/framework
|
||||
```ts title="commands/ping.ts" showLineNumbers
|
||||
import { Command } from '@sapphire/framework'
|
||||
import type { CommandInteraction } from 'discord.js'
|
||||
|
||||
export class PingCommand extends Command {
|
||||
public constructor(context: Command.Context) {
|
||||
super(context, {
|
||||
description: 'Pong!',
|
||||
chatInputCommand: {
|
||||
register: true,
|
||||
},
|
||||
})
|
||||
}
|
||||
public async chatInputRun(interaction: CommandInteraction) {
|
||||
await interaction.reply('Pong!')
|
||||
}
|
||||
}
|
||||
```
|
||||
### Using @sern/handler
|
||||
```ts title="commands/ping.ts" showLineNumbers
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { publish } from '../plugins';
|
||||
|
||||
export default commandModule({
|
||||
type: CommandType.Both,
|
||||
plugins: [publish()],
|
||||
description: 'Pong!',
|
||||
execute: (ctx, args) => {
|
||||
await ctx.reply('Pong!')
|
||||
}
|
||||
})
|
||||
```
|
||||
Keep in mind the above example acts as both a slash command AND text command
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
sidebar_position: 7
|
||||
sidebar_position: 9
|
||||
---
|
||||
|
||||
# Good to know
|
||||
@@ -21,4 +21,4 @@ Or, if this is a brand-new project, `sern init` automatically installs it.
|
||||
"commands": "commands"
|
||||
}
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
12
docs/guide/walkthrough/new-project.md
Normal file
12
docs/guide/walkthrough/new-project.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Create a new project
|
||||
|
||||
```sh
|
||||
npm create @sern/bot
|
||||
```
|
||||
and follow the interactive prompts.
|
||||
|
||||
if somehow you need help, feel free to ask [here](https://sern.dev.discord)
|
||||
@@ -1,59 +1,45 @@
|
||||
---
|
||||
sidebar_position: 5
|
||||
sidebar_position: 6
|
||||
---
|
||||
|
||||
# Plugins
|
||||
|
||||
<p>As of now, modules seem a little underwhelming. It appears that sern doesn't have all the features of a standard handler,
|
||||
which manages permissions, categorizes, cool-downs, publishes application commands, role permissions, etc.</p>
|
||||
:::tip
|
||||
TLDR: Plugins help reduce code repetition and are installable via `sern plugins`. Put them onto the plugins field of a command/event module.
|
||||
:::
|
||||
|
||||
## Installing
|
||||
Chances are, you just want your bot to work. Plugins can preprocess and create reusable conditions for modules.
|
||||
|
||||
<p>Many important parts that manage access and help streamline command creation to make are apparently absent.
|
||||
Below is an example of an event plugin, one of the types of plugins.</p>
|
||||
|
||||
Typescript:
|
||||
```typescript
|
||||
export function serenOnly(): EventPlugin<CommandType.Both> {
|
||||
return {
|
||||
type: PluginType.Event,
|
||||
async execute([ctx, args], controller) {
|
||||
if (ctx.user.id !== "182326315813306368") {
|
||||
await ctx.reply({content: "You cannot use this command"})
|
||||
return controller.stop()
|
||||
}
|
||||
return controller.next();
|
||||
}
|
||||
}
|
||||
}
|
||||
run:
|
||||
```sh
|
||||
sern plugins
|
||||
```
|
||||
Javascript:
|
||||
```javascript
|
||||
export function serenOnly() {
|
||||
return {
|
||||
type: PluginType.Event,
|
||||
async execute([ctx, args], controller) {
|
||||
if (ctx.user.id !== "182326315813306368") {
|
||||
await ctx.reply({content: "You cannot use this command"})
|
||||
return controller.stop()
|
||||
}
|
||||
return controller.next();
|
||||
}
|
||||
- Install your favorite(s) (or the ones that look the coolest). In my imaginary mind, I installed the ownerOnly plugin.
|
||||
- This should install in `plugins` directory in `src`.
|
||||
- Some plugins only work with specific types. Most are targeted towards slash / both modules.
|
||||
- Add to your module.
|
||||
|
||||
```ts
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { ownerOnly } from '../plugins'
|
||||
|
||||
export default commandModule({
|
||||
type: CommandType.Both,
|
||||
plugins: [ownerOnly(['182326315813306368')],
|
||||
description: 'ping command',
|
||||
execute: (ctx) => {
|
||||
ctx.reply('hello, owner');
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
```
|
||||
#### ┗|`O′|┛ perfect, your first plugin!
|
||||
|
||||
<br /> As part of our extensibility, the plugins feature make sern just as powerful, if not more powerful than
|
||||
standard handlers.
|
||||
Plugins modify and add new behavior to standard modules, extending customizability and implementing automation.
|
||||
## Creating your own plugins
|
||||
|
||||
<br /> At the moment, there are two types of plugins:
|
||||
The controller determines in plugins whether to continue or fail.
|
||||
|
||||
- Command Plugins
|
||||
- Event Plugins
|
||||
|
||||
## Command Plugins
|
||||
All modules are registered into sern's system. With command plugins, you can modify how commands are loaded,
|
||||
or do some kind of preprocessing before they are loaded.
|
||||
### The controller object
|
||||
```typescript
|
||||
export interface Controller {
|
||||
@@ -61,90 +47,38 @@ export interface Controller {
|
||||
stop: () => Err<void>;
|
||||
}
|
||||
```
|
||||
## Init Plugins
|
||||
Init plugins modify how commands are loaded or do preprocessing.
|
||||
An instance of the above object is passed into every plugin. <br />
|
||||
This controls whether a module is stored into sern. <br />
|
||||
Typescript:
|
||||
|
||||
```typescript
|
||||
export function inDir(dir : string) : CommandPlugin<CommandType.Both> {
|
||||
return {
|
||||
type: PluginType.Command,
|
||||
async execute(wrapper, { absPath, module }, controller) {
|
||||
if(path.dirname(absPath) !== dir) {
|
||||
console.log(+new Date(), `${module.name} is not in the correct directory!`);
|
||||
return controller.stop()
|
||||
}
|
||||
console.log(+new Date(), `${module.name} is in the correct directory!`);
|
||||
return controller.next(); //continue
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
Javascript:
|
||||
```javascript
|
||||
export function inDir(dir : string) {
|
||||
return {
|
||||
type: PluginType.Command,
|
||||
async execute(wrapper, { absPath, module }, controller) {
|
||||
if(path.dirname(absPath) !== dir) {
|
||||
import { CommandInitPlugin } from '@sern/handler'
|
||||
import path from 'path'
|
||||
export const inDir = (dir: string) => {
|
||||
return CommandInitPlugin(({ module, absPath }) => {
|
||||
if(path.dirname(absPath) !== dir) {
|
||||
console.log(+new Date(), `${module.name} is not in the correct directory!`);
|
||||
return controller.stop()
|
||||
}
|
||||
console.log(+new Date(), `${module.name} is in the correct directory!`);
|
||||
return controller.next(); //continue
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(+new Date(), `${module.name} is in the correct directory!`);
|
||||
return controller.next(); //continue
|
||||
});
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Above, this simple plugin logs that the module has been loaded along with a timestamp. <br />
|
||||
Again, it is up to **you** to define plugin logic! The possibilities to customize your bots are endless.
|
||||
:::tip
|
||||
Command Plugins are good for ensuring the shape, location, and preprocessing of your commands.
|
||||
:::
|
||||
|
||||
## Event Plugins
|
||||
 <br />
|
||||
 <br />
|
||||
- An event is emitted by discord.js.
|
||||
- This event is passed to all plugins (**in order!!**),
|
||||
- If all are successful,
|
||||
|
||||
The command is executed. Calling `controller.stop()` notifies sern that this command should not be run,
|
||||
and this event is ignored.
|
||||
and command is ignored.
|
||||
|
||||
<p>So, what does a command module look like with plugins?</p>
|
||||
|
||||
Typescript:
|
||||
```typescript
|
||||
import { commandModule, CommandType } from '@sern/handler';
|
||||
|
||||
export default commandModule({
|
||||
type: CommandType.Both,
|
||||
plugins: [
|
||||
inDir("other"),
|
||||
serenOnly()
|
||||
],
|
||||
description: 'A ping command',
|
||||
//alias : [],
|
||||
execute: async (ctx, args) => {
|
||||
await ctx.reply({ content: 'Pong 🏓' });
|
||||
},
|
||||
});
|
||||
```
|
||||
Javascript:
|
||||
```typescript
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
|
||||
exports.default = commandModule({
|
||||
type: CommandType.Both,
|
||||
plugins: [
|
||||
inDir("other"),
|
||||
serenOnly() //The plugins in this section applied to this module!
|
||||
],
|
||||
description: 'A ping command',
|
||||
//alias : [],
|
||||
execute: async (ctx, args) => {
|
||||
await ctx.reply({ content: 'Pong 🏓' });
|
||||
},
|
||||
});
|
||||
```
|
||||
Can you predict the behavior of this command?
|
||||
|
||||
- Before loading into sern, this command module will check if this module is in the correct directory `other`.
|
||||
@@ -154,4 +88,4 @@ Can you predict the behavior of this command?
|
||||
Event Plugins are good for filtering, preconditions, parsing.
|
||||
:::
|
||||
|
||||
If all plugins return `controller.next()`, this command replies `Pong 🏓`
|
||||
If all plugins return `controller.next()`, this command replies `Pong 🏓`
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
sidebar_position: 6
|
||||
sidebar_position: 8
|
||||
---
|
||||
|
||||
# The SernEmitter class
|
||||
@@ -11,4 +11,4 @@ You're shipped with the SernEmitter. This EventEmitter listens to
|
||||
- `warn` events, where it is possible to throw errors
|
||||
|
||||
You can put these and other event listeners into [event modules](./first-event.md)!
|
||||
<br/>View all <a href="https://sern.dev/docs/api/modules#serneventsmapping">events</a>
|
||||
<br/>View all <a href="https://sern.dev/docs/api/modules#serneventsmapping">events</a>
|
||||
|
||||
158
docs/guide/walkthrough/services.md
Normal file
158
docs/guide/walkthrough/services.md
Normal file
@@ -0,0 +1,158 @@
|
||||
---
|
||||
sidebar_position: 6
|
||||
---
|
||||
|
||||
# Services
|
||||
|
||||
:::tip
|
||||
This is version 3 api only!!
|
||||
:::
|
||||
|
||||
|
||||
:::tip
|
||||
TLDR: The direct upgrade to useContainer. if you set up a bot with create-bot, check dependencies.d.ts.
|
||||
Dependencies are the types that Services uses.
|
||||
:::
|
||||
|
||||
You need someway to use dependencies in your command module. Services to the rescue!
|
||||
```ts title="src/dependencies.d.ts"
|
||||
import { CoreDependencies, Singleton } from '@sern/handler'
|
||||
import { Client } from 'discord.js'
|
||||
|
||||
interface Dependencies extends CoreDependencies {
|
||||
'@sern/client': Singleton<Client>
|
||||
}
|
||||
|
||||
```
|
||||
Recall, some keys in Dependencies are special.
|
||||
|
||||
> Special key dependency must implement its contracts.
|
||||
> - `@sern/client`: Your discord client. -> [Emitter](../../api/interfaces/Emitter)
|
||||
> - `@sern/logger`: Log data -> [Logging](../../api/interfaces/Logging)
|
||||
> - `@sern/errors`: Handling errors and lifetime -> [ErrorHandling](../../api/interfaces/ErrorHandling)
|
||||
> - `@sern/modules`: Managing all command modules -> [ModuleManager](../../api/interfaces/ModuleManager)
|
||||
> - `@sern/emitter`: is the key to emit events and occurences in a project -> [Emitter](../../api/interfaces/Emitter)
|
||||
|
||||
|
||||
Lets try to access the client you provided.
|
||||
|
||||
```ts title="src/commands/ping.ts"
|
||||
import { Service } from '@sern/handler'
|
||||
|
||||
export default commandModule({
|
||||
// ...
|
||||
execute: (ctx) => {
|
||||
//Client!
|
||||
const client = Service('@sern/client');
|
||||
}
|
||||
//
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
|
||||
## Safety
|
||||
- Services cannot be called in other services while makeDependencies is forming.
|
||||
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="good" label="A good example">
|
||||
|
||||
Lets pass a logger into our database.
|
||||
```ts title="index.ts" showLineNumbers
|
||||
await makeDependencies({
|
||||
build: root => root
|
||||
//Overriding the default logger provided.
|
||||
.upsert({ '@sern/logger': single(() => new Logger()) })
|
||||
|
||||
// Wiring our logger into the database.
|
||||
.add(ctx => {
|
||||
return { database: single(() => new Database(ctx['sern/logger']))) }
|
||||
})
|
||||
})
|
||||
```
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="bad" label="Don't do this">
|
||||
|
||||
```ts title="index.ts" showLineNumbers
|
||||
await makeDependencies({
|
||||
build: root => root
|
||||
//Overriding the default logger provided.
|
||||
.upsert({ '@sern/logger': single(() => new Logger()) })
|
||||
|
||||
// Wiring our logger into the database.
|
||||
// We wire our database incorrectly. Logger should be passed INTO the constructor
|
||||
.add({ database: single(() => new Database()) })
|
||||
})
|
||||
```
|
||||
|
||||
```ts title="index.ts" showLineNumbers
|
||||
import { Service, makeDependencies } from '@sern/handler';
|
||||
|
||||
//Calling Service prematurely!
|
||||
const logger = Service('@sern/logger');
|
||||
|
||||
class Database {
|
||||
|
||||
constructor() {
|
||||
this.logger = logger
|
||||
}
|
||||
}
|
||||
```
|
||||
This is a code smell anyway. It breaks encapsulation and defeats the purpose of wiring dependencies
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
- Services can only be used after sern has made dependencies.
|
||||
- Calling a service before will crash your application.
|
||||
- Services can be safely used outside of commandModules.
|
||||
- Be careful to not cause too many side effects.
|
||||
|
||||
|
||||
|
||||
- You will need to wire dependencies together.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="good" label="A good example">
|
||||
|
||||
```ts title="index.ts" showLineNumbers
|
||||
await makeDependencies(...pass your options here)
|
||||
```
|
||||
```ts title="commands/ping.ts" showLineNumbers
|
||||
// This is guaranteed to be defined if configured correctly
|
||||
import { Service } from '@sern/handler';
|
||||
const client = Service('@sern/client');
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="bad" label="Don't do this">
|
||||
|
||||
```ts title="index.ts" showLineNumbers
|
||||
import { Service, makeDependencies } from '@sern/handler';
|
||||
/* DON'T USE SERVICES BEFORE CALLING makeDependencies */
|
||||
const logger = Service('@sern/logger');
|
||||
|
||||
await makeDependencies()
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
- Services can only be used after sern has made dependencies.
|
||||
- Calling a service before will crash your application.
|
||||
- Services can be safely used outside of commandModules.
|
||||
- Be careful to not cause too many side effects.
|
||||
|
||||
|
||||
## Related api
|
||||
- use `Service` for single dependency.
|
||||
- use `Services` for multiple dependencies.
|
||||
|
||||
|
||||
|
||||
40
docs/guide/walkthrough/transition.md
Normal file
40
docs/guide/walkthrough/transition.md
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
sidebar_position: 3
|
||||
---
|
||||
|
||||
|
||||
# transition from v2 to v3
|
||||
|
||||
```diff title="src/index.ts"
|
||||
- Sern.makeDependencies({ build: () => {} })
|
||||
+ await makeDependencies({ build: () => {} })
|
||||
```
|
||||
|
||||
v3 comes with the new [Service api](../walkthrough/services). To make sure to enable intellisense
|
||||
include a dependencies.d.ts file into compilation. [Click here for all new features](../../../blog/3.0.0)
|
||||
```ts
|
||||
/**
|
||||
* This file serves as intellisense for sern projects.
|
||||
* Types are declared here for dependencies to function properly
|
||||
* Service(s) api rely on this file to provide a better developer experience.
|
||||
*/
|
||||
|
||||
import { SernEmitter, Logging, CoreModuleStore, ModuleManager, ErrorHandling, CoreDependencies, Singleton } from '@sern/handler'
|
||||
import { Client } from 'discord.js'
|
||||
|
||||
declare global {
|
||||
interface Dependencies extends CoreDependencies {
|
||||
'@sern/client': Singleton<Client>
|
||||
}
|
||||
}
|
||||
|
||||
export {}
|
||||
|
||||
```
|
||||
|
||||
A standard project file tree: <br />
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,12 @@ sidebar_position: 0
|
||||
|
||||
# Welcome!
|
||||
|
||||
:::warning
|
||||
Please read the [transition](./transition) page if you are moving from version 2 to version 3.
|
||||
:::
|
||||
|
||||
## Content
|
||||
- [transition](../docs/guide/walkthrough/transition.md) for current users to transition bots to version 3.
|
||||
- [/docs/api](../docs/api) contains autogenerated documentation of our codebase using [typedoc](https://typedoc.org/)
|
||||
- [/docs/guide](../docs/guide) contains a basic startup guide and details to get started with sern faster!
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// @ts-check
|
||||
// Note: type annotations allow type checking and IDEs autocompletion
|
||||
|
||||
// WARNING: When changing things in this file, please also change them on the other docgen.docusaurus.config.js file!
|
||||
|
||||
const lightCodeTheme = require('prism-react-renderer/themes/nightOwlLight');
|
||||
const darkCodeTheme = require('prism-react-renderer/themes/oceanicNext');
|
||||
|
||||
@@ -8,9 +10,9 @@ const darkCodeTheme = require('prism-react-renderer/themes/oceanicNext');
|
||||
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-handler.js.org',
|
||||
baseUrl: '/',
|
||||
onBrokenLinks: 'throw',
|
||||
url: 'https://sern.dev',
|
||||
baseUrl: '/',
|
||||
onBrokenLinks: 'ignore',
|
||||
onBrokenMarkdownLinks: 'warn',
|
||||
favicon: '/img/favicon.ico', // this currently not working
|
||||
|
||||
@@ -26,9 +28,8 @@ const config = {
|
||||
// to replace "en" with "zh-Hans".
|
||||
i18n: {
|
||||
defaultLocale: 'en',
|
||||
locales: ['en', 'fr', 'tr'],
|
||||
locales: ['en']
|
||||
},
|
||||
|
||||
presets: [
|
||||
[
|
||||
'classic',
|
||||
@@ -36,8 +37,6 @@ const config = {
|
||||
({
|
||||
docs: {
|
||||
sidebarPath: require.resolve('./sidebars.js'),
|
||||
// Please change this to your repo.
|
||||
// Remove this to remove the "edit this page" links.
|
||||
editUrl:
|
||||
'https://github.com/sern-handler/website/edit/main/',
|
||||
},
|
||||
@@ -69,6 +68,23 @@ const config = {
|
||||
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: {
|
||||
@@ -142,33 +158,47 @@ const config = {
|
||||
},
|
||||
metadata : [
|
||||
{ name: 'og:title', content: 'sern - Handlers. Redefined.' },
|
||||
{ name: 'og:description', content: 'A customizable, batteries-included, powerful discord.js framework to automate and streamline bot development' },
|
||||
{ name: 'og:image', content: 'https://i.imgur.com/rr8nqDP.png' },
|
||||
{ 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:card', content: 'summary_large_image' },
|
||||
{ name: 'twitter:site', content: '@sern-handler' },
|
||||
{ property: 'og:image:alt', content: 'sernlogo' },
|
||||
{ name: 'twitter:title', content: 'sern - Handlers. Redefined.' },
|
||||
{ name: 'twitter:description', content: 'A customizable, batteries-included, powerful discord.js framework to automate and streamline bot development' },
|
||||
{ name: 'twitter:image', content: './assets/images/logo.png' },
|
||||
{ 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' },
|
||||
{ name: 'theme-color', content: '#cb547c' }
|
||||
{ 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-esm.json',
|
||||
// },
|
||||
// ]
|
||||
// ]
|
||||
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;
|
||||
|
||||
22659
package-lock.json
generated
22659
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@@ -14,13 +14,14 @@
|
||||
"serve": "docusaurus serve",
|
||||
"write-translations": "docusaurus write-translations",
|
||||
"write-heading-ids": "docusaurus write-heading-ids",
|
||||
"typedoc-json": "typedoc --json ../sern-community/docs.json --pretty --entryPoints ../sernHandlerV2/src/index.ts --tsconfig ../sernHandlerV2/tsconfig-esm.json --excludeExternals"
|
||||
"typedoc-json": "typedoc --json ../sern-community/docs.json --pretty --entryPoints ../sernHandlerV2/src/index.ts --tsconfig ../sernHandlerV2/tsconfig.json --excludeExternals"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "2.0.0-rc.1",
|
||||
"@docusaurus/plugin-content-pages": "^2.0.1",
|
||||
"@docusaurus/preset-classic": "2.0.0-rc.1",
|
||||
"@docusaurus/theme-search-algolia": "^2.0.0-rc.1",
|
||||
"@dipakparmar/docusaurus-plugin-umami": "^2.1.1",
|
||||
"@docusaurus/core": "^2.4.0",
|
||||
"@docusaurus/plugin-content-pages": "^2.4.0",
|
||||
"@docusaurus/preset-classic": "^2.4.0",
|
||||
"@docusaurus/theme-search-algolia": "^2.4.0",
|
||||
"@mdx-js/react": "^1.6.22",
|
||||
"clsx": "^1.2.1",
|
||||
"jsdoc-parse-plus": "^1.3.0",
|
||||
@@ -30,9 +31,10 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "2.0.0-rc.1",
|
||||
"docusaurus-plugin-typedoc": "^0.17.5",
|
||||
"typedoc": "^0.23.8",
|
||||
"typedoc-plugin-markdown": "^3.13.4"
|
||||
"docusaurus-plugin-typedoc": "latest",
|
||||
"typedoc": "latest",
|
||||
"typedoc-plugin-markdown": "latest",
|
||||
"typescript": "latest"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
|
||||
@@ -4,36 +4,36 @@ import styles from './styles.module.css';
|
||||
|
||||
const FeatureList = [
|
||||
{
|
||||
title: 'Batteries included',
|
||||
Svg: require('@site/static/img/battery-svgrepo-com.svg').default,
|
||||
title: 'Modular',
|
||||
|
||||
Svg: require('@site/static/img/bricks-svgrepo-com.svg').default,
|
||||
description: (
|
||||
<>
|
||||
Start or integrate a new project in minutes.
|
||||
Take apart, build, or customize code with ease to create robust bots.
|
||||
</>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: 'Customizable',
|
||||
Svg: require('@site/static/img/puzzle-svgrepo-com.svg').default,
|
||||
title: 'Concise',
|
||||
Svg: require('@site/static/img/pencil-svgrepo-com.svg').default,
|
||||
description: (
|
||||
<>
|
||||
Extend or customize with community-based plugins to provide utilities, filters, and more.
|
||||
Commands are significantly smaller than other competitors.
|
||||
Write impactful, concise code.
|
||||
</>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: 'Modern',
|
||||
Svg: require('@site/static/img/typescript-svgrepo-com.svg').default,
|
||||
title: 'Familiar',
|
||||
Svg: require('@site/static/img/fire-com.svg').default,
|
||||
description: (
|
||||
<>
|
||||
Uses modern and powerful tooling such as
|
||||
<a href={'https://swc.rs/'}> swc</a>,
|
||||
<a href={'https://tsup.egoist.dev/'}> tsup</a>,
|
||||
<a href={'https://www.typescriptlang.org/'}> typescript</a>, and
|
||||
<a href={'https://rxjs.dev/'}> rxjs</a> to future-proof and ensure project quality.
|
||||
Code like a traditional command handler. Although not exactly the same, the api is easy to learn
|
||||
and resembles classic v12 command handlers.
|
||||
</>
|
||||
),
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
function Feature({Svg, title, description}) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user