3 Commits

Author SHA1 Message Date
Jacob Nguyen
b453377bad chore: try again 2023-03-17 15:56:39 -05:00
Jacob Nguyen
ac5b875716 chore:fix netlify 2023-03-17 15:52:37 -05:00
Jacob Nguyen
1a404dd2bf chore: update website with action to automate docs 2023-03-17 15:34:33 -05:00
136 changed files with 7587 additions and 30295 deletions

39
.github/workflows/build-docs.yml vendored Normal file
View File

@@ -0,0 +1,39 @@
name: build-docs
on:
workflow_dispatch:
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
jobs:
deploy:
name: Checkout and Build Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: 'sern-handler/handler',
path: 'handler/'
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- uses: actions/checkout@v3
- name: Install dependencies
run: npm ci
- name: clean docs directory
run: |
rm -rf docs
- name: Build website
run: npm run build
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v5-beta
with:
commit-message: "chore: update docs"
branch: docs
delete-branch: true
branch-suffix: short-commit-hash
title: "docs: Update docs"
body: "asfl;asdkcng;lfkv;lajf;bflglfsafs;af"
reviewers: jacoobes

View File

@@ -15,12 +15,12 @@ jobs:
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 18
cache: yarn cache: npm
- name: Install dependencies - name: Install dependencies
run: yarn install --immutable run: npm ci
- name: Build website - name: Build website
run: yarn build run: npm run build
# Popular action to deploy to GitHub Pages: # Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus

View File

@@ -1,22 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myValues">
<value>
<list size="7">
<item index="0" class="java.lang.String" itemvalue="nobr" />
<item index="1" class="java.lang.String" itemvalue="noembed" />
<item index="2" class="java.lang.String" itemvalue="comment" />
<item index="3" class="java.lang.String" itemvalue="noscript" />
<item index="4" class="java.lang.String" itemvalue="embed" />
<item index="5" class="java.lang.String" itemvalue="script" />
<item index="6" class="java.lang.String" itemvalue="herotitle_font" />
</list>
</value>
</option>
<option name="myCustomValuesEnabled" value="true" />
</inspection_tool>
<inspection_tool class="HtmlUnknownTarget" enabled="false" level="WARNING" enabled_by_default="false" />
</profile>
</component>

188
.idea/workspace.xml generated
View File

@@ -4,7 +4,57 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="53dd69d3-e01a-4656-b414-c727f5aa549a" name="Changes" comment="two dirs back" /> <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$/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="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@@ -13,14 +63,6 @@
<component name="ComposerSettings"> <component name="ComposerSettings">
<execution /> <execution />
</component> </component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="CSS File" />
<option value="JavaScript File" />
</list>
</option>
</component>
<component name="Git.Merge.Settings"> <component name="Git.Merge.Settings">
<option name="BRANCH" value="master" /> <option name="BRANCH" value="master" />
</component> </component>
@@ -35,16 +77,10 @@
</option> </option>
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component> </component>
<component name="GitHubPullRequestSearchHistory">{
&quot;lastFilter&quot;: {
&quot;state&quot;: &quot;OPEN&quot;,
&quot;assignee&quot;: &quot;SrIzan10&quot;
}
}</component>
<component name="GithubPullRequestsUISettings"> <component name="GithubPullRequestsUISettings">
<option name="selectedUrlAndAccountId"> <option name="selectedUrlAndAccountId">
<UrlAndAccount> <UrlAndAccount>
<option name="accountId" value="338eb51f-f02f-4dc6-997b-a87ba611c308" /> <option name="accountId" value="1fedf39a-45aa-449b-9d1d-6f25985f42b4" />
<option name="url" value="https://github.com/sern-handler/website.git" /> <option name="url" value="https://github.com/sern-handler/website.git" />
</UrlAndAccount> </UrlAndAccount>
</option> </option>
@@ -55,9 +91,6 @@
<component name="MarkdownSettingsMigration"> <component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" /> <option name="stateVersion" value="1" />
</component> </component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 7
}</component>
<component name="ProjectId" id="2DJXFY4dwukGLOzXi05b6lHCkuk" /> <component name="ProjectId" id="2DJXFY4dwukGLOzXi05b6lHCkuk" />
<component name="ProjectViewState"> <component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
@@ -69,37 +102,17 @@
&quot;Git.Branch.Popup.ShowAllRemotes&quot;: &quot;true&quot;, &quot;Git.Branch.Popup.ShowAllRemotes&quot;: &quot;true&quot;,
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;, &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;, &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;,
&quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;, &quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
&quot;git-widget-placeholder&quot;: &quot;feat/tutorial&quot;, &quot;last_opened_file_path&quot;: &quot;C:/Users/jacob/OneDrive/Desktop/Projects/sern/website&quot;,
&quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
&quot;last_opened_file_path&quot;: &quot;C:/Users/USER/Desktop/Development/mainwebsite&quot;,
&quot;list.type.of.created.stylesheet&quot;: &quot;CSS&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;, &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;project.structure.last.edited&quot;: &quot;Modules&quot;, &quot;project.structure.last.edited&quot;: &quot;Modules&quot;,
&quot;project.structure.proportion&quot;: &quot;0.0&quot;, &quot;project.structure.proportion&quot;: &quot;0.0&quot;,
&quot;project.structure.side.proportion&quot;: &quot;0.0&quot;, &quot;project.structure.side.proportion&quot;: &quot;0.0&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;preferences.pluginManager&quot;, &quot;ts.external.directory.path&quot;: &quot;E:\\IntelliJ IDEA 2022.1.1\\plugins\\JavaScriptLanguage\\jsLanguageServicesImpl\\external&quot;
&quot;ts.external.directory.path&quot;: &quot;E:\\IntelliJ IDEA 2022.1.1\\plugins\\JavaScriptLanguage\\jsLanguageServicesImpl\\external&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
} }
}</component> }</component>
<component name="ReactDesignerToolWindowState">
<option name="myId2Visible">
<map>
<entry key="com.haulmont.rcb.reactComponents" value="false" />
<entry key="com.haulmont.rcb.reactInspector" value="false" />
<entry key="com.haulmont.rcb.storybook" value="false" />
</map>
</option>
</component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS"> <key name="MoveFile.RECENT_KEYS">
<recent name="C:\Users\USER\Desktop\Development\sern-website\docs\tutorial\en\intro" />
<recent name="C:\Users\USER\Desktop\Development\sern-website\docs\tutorial\en" />
<recent name="C:\Users\jacob\IdeaProjects\website\static\img" /> <recent name="C:\Users\jacob\IdeaProjects\website\static\img" />
</key> </key>
</component> </component>
@@ -169,15 +182,6 @@
<workItem from="1671119393024" duration="3889000" /> <workItem from="1671119393024" duration="3889000" />
<workItem from="1673974979200" duration="2385000" /> <workItem from="1673974979200" duration="2385000" />
<workItem from="1674757791435" duration="925000" /> <workItem from="1674757791435" duration="925000" />
<workItem from="1693943174979" duration="3494000" />
<workItem from="1693998900601" duration="4854000" />
<workItem from="1694013887941" duration="680000" />
<workItem from="1694014634755" duration="3452000" />
<workItem from="1694086921138" duration="3532000" />
<workItem from="1694095607446" duration="2640000" />
<workItem from="1694170854677" duration="225000" />
<workItem from="1694463335421" duration="56000" />
<workItem from="1694533500197" duration="2188000" />
</task> </task>
<task id="LOCAL-00001" summary="feat: remove old index.html in static/"> <task id="LOCAL-00001" summary="feat: remove old index.html in static/">
<created>1660418841831</created> <created>1660418841831</created>
@@ -368,71 +372,7 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1673976828238</updated> <updated>1673976828238</updated>
</task> </task>
<task id="LOCAL-00028" summary="fix: some grammar errors and dir structure"> <option name="localTasksCounter" value="28" />
<option name="closed" value="true" />
<created>1693943258104</created>
<option name="number" value="00028" />
<option name="presentableId" value="LOCAL-00028" />
<option name="project" value="LOCAL" />
<updated>1693943258104</updated>
</task>
<task id="LOCAL-00029" summary="chore: move file structure">
<option name="closed" value="true" />
<created>1693943441448</created>
<option name="number" value="00029" />
<option name="presentableId" value="LOCAL-00029" />
<option name="project" value="LOCAL" />
<updated>1693943441448</updated>
</task>
<task id="LOCAL-00030" summary="rephrasing a bit and ropox introduction invasion">
<option name="closed" value="true" />
<created>1693944545011</created>
<option name="number" value="00030" />
<option name="presentableId" value="LOCAL-00030" />
<option name="project" value="LOCAL" />
<updated>1693944545011</updated>
</task>
<task id="LOCAL-00031" summary="add introduction for me (im egoist)">
<option name="closed" value="true" />
<created>1693999127245</created>
<option name="number" value="00031" />
<option name="presentableId" value="LOCAL-00031" />
<option name="project" value="LOCAL" />
<updated>1693999127245</updated>
</task>
<task id="LOCAL-00032" summary="move to mdx">
<option name="closed" value="true" />
<created>1693999615376</created>
<option name="number" value="00032" />
<option name="presentableId" value="LOCAL-00032" />
<option name="project" value="LOCAL" />
<updated>1693999615376</updated>
</task>
<task id="LOCAL-00033" summary="add title">
<option name="closed" value="true" />
<created>1693999895960</created>
<option name="number" value="00033" />
<option name="presentableId" value="LOCAL-00033" />
<option name="project" value="LOCAL" />
<updated>1693999895960</updated>
</task>
<task id="LOCAL-00034" summary="feedback system">
<option name="closed" value="true" />
<created>1694534513180</created>
<option name="number" value="00034" />
<option name="presentableId" value="LOCAL-00034" />
<option name="project" value="LOCAL" />
<updated>1694534513180</updated>
</task>
<task id="LOCAL-00035" summary="two dirs back">
<option name="closed" value="true" />
<created>1694535688773</created>
<option name="number" value="00035" />
<option name="presentableId" value="LOCAL-00035" />
<option name="project" value="LOCAL" />
<updated>1694535688773</updated>
</task>
<option name="localTasksCounter" value="36" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@@ -450,6 +390,14 @@
</option> </option>
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value="feat: remove old index.html in static/" />
<MESSAGE value="feat: edit action" />
<MESSAGE value="feat: delete needless assets/dir" />
<MESSAGE value="feat: action changes and edit link" />
<MESSAGE value="feat: add favicon" />
<MESSAGE value="fix: broken link" />
<MESSAGE value="chore: edit link so no new windows" />
<MESSAGE value="chore: fix typo" />
<MESSAGE value="feat: adding width attr" /> <MESSAGE value="feat: adding width attr" />
<MESSAGE value="feat: adding blogs" /> <MESSAGE value="feat: adding blogs" />
<MESSAGE value="feat: blogwork" /> <MESSAGE value="feat: blogwork" />
@@ -467,14 +415,6 @@
<MESSAGE value="feat: update documentation and clarify documentation" /> <MESSAGE value="feat: update documentation and clarify documentation" />
<MESSAGE value="fix: links" /> <MESSAGE value="fix: links" />
<MESSAGE value="docs: add new plugins docs" /> <MESSAGE value="docs: add new plugins docs" />
<MESSAGE value="fix: some grammar errors and dir structure" /> <option name="LAST_COMMIT_MESSAGE" value="docs: add new plugins docs" />
<MESSAGE value="chore: move file structure" />
<MESSAGE value="rephrasing a bit and ropox introduction invasion" />
<MESSAGE value="add introduction for me (im egoist)" />
<MESSAGE value="move to mdx" />
<MESSAGE value="add title" />
<MESSAGE value="feedback system" />
<MESSAGE value="two dirs back" />
<option name="LAST_COMMIT_MESSAGE" value="two dirs back" />
</component> </component>
</project> </project>

1
.nvmrc
View File

@@ -1 +0,0 @@
lts/*

View File

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

View File

@@ -2,7 +2,7 @@
<html style="height:100%"> <html style="height:100%">
<head> <head>
<meta name="viewport" charset="utf-8" content="width=device-width, initial-scale=1, shrink-to-fit=no" > <meta name="viewport" charset="utf-8" content="width=device-width, initial-scale=1, shrink-to-fit=no" >
<link rel="icon" href="./assets/images/favicon.ico"> <link rel="icon" href="./assets/images/icon.png">
<meta name="theme-color" content="#fff"> <meta name="theme-color" content="#fff">
<meta name="twitter:card" content="summary"> <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> <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 style="margin-top:20px;font-size: 30px;">Not Found
</h2> </h2>
<p>The link you visited may be broken or invalid.</p> <p>The link you visited is may be broken or invalid.</p>
<div class="button"> <div class="button">
<h2> <h2>
<a href="http://sern-handler.js.org" title="Back to home" style="color: #444;">Back to homepage</a> <a href="http://sern-handler.js.org" title="Back to home" style="color: #444;">Back to homepage</a>

View File

@@ -39,7 +39,7 @@ If you're using ESM, configure dotenv with `import 'dotenv/config'` instead of `
### And... that's it? ### 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.dev/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-handler.js.org/discord) for any problems.
### Extra: Video tutorial! ### 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!) **A**: Yeah, just search `sern Snippets` made by a verified publisher called Sr Izan (haha yeah me funny!)
**Q**: HEEEELLLPPPP!!!! **Q**: HEEEELLLPPPP!!!!
**A**: Hey, don't panic! We're here to help so, join the [Discord](https://sern.dev/discord). We're trying to get to 100 members! **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!

View File

@@ -132,7 +132,7 @@ Post 2.0:
CommandPlugin<T\> and EventPlugin<T\> typings have also been static'ified, transformed from types to interfaces CommandPlugin<T\> and EventPlugin<T\> typings have also been static'ified, transformed from types to interfaces
## Breaking Changes ## Breaking Changes
<img src="https://img.srizan.dev/Discord_z8Sn1UBfEe.png" /> <img src="https://img.srizan.ml/Discord_z8Sn1UBfEe.png" />
<br /> <br />
All deprecation warnings from previous versions have taken effect, and are removed in 2.0. All deprecation warnings from previous versions have taken effect, and are removed in 2.0.

View File

@@ -1,102 +0,0 @@
---
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

View File

@@ -1,34 +0,0 @@
---
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-thing}
[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:
![](/blog/newlogo/paperprototypes.jpg)
And there it all clicked:
![](/blog/newlogo/paperlogo.png)
seren tried by the way!
![](/blog/newlogo/serentried.png)
# Anyways, here it is:
![](/img/logo.png)
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 ❤️

View File

@@ -5,13 +5,9 @@ jacoobes:
image_url: https://github.com/jacoobes.png image_url: https://github.com/jacoobes.png
Sr Izan: Sr Izan:
name: Sr Izan name: Sr Izan
title: Developer title: Contributor
url: https://github.com/SrIzan10 url: https://github.com/SrIzan10
image_url: https://github.com/SrIzan10.png 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: Murtatrxx:
name: Murtatrxx name: Murtatrxx
title: Developer title: Developer

View File

@@ -1,202 +0,0 @@
// @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;

View File

@@ -6,41 +6,57 @@ sidebar_position: 0
custom_edit_url: null custom_edit_url: null
--- ---
**`Deprecated`** **`Experimental`**
Will be removed in future Will be refactored / changed in future
## Type parameters ## Type parameters
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `Type` | extends [`CommandType`](../enums/CommandType.md) = [`CommandType`](../enums/CommandType.md) | | `Type` | extends [`CommandType`](../enums/CommandType.md) |
## Constructors ## Constructors
### constructor ### constructor
**new CommandExecutable**<`Type`\>(): [`CommandExecutable`](CommandExecutable.md)<`Type`\> **new CommandExecutable**<`Type`\>()
#### Type parameters #### Type parameters
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `Type` | extends [`CommandType`](../enums/CommandType.md) = [`CommandType`](../enums/CommandType.md) | | `Type` | extends [`CommandType`](../enums/CommandType.md) |
#### Returns
[`CommandExecutable`](CommandExecutable.md)<`Type`\>
## Properties ## Properties
### plugins ### execute
**plugins**: [`AnyCommandPlugin`](../modules.md#anycommandplugin)[] = `[]` `Abstract` **execute**: [`CommandModuleDefs`](../modules.md#commandmoduledefs)[`Type`][``"execute"``]
#### Defined in #### Defined in
[src/core/modules.ts:80](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L80) [src/handler/sern.ts:121](https://github.com/sern-handler/handler/blob/33f1446/src/handler/sern.ts#L121)
___
### onEvent
• **onEvent**: [`ControlPlugin`](../interfaces/ControlPlugin.md)<`any`[]\>[] = `[]`
#### Defined in
[src/handler/sern.ts:120](https://github.com/sern-handler/handler/blob/33f1446/src/handler/sern.ts#L120)
___
### plugins
• **plugins**: [`InitPlugin`](../interfaces/InitPlugin.md)<`any`[]\>[] = `[]`
#### Defined in
[src/handler/sern.ts:119](https://github.com/sern-handler/handler/blob/33f1446/src/handler/sern.ts#L119)
___ ___
@@ -50,48 +66,4 @@ ___
#### Defined in #### Defined in
[src/core/modules.ts:79](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L79) [src/handler/sern.ts:118](https://github.com/sern-handler/handler/blob/33f1446/src/handler/sern.ts#L118)
___
### \_instance
`Static` `Private` **\_instance**: [`CommandModule`](../modules.md#commandmodule)
#### Defined in
[src/core/modules.ts:81](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L81)
## Methods
### execute
**execute**(`...args`): `unknown`
#### Parameters
| Name | Type |
| :------ | :------ |
| `...args` | `CommandArgs`<`Type`, [`Control`](../enums/PluginType.md#control)\> |
#### Returns
`unknown`
#### Defined in
[src/core/modules.ts:92](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L92)
___
### getInstance
**getInstance**(): [`CommandModule`](../modules.md#commandmodule)
#### Returns
[`CommandModule`](../modules.md#commandmodule)
#### Defined in
[src/core/modules.ts:83](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L83)

View File

@@ -6,23 +6,14 @@ sidebar_position: 0
custom_edit_url: null custom_edit_url: null
--- ---
**`Since`**
1.0.0
Provides values shared between Provides values shared between
Message and ChatInputCommandInteraction Message and ChatInputCommandInteraction
## Hierarchy
- `CoreContext`<`Message`, `ChatInputCommandInteraction`\>
**`Context`**
## Constructors ## Constructors
### constructor ### constructor
**new Context**(`ctx`): [`Context`](Context.md) `Private` **new Context**(`ctx`)
#### Parameters #### Parameters
@@ -30,31 +21,9 @@ Message and ChatInputCommandInteraction
| :------ | :------ | | :------ | :------ |
| `ctx` | `Result`<`Message`<`boolean`\>, `ChatInputCommandInteraction`<`CacheType`\>\> | | `ctx` | `Result`<`Message`<`boolean`\>, `ChatInputCommandInteraction`<`CacheType`\>\> |
#### Returns
[`Context`](Context.md)
#### Overrides
CoreContext\&lt;Message, ChatInputCommandInteraction\&gt;.constructor
#### Defined in #### Defined in
[src/core/structures/context.ts:29](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L29) [src/handler/structures/context.ts:22](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/context.ts#L22)
## 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 ## Accessors
@@ -68,21 +37,7 @@ CoreContext.ctx
#### Defined in #### Defined in
[src/core/structures/context.ts:39](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L39) [src/handler/structures/context.ts:45](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/context.ts#L45)
___
### 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)
___ ___
@@ -96,7 +51,7 @@ ___
#### Defined in #### Defined in
[src/core/structures/context.ts:91](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L91) [src/handler/structures/context.ts:75](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/context.ts#L75)
___ ___
@@ -110,7 +65,7 @@ ___
#### Defined in #### Defined in
[src/core/structures/context.ts:65](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L65) [src/handler/structures/context.ts:56](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/context.ts#L56)
___ ___
@@ -124,7 +79,7 @@ ___
#### Defined in #### Defined in
[src/core/structures/context.ts:71](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L71) [src/handler/structures/context.ts:60](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/context.ts#L60)
___ ___
@@ -138,7 +93,7 @@ ___
#### Defined in #### Defined in
[src/core/structures/context.ts:77](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L77) [src/handler/structures/context.ts:64](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/context.ts#L64)
___ ___
@@ -152,7 +107,7 @@ ___
#### Defined in #### Defined in
[src/core/structures/context.ts:33](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L33) [src/handler/structures/context.ts:41](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/context.ts#L41)
___ ___
@@ -166,25 +121,25 @@ ___
#### Defined in #### Defined in
[src/core/structures/context.ts:97](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L97) [src/handler/structures/context.ts:79](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/context.ts#L79)
___ ___
### interaction ### interaction
• `get` **interaction**(): `I` • `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
#### Returns #### Returns
`I` `ChatInputCommandInteraction`<`CacheType`\>
#### Inherited from
CoreContext.interaction
#### Defined in #### Defined in
[src/core/structures/core-context.ts:15](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/core-context.ts#L15) [src/handler/structures/context.ts:37](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/context.ts#L37)
___ ___
@@ -198,43 +153,25 @@ ___
#### Defined in #### Defined in
[src/core/structures/context.ts:85](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L85) [src/handler/structures/context.ts:71](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/context.ts#L71)
___ ___
### message ### message
• `get` **message**(): `M` • `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
#### Returns #### Returns
`M` `Message`<`boolean`\>
#### Inherited from
CoreContext.message
#### Defined in #### Defined in
[src/core/structures/core-context.ts:12](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/core-context.ts#L12) [src/handler/structures/context.ts:29](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/context.ts#L29)
___
### 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)
___ ___
@@ -251,57 +188,35 @@ else, interaction.user
#### Defined in #### Defined in
[src/core/structures/context.ts:55](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L55) [src/handler/structures/context.ts:52](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/context.ts#L52)
___
### 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 ## Methods
### isMessage ### isMessage
▸ **isMessage**(): this is CoreContext<Message<boolean\>, never\> ▸ **isMessage**(): `boolean`
#### Returns #### Returns
this is CoreContext<Message<boolean\>, never\> `boolean`
#### Inherited from
CoreContext.isMessage
#### Defined in #### Defined in
[src/core/structures/core-context.ts:19](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/core-context.ts#L19) [src/handler/structures/context.ts:82](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/context.ts#L82)
___ ___
### isSlash ### isSlash
▸ **isSlash**(): this is CoreContext<never, ChatInputCommandInteraction<CacheType\>\> ▸ **isSlash**(): `boolean`
#### Returns #### Returns
this is CoreContext<never, ChatInputCommandInteraction<CacheType\>\> `boolean`
#### Inherited from
CoreContext.isSlash
#### Defined in #### Defined in
[src/core/structures/core-context.ts:23](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/core-context.ts#L23) [src/handler/structures/context.ts:86](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/context.ts#L86)
___ ___
@@ -313,7 +228,7 @@ ___
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `content` | `ReplyOptions` | | `content` | [`ReplyOptions`](../modules.md#replyoptions) |
#### Returns #### Returns
@@ -321,28 +236,24 @@ ___
#### Defined in #### Defined in
[src/core/structures/context.ts:103](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L103) [src/handler/structures/context.ts:97](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/context.ts#L97)
___ ___
### wrap ### wrap
▸ **wrap**(`wrappable`): [`Context`](Context.md) `Static` **wrap**(`wrappable`): [`Context`](Context.md)
#### Parameters #### Parameters
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `wrappable` | `Message`<`boolean`\> \| `BaseInteraction`<`CacheType`\> | | `wrappable` | `Message`<`boolean`\> \| `ChatInputCommandInteraction`<`CacheType`\> |
#### Returns #### Returns
[`Context`](Context.md) [`Context`](Context.md)
#### Overrides
CoreContext.wrap
#### Defined in #### Defined in
[src/core/structures/context.ts:113](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/context.ts#L113) [src/handler/structures/context.ts:90](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/context.ts#L90)

View File

@@ -6,11 +6,6 @@ sidebar_position: 0
custom_edit_url: null custom_edit_url: null
--- ---
**`Since`**
2.0.0
Version 4.0.0 will internalize this api. Please refrain from using the defaults!
## Implements ## Implements
- [`ErrorHandling`](../interfaces/ErrorHandling.md) - [`ErrorHandling`](../interfaces/ErrorHandling.md)
@@ -19,63 +14,63 @@ Version 4.0.0 will internalize this api. Please refrain from using the defaults!
### constructor ### constructor
**new DefaultErrorHandling**(): [`DefaultErrorHandling`](DefaultErrorHandling.md) **new DefaultErrorHandling**()
#### Returns
[`DefaultErrorHandling`](DefaultErrorHandling.md)
## Properties ## Properties
### #keepAlive ### keepAlive
`Private` **#keepAlive**: `number` = `5` **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)
#### Defined in #### Defined in
[src/core/structures/services/error-handling.ts:13](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/error-handling.ts#L13) [src/handler/contracts/errorHandling.ts:24](https://github.com/sern-handler/handler/blob/33f1446/src/handler/contracts/errorHandling.ts#L24)
## Methods ## Methods
### crash ### crash
**crash**(`err`): `never` **crash**(`error`): `never`
Utility function to crash
#### Parameters #### Parameters
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `err` | `Error` | | `error` | `Error` |
#### Returns #### Returns
`never` `never`
**`Deprecated`**
Version 4 will remove this method
#### Implementation of #### Implementation of
[ErrorHandling](../interfaces/ErrorHandling.md).[crash](../interfaces/ErrorHandling.md#crash) [ErrorHandling](../interfaces/ErrorHandling.md).[crash](../interfaces/ErrorHandling.md#crash)
#### Defined in #### Defined in
[src/core/structures/services/error-handling.ts:9](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/error-handling.ts#L9) [src/handler/contracts/errorHandling.ts:25](https://github.com/sern-handler/handler/blob/33f1446/src/handler/contracts/errorHandling.ts#L25)
___ ___
### updateAlive ### updateAlive
**updateAlive**(`err`): `void` **updateAlive**(`e`): `void`
A function that is called on every throw. A function that is called on every crash. Updates keepAlive
#### Parameters #### Parameters
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `err` | `Error` | | `e` | `Error` |
#### Returns #### Returns
@@ -87,4 +82,4 @@ A function that is called on every throw.
#### Defined in #### Defined in
[src/core/structures/services/error-handling.ts:15](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/error-handling.ts#L15) [src/handler/contracts/errorHandling.ts:28](https://github.com/sern-handler/handler/blob/33f1446/src/handler/contracts/errorHandling.ts#L28)

View File

@@ -6,11 +6,6 @@ sidebar_position: 0
custom_edit_url: null custom_edit_url: null
--- ---
**`Since`**
2.0.0
Version 4.0.0 will internalize this api. Please refrain from using ModuleStore!
## Implements ## Implements
- [`Logging`](../interfaces/Logging.md) - [`Logging`](../interfaces/Logging.md)
@@ -19,17 +14,13 @@ Version 4.0.0 will internalize this api. Please refrain from using ModuleStore!
### constructor ### constructor
**new DefaultLogging**(): [`DefaultLogging`](DefaultLogging.md) **new DefaultLogging**()
#### Returns
[`DefaultLogging`](DefaultLogging.md)
## Methods ## Methods
### date ### date
**date**(): `Date` `Private` **date**(): `Date`
#### Returns #### Returns
@@ -37,7 +28,7 @@ Version 4.0.0 will internalize this api. Please refrain from using ModuleStore!
#### Defined in #### Defined in
[src/core/structures/services/logger.ts:9](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/logger.ts#L9) [src/handler/contracts/logging.ts:11](https://github.com/sern-handler/handler/blob/33f1446/src/handler/contracts/logging.ts#L11)
___ ___
@@ -49,7 +40,7 @@ ___
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `payload` | [`LogPayload`](../modules.md#logpayload) | | `payload` | [`LogPayload`](../modules.md#logpayload)<`unknown`\> |
#### Returns #### Returns
@@ -61,7 +52,7 @@ ___
#### Defined in #### Defined in
[src/core/structures/services/logger.ts:10](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/logger.ts#L10) [src/handler/contracts/logging.ts:12](https://github.com/sern-handler/handler/blob/33f1446/src/handler/contracts/logging.ts#L12)
___ ___
@@ -73,7 +64,7 @@ ___
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `payload` | [`LogPayload`](../modules.md#logpayload) | | `payload` | [`LogPayload`](../modules.md#logpayload)<`unknown`\> |
#### Returns #### Returns
@@ -85,7 +76,7 @@ ___
#### Defined in #### Defined in
[src/core/structures/services/logger.ts:14](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/logger.ts#L14) [src/handler/contracts/logging.ts:16](https://github.com/sern-handler/handler/blob/33f1446/src/handler/contracts/logging.ts#L16)
___ ___
@@ -97,7 +88,7 @@ ___
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `payload` | [`LogPayload`](../modules.md#logpayload) | | `payload` | [`LogPayload`](../modules.md#logpayload)<`unknown`\> |
#### Returns #### Returns
@@ -109,7 +100,7 @@ ___
#### Defined in #### Defined in
[src/core/structures/services/logger.ts:18](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/logger.ts#L18) [src/handler/contracts/logging.ts:20](https://github.com/sern-handler/handler/blob/33f1446/src/handler/contracts/logging.ts#L20)
___ ___
@@ -121,7 +112,7 @@ ___
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `payload` | [`LogPayload`](../modules.md#logpayload) | | `payload` | [`LogPayload`](../modules.md#logpayload)<`unknown`\> |
#### Returns #### Returns
@@ -133,4 +124,4 @@ ___
#### Defined in #### Defined in
[src/core/structures/services/logger.ts:22](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/logger.ts#L22) [src/handler/contracts/logging.ts:24](https://github.com/sern-handler/handler/blob/33f1446/src/handler/contracts/logging.ts#L24)

View File

@@ -6,11 +6,6 @@ sidebar_position: 0
custom_edit_url: null custom_edit_url: null
--- ---
**`Since`**
2.0.0
Version 4.0.0 will internalize this api. Please refrain from using DefaultModuleManager!
## Implements ## Implements
- [`ModuleManager`](../interfaces/ModuleManager.md) - [`ModuleManager`](../interfaces/ModuleManager.md)
@@ -19,61 +14,23 @@ Version 4.0.0 will internalize this api. Please refrain from using DefaultModule
### constructor ### constructor
**new DefaultModuleManager**(`moduleStore`): [`DefaultModuleManager`](DefaultModuleManager.md) **new DefaultModuleManager**(`moduleStore`)
#### Parameters #### Parameters
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `moduleStore` | [`CoreModuleStore`](../interfaces/CoreModuleStore.md) | | `moduleStore` | [`ModuleStore`](ModuleStore.md) |
#### Returns
[`DefaultModuleManager`](DefaultModuleManager.md)
#### Defined in #### 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) [src/handler/contracts/moduleManager.ts:13](https://github.com/sern-handler/handler/blob/33f1446/src/handler/contracts/moduleManager.ts#L13)
## 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 ## Methods
### get ### get
**get**(`id`): `undefined` \| `string` **get**<`T`\>(`strat`): `undefined` \| [`Processed`](../modules.md#processed)<[`CommandModuleDefs`](../modules.md#commandmoduledefs)[`T`]\>
#### 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 #### Type parameters
@@ -85,75 +42,31 @@ ___
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `name` | `string` | | `strat` | (`ms`: [`ModuleStore`](ModuleStore.md)) => `undefined` \| [`Processed`](../modules.md#processed)<[`CommandModuleDefs`](../modules.md#commandmoduledefs)[`T`]\> |
| `commandType` | `T` |
#### Returns #### Returns
`undefined` \| `Promise`<[`CommandModuleDefs`](../interfaces/CommandModuleDefs.md)[`T`]\> `undefined` \| [`Processed`](../modules.md#processed)<[`CommandModuleDefs`](../modules.md#commandmoduledefs)[`T`]\>
#### Implementation of #### Implementation of
[ModuleManager](../interfaces/ModuleManager.md).[getByNameCommandType](../interfaces/ModuleManager.md#getbynamecommandtype) [ModuleManager](../interfaces/ModuleManager.md).[get](../interfaces/ModuleManager.md#get)
#### Defined in #### Defined in
[src/core/structures/services/module-manager.ts:15](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/module-manager.ts#L15) [src/handler/contracts/moduleManager.ts:14](https://github.com/sern-handler/handler/blob/33f1446/src/handler/contracts/moduleManager.ts#L14)
___
### getMetadata
**getMetadata**(`m`): `CommandMeta`
#### Parameters
| Name | Type |
| :------ | :------ |
| `m` | `Module` |
#### Returns
`CommandMeta`
#### Implementation of
[ModuleManager](../interfaces/ModuleManager.md).[getMetadata](../interfaces/ModuleManager.md#getmetadata)
#### Defined in
[src/core/structures/services/module-manager.ts: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
**set**(`id`, `path`): `void` **set**(`strat`): `void`
#### Parameters #### Parameters
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `id` | `string` | | `strat` | (`ms`: [`ModuleStore`](ModuleStore.md)) => `void` |
| `path` | `string` |
#### Returns #### Returns
@@ -165,29 +78,4 @@ ___
#### Defined in #### Defined in
[src/core/structures/services/module-manager.ts:38](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/services/module-manager.ts#L38) [src/handler/contracts/moduleManager.ts:20](https://github.com/sern-handler/handler/blob/33f1446/src/handler/contracts/moduleManager.ts#L20)
___
### 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)

View File

@@ -6,9 +6,9 @@ sidebar_position: 0
custom_edit_url: null custom_edit_url: null
--- ---
**`Deprecated`** **`Experimental`**
Will be removed in future Will be refactored in future
## Type parameters ## Type parameters
@@ -20,7 +20,7 @@ Will be removed in future
### constructor ### constructor
**new EventExecutable**<`Type`\>(): [`EventExecutable`](EventExecutable.md)<`Type`\> **new EventExecutable**<`Type`\>()
#### Type parameters #### Type parameters
@@ -28,19 +28,35 @@ Will be removed in future
| :------ | :------ | | :------ | :------ |
| `Type` | extends [`EventType`](../enums/EventType.md) | | `Type` | extends [`EventType`](../enums/EventType.md) |
#### Returns
[`EventExecutable`](EventExecutable.md)<`Type`\>
## Properties ## Properties
### plugins ### execute
**plugins**: [`AnyEventPlugin`](../modules.md#anyeventplugin)[] = `[]` `Abstract` **execute**: [`EventModuleDefs`](../modules.md#eventmoduledefs)[`Type`][``"execute"``]
#### Defined in #### Defined in
[src/core/modules.ts:101](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L101) [src/handler/sern.ts:130](https://github.com/sern-handler/handler/blob/33f1446/src/handler/sern.ts#L130)
___
### onEvent
• **onEvent**: [`ControlPlugin`](../interfaces/ControlPlugin.md)<`any`[]\>[] = `[]`
#### Defined in
[src/handler/sern.ts:129](https://github.com/sern-handler/handler/blob/33f1446/src/handler/sern.ts#L129)
___
### plugins
• **plugins**: [`InitPlugin`](../interfaces/InitPlugin.md)<`any`[]\>[] = `[]`
#### Defined in
[src/handler/sern.ts:128](https://github.com/sern-handler/handler/blob/33f1446/src/handler/sern.ts#L128)
___ ___
@@ -50,48 +66,4 @@ ___
#### Defined in #### Defined in
[src/core/modules.ts:100](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L100) [src/handler/sern.ts:127](https://github.com/sern-handler/handler/blob/33f1446/src/handler/sern.ts#L127)
___
### \_instance
`Static` `Private` **\_instance**: [`EventModule`](../modules.md#eventmodule)
#### Defined in
[src/core/modules.ts:103](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L103)
## Methods
### execute
**execute**(`...args`): `unknown`
#### Parameters
| Name | Type |
| :------ | :------ |
| `...args` | `EventArgs`<`Type`, [`Control`](../enums/PluginType.md#control)\> |
#### Returns
`unknown`
#### Defined in
[src/core/modules.ts:112](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L112)
___
### getInstance
**getInstance**(): [`EventModule`](../modules.md#eventmodule)
#### Returns
[`EventModule`](../modules.md#eventmodule)
#### Defined in
[src/core/modules.ts:104](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/modules.ts#L104)

View File

@@ -6,46 +6,80 @@ sidebar_position: 0
custom_edit_url: null custom_edit_url: null
--- ---
Represents a core module store that stores IDs mapped to file paths. Storing all command modules
This dependency is usually injected into ModuleManager
## Implements
- [`CoreModuleStore`](../interfaces/CoreModuleStore.md)
## Constructors ## Constructors
### constructor ### constructor
**new ModuleStore**(): [`ModuleStore`](ModuleStore.md) **new ModuleStore**()
#### Returns
[`ModuleStore`](ModuleStore.md)
## Properties ## Properties
### commands ### ApplicationCommands
**commands**: `Map`<`string`, `string`\> `Readonly` **ApplicationCommands**: `Object`
#### Implementation of #### Type declaration
[CoreModuleStore](../interfaces/CoreModuleStore.md).[commands](../interfaces/CoreModuleStore.md#commands) | Name | Type |
| :------ | :------ |
| `1` | `Map`<`string`, [`Processed`](../modules.md#processed)<[`CommandModule`](../modules.md#commandmodule)\>\> |
| `2` | `Map`<`string`, [`Processed`](../modules.md#processed)<[`CommandModule`](../modules.md#commandmodule)\>\> |
| `3` | `Map`<`string`, [`Processed`](../modules.md#processed)<[`CommandModule`](../modules.md#commandmodule)\>\> |
#### Defined in #### Defined in
[src/core/structures/module-store.ts:11](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/module-store.ts#L11) [src/handler/structures/moduleStore.ts:11](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/moduleStore.ts#L11)
___ ___
### metadata ### BothCommands
**metadata**: `WeakMap`<`Module`, `CommandMeta`\> `Readonly` **BothCommands**: `Map`<`string`, [`Processed`](../modules.md#processed)<[`CommandModule`](../modules.md#commandmodule)\>\>
#### Implementation of
[CoreModuleStore](../interfaces/CoreModuleStore.md).[metadata](../interfaces/CoreModuleStore.md#metadata)
#### Defined in #### Defined in
[src/core/structures/module-store.ts:10](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/module-store.ts#L10) [src/handler/structures/moduleStore.ts:10](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/moduleStore.ts#L10)
___
### InteractionHandlers
`Readonly` **InteractionHandlers**: `Object`
#### Type declaration
| Name | Type |
| :------ | :------ |
| `2` | `Map`<`string`, [`Processed`](../modules.md#processed)<[`CommandModule`](../modules.md#commandmodule)\>\> |
| `3` | `Map`<`string`, [`Processed`](../modules.md#processed)<[`CommandModule`](../modules.md#commandmodule)\>\> |
| `5` | `Map`<`string`, [`Processed`](../modules.md#processed)<[`CommandModule`](../modules.md#commandmodule)\>\> |
| `6` | `Map`<`string`, [`Processed`](../modules.md#processed)<[`CommandModule`](../modules.md#commandmodule)\>\> |
| `7` | `Map`<`string`, [`Processed`](../modules.md#processed)<[`CommandModule`](../modules.md#commandmodule)\>\> |
| `8` | `Map`<`string`, [`Processed`](../modules.md#processed)<[`CommandModule`](../modules.md#commandmodule)\>\> |
#### Defined in
[src/handler/structures/moduleStore.ts:18](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/moduleStore.ts#L18)
___
### ModalSubmit
`Readonly` **ModalSubmit**: `Map`<`string`, [`Processed`](../modules.md#processed)<[`CommandModule`](../modules.md#commandmodule)\>\>
#### Defined in
[src/handler/structures/moduleStore.ts:16](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/moduleStore.ts#L16)
___
### TextCommands
`Readonly` **TextCommands**: `Map`<`string`, [`Processed`](../modules.md#processed)<[`CommandModule`](../modules.md#commandmodule)\>\>
#### Defined in
[src/handler/structures/moduleStore.ts:17](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/moduleStore.ts#L17)

View File

@@ -6,10 +6,6 @@ sidebar_position: 0
custom_edit_url: null custom_edit_url: null
--- ---
**`Since`**
1.0.0
## Hierarchy ## Hierarchy
- `EventEmitter` - `EventEmitter`
@@ -20,19 +16,21 @@ custom_edit_url: null
### constructor ### constructor
**new SernEmitter**(): [`SernEmitter`](SernEmitter.md) **new SernEmitter**(`options?`)
#### Returns #### Parameters
[`SernEmitter`](SernEmitter.md) | Name | Type |
| :------ | :------ |
| `options?` | `EventEmitterOptions` |
#### Overrides #### Inherited from
EventEmitter.constructor EventEmitter.constructor
#### Defined in #### Defined in
[src/core/structures/sern-emitter.ts:10](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/sern-emitter.ts#L10) node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:111
## Properties ## Properties
@@ -46,7 +44,7 @@ EventEmitter.captureRejectionSymbol
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:357 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:328
___ ___
@@ -62,7 +60,7 @@ EventEmitter.captureRejections
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:362 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:333
___ ___
@@ -76,7 +74,7 @@ EventEmitter.defaultMaxListeners
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:363 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:334
___ ___
@@ -98,7 +96,7 @@ EventEmitter.errorMonitor
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:356 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:327
## Methods ## Methods
@@ -108,6 +106,10 @@ node_modules/@types/node/events.d.ts:356
Alias for `emitter.on(eventName, listener)`. Alias for `emitter.on(eventName, listener)`.
**`Since`**
v0.1.26
#### Parameters #### Parameters
| Name | Type | | Name | Type |
@@ -119,23 +121,19 @@ Alias for `emitter.on(eventName, listener)`.
[`SernEmitter`](SernEmitter.md) [`SernEmitter`](SernEmitter.md)
**`Since`**
v0.1.26
#### Inherited from #### Inherited from
EventEmitter.addListener EventEmitter.addListener
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:383 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:354
___ ___
### emit ### 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 Listening to sern events with on. This event stays on until a crash or a normal exit
@@ -143,14 +141,14 @@ Listening to sern events with on. This event stays on until a crash or a normal
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `T` | extends keyof [`SernEventsMapping`](../interfaces/SernEventsMapping.md) | | `T` | extends keyof [`SernEventsMapping`](../modules.md#serneventsmapping) |
#### Parameters #### Parameters
| Name | Type | Description | | Name | Type | Description |
| :------ | :------ | :------ | | :------ | :------ | :------ |
| `eventName` | `T` | | | `eventName` | `T` | |
| `...args` | [`SernEventsMapping`](../interfaces/SernEventsMapping.md)[`T`] | the arguments for emitting the eventName | | `...args` | [`SernEventsMapping`](../modules.md#serneventsmapping)[`T`] | the arguments for emitting the eventName |
#### Returns #### Returns
@@ -162,7 +160,7 @@ EventEmitter.emit
#### Defined in #### Defined in
[src/core/structures/sern-emitter.ts:40](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/sern-emitter.ts#L40) [src/handler/sernEmitter.ts:34](https://github.com/sern-handler/handler/blob/33f1446/src/handler/sernEmitter.ts#L34)
___ ___
@@ -186,21 +184,21 @@ console.log(myEE.eventNames());
// Prints: [ 'foo', 'bar', Symbol(symbol) ] // Prints: [ 'foo', 'bar', Symbol(symbol) ]
``` ```
#### Returns
(`string` \| `symbol`)[]
**`Since`** **`Since`**
v6.0.0 v6.0.0
#### Returns
(`string` \| `symbol`)[]
#### Inherited from #### Inherited from
EventEmitter.eventNames EventEmitter.eventNames
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:702 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:669
___ ___
@@ -211,55 +209,51 @@ ___
Returns the current max listener value for the `EventEmitter` which is either Returns the current max listener value for the `EventEmitter` which is either
set by `emitter.setMaxListeners(n)` or defaults to [defaultMaxListeners](SernEmitter.md#defaultmaxlisteners). set by `emitter.setMaxListeners(n)` or defaults to [defaultMaxListeners](SernEmitter.md#defaultmaxlisteners).
#### Returns
`number`
**`Since`** **`Since`**
v1.0.0 v1.0.0
#### Returns
`number`
#### Inherited from #### Inherited from
EventEmitter.getMaxListeners EventEmitter.getMaxListeners
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:555 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:526
___ ___
### listenerCount ### listenerCount
**listenerCount**(`eventName`, `listener?`): `number` **listenerCount**(`eventName`): `number`
Returns the number of listeners listening to the event named `eventName`. Returns the number of listeners listening to the event named `eventName`.
If `listener` is provided, it will return how many times the listener **`Since`**
is found in the list of the listeners of the event.
v3.2.0
#### Parameters #### Parameters
| Name | Type | Description | | Name | Type | Description |
| :------ | :------ | :------ | | :------ | :------ | :------ |
| `eventName` | `string` \| `symbol` | The name of the event being listened for | | `eventName` | `string` \| `symbol` | The name of the event being listened for |
| `listener?` | `Function` | The event handler function |
#### Returns #### Returns
`number` `number`
**`Since`**
v3.2.0
#### Inherited from #### Inherited from
EventEmitter.listenerCount EventEmitter.listenerCount
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:649 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:616
___ ___
@@ -277,6 +271,10 @@ console.log(util.inspect(server.listeners('connection')));
// Prints: [ [Function] ] // Prints: [ [Function] ]
``` ```
**`Since`**
v0.1.26
#### Parameters #### Parameters
| Name | Type | | Name | Type |
@@ -287,17 +285,13 @@ console.log(util.inspect(server.listeners('connection')));
`Function`[] `Function`[]
**`Since`**
v0.1.26
#### Inherited from #### Inherited from
EventEmitter.listeners EventEmitter.listeners
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:568 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:539
___ ___
@@ -307,6 +301,10 @@ ___
Alias for `emitter.removeListener()`. Alias for `emitter.removeListener()`.
**`Since`**
v10.0.0
#### Parameters #### Parameters
| Name | Type | | Name | Type |
@@ -318,17 +316,13 @@ Alias for `emitter.removeListener()`.
[`SernEmitter`](SernEmitter.md) [`SernEmitter`](SernEmitter.md)
**`Since`**
v10.0.0
#### Inherited from #### Inherited from
EventEmitter.off EventEmitter.off
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:528 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:499
___ ___
@@ -342,14 +336,14 @@ Listening to sern events with on. This event stays on until a crash or a normal
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `T` | extends keyof [`SernEventsMapping`](../interfaces/SernEventsMapping.md) | | `T` | extends keyof [`SernEventsMapping`](../modules.md#serneventsmapping) |
#### Parameters #### Parameters
| Name | Type | Description | | Name | Type | Description |
| :------ | :------ | :------ | | :------ | :------ | :------ |
| `eventName` | `T` | | | `eventName` | `T` | |
| `listener` | (...`args`: [`SernEventsMapping`](../interfaces/SernEventsMapping.md)[`T`][]) => `void` | what to do with the data | | `listener` | (...`args`: [`SernEventsMapping`](../modules.md#serneventsmapping)[`T`][]) => `void` | what to do with the data |
#### Returns #### Returns
@@ -361,7 +355,7 @@ EventEmitter.on
#### Defined in #### Defined in
[src/core/structures/sern-emitter.ts:18](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/sern-emitter.ts#L18) [src/handler/sernEmitter.ts:12](https://github.com/sern-handler/handler/blob/33f1446/src/handler/sernEmitter.ts#L12)
___ ___
@@ -375,14 +369,14 @@ Listening to sern events with on. This event stays on until a crash or a normal
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `T` | extends keyof [`SernEventsMapping`](../interfaces/SernEventsMapping.md) | | `T` | extends keyof [`SernEventsMapping`](../modules.md#serneventsmapping) |
#### Parameters #### Parameters
| Name | Type | Description | | Name | Type | Description |
| :------ | :------ | :------ | | :------ | :------ | :------ |
| `eventName` | `T` | | | `eventName` | `T` | |
| `listener` | (...`args`: [`SernEventsMapping`](../interfaces/SernEventsMapping.md)[`T`][]) => `void` | what to do with the data | | `listener` | (...`args`: [`SernEventsMapping`](../modules.md#serneventsmapping)[`T`][]) => `void` | what to do with the data |
#### Returns #### Returns
@@ -394,7 +388,7 @@ EventEmitter.once
#### Defined in #### Defined in
[src/core/structures/sern-emitter.ts:29](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/sern-emitter.ts#L29) [src/handler/sernEmitter.ts:23](https://github.com/sern-handler/handler/blob/33f1446/src/handler/sernEmitter.ts#L23)
___ ___
@@ -415,6 +409,10 @@ server.prependListener('connection', (stream) => {
Returns a reference to the `EventEmitter`, so that calls can be chained. Returns a reference to the `EventEmitter`, so that calls can be chained.
**`Since`**
v6.0.0
#### Parameters #### Parameters
| Name | Type | Description | | Name | Type | Description |
@@ -426,17 +424,13 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
[`SernEmitter`](SernEmitter.md) [`SernEmitter`](SernEmitter.md)
**`Since`**
v6.0.0
#### Inherited from #### Inherited from
EventEmitter.prependListener EventEmitter.prependListener
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:667 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:634
___ ___
@@ -455,6 +449,10 @@ server.prependOnceListener('connection', (stream) => {
Returns a reference to the `EventEmitter`, so that calls can be chained. Returns a reference to the `EventEmitter`, so that calls can be chained.
**`Since`**
v6.0.0
#### Parameters #### Parameters
| Name | Type | Description | | Name | Type | Description |
@@ -466,17 +464,13 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
[`SernEmitter`](SernEmitter.md) [`SernEmitter`](SernEmitter.md)
**`Since`**
v6.0.0
#### Inherited from #### Inherited from
EventEmitter.prependOnceListener EventEmitter.prependOnceListener
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:683 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:650
___ ___
@@ -511,6 +505,10 @@ newListeners[0]();
emitter.emit('log'); emitter.emit('log');
``` ```
**`Since`**
v9.4.0
#### Parameters #### Parameters
| Name | Type | | Name | Type |
@@ -521,17 +519,13 @@ emitter.emit('log');
`Function`[] `Function`[]
**`Since`**
v9.4.0
#### Inherited from #### Inherited from
EventEmitter.rawListeners EventEmitter.rawListeners
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:598 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:569
___ ___
@@ -547,6 +541,10 @@ component or module (e.g. sockets or file streams).
Returns a reference to the `EventEmitter`, so that calls can be chained. Returns a reference to the `EventEmitter`, so that calls can be chained.
**`Since`**
v0.1.26
#### Parameters #### Parameters
| Name | Type | | Name | Type |
@@ -557,17 +555,13 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
[`SernEmitter`](SernEmitter.md) [`SernEmitter`](SernEmitter.md)
**`Since`**
v0.1.26
#### Inherited from #### Inherited from
EventEmitter.removeAllListeners EventEmitter.removeAllListeners
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:539 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:510
___ ___
@@ -652,6 +646,10 @@ ee.emit('ping');
Returns a reference to the `EventEmitter`, so that calls can be chained. Returns a reference to the `EventEmitter`, so that calls can be chained.
**`Since`**
v0.1.26
#### Parameters #### Parameters
| Name | Type | | Name | Type |
@@ -663,17 +661,13 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
[`SernEmitter`](SernEmitter.md) [`SernEmitter`](SernEmitter.md)
**`Since`**
v0.1.26
#### Inherited from #### Inherited from
EventEmitter.removeListener EventEmitter.removeListener
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:523 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:494
___ ___
@@ -688,6 +682,10 @@ 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. Returns a reference to the `EventEmitter`, so that calls can be chained.
**`Since`**
v0.3.5
#### Parameters #### Parameters
| Name | Type | | Name | Type |
@@ -698,23 +696,19 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
[`SernEmitter`](SernEmitter.md) [`SernEmitter`](SernEmitter.md)
**`Since`**
v0.3.5
#### Inherited from #### Inherited from
EventEmitter.setMaxListeners EventEmitter.setMaxListeners
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:549 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:520
___ ___
### failure ### failure
**failure**(`module?`, `reason?`): `Object` `Static` **failure**(`module?`, `reason?`): `never` & { `module?`: [`AnyModule`](../modules.md#anymodule) ; `reason`: `string` \| `Error` ; `type`: [`Failure`](../enums/PayloadType.md#failure) } & { `type`: [`Failure`](../enums/PayloadType.md#failure) } & `never`
Creates a compliant SernEmitter failure payload Creates a compliant SernEmitter failure payload
@@ -722,28 +716,22 @@ Creates a compliant SernEmitter failure payload
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `module?` | `Module` | | `module?` | [`Module`](../interfaces/Module.md) |
| `reason?` | `unknown` | | `reason?` | `unknown` |
#### Returns #### Returns
`Object` `never` & { `module?`: [`AnyModule`](../modules.md#anymodule) ; `reason`: `string` \| `Error` ; `type`: [`Failure`](../enums/PayloadType.md#failure) } & { `type`: [`Failure`](../enums/PayloadType.md#failure) } & `never`
| Name | Type |
| :------ | :------ |
| `module?` | `AnyModule` |
| `reason` | `string` \| `Error` |
| `type` | [`Failure`](../enums/PayloadType.md#failure) |
#### Defined in #### Defined in
[src/core/structures/sern-emitter.ts:59](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/sern-emitter.ts#L59) [src/handler/sernEmitter.ts:53](https://github.com/sern-handler/handler/blob/33f1446/src/handler/sernEmitter.ts#L53)
___ ___
### getEventListeners ### getEventListeners
**getEventListeners**(`emitter`, `name`): `Function`[] `Static` **getEventListeners**(`emitter`, `name`): `Function`[]
Returns a copy of the array of listeners for the event named `eventName`. Returns a copy of the array of listeners for the event named `eventName`.
@@ -770,6 +758,10 @@ const { getEventListeners, EventEmitter } = require('events');
} }
``` ```
**`Since`**
v15.2.0, v14.17.0
#### Parameters #### Parameters
| Name | Type | | Name | Type |
@@ -781,77 +773,19 @@ const { getEventListeners, EventEmitter } = require('events');
`Function`[] `Function`[]
**`Since`**
v15.2.0, v14.17.0
#### Inherited from #### Inherited from
EventEmitter.getEventListeners EventEmitter.getEventListeners
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:299 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/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 ### listenerCount
**listenerCount**(`emitter`, `eventName`): `number` `Static` **listenerCount**(`emitter`, `eventName`): `number`
A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`. A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
@@ -864,6 +798,14 @@ console.log(listenerCount(myEmitter, 'event'));
// Prints: 2 // Prints: 2
``` ```
**`Since`**
v0.9.12
**`Deprecated`**
Since v3.2.0 - Use `listenerCount` instead.
#### Parameters #### Parameters
| Name | Type | Description | | Name | Type | Description |
@@ -875,27 +817,19 @@ console.log(listenerCount(myEmitter, 'event'));
`number` `number`
**`Since`**
v0.9.12
**`Deprecated`**
Since v3.2.0 - Use `listenerCount` instead.
#### Inherited from #### Inherited from
EventEmitter.listenerCount EventEmitter.listenerCount
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:271 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:271
___ ___
### on ### on
**on**(`emitter`, `eventName`, `options?`): `AsyncIterableIterator`<`any`\> `Static` **on**(`emitter`, `eventName`, `options?`): `AsyncIterableIterator`<`any`\>
```js ```js
const { on, EventEmitter } = require('events'); const { on, EventEmitter } = require('events');
@@ -951,6 +885,10 @@ const ac = new AbortController();
process.nextTick(() => ac.abort()); process.nextTick(() => ac.abort());
``` ```
**`Since`**
v13.6.0, v12.16.0
#### Parameters #### Parameters
| Name | Type | Description | | Name | Type | Description |
@@ -965,37 +903,33 @@ process.nextTick(() => ac.abort());
that iterates `eventName` events emitted by the `emitter` that iterates `eventName` events emitted by the `emitter`
**`Since`**
v13.6.0, v12.16.0
#### Inherited from #### Inherited from
EventEmitter.on EventEmitter.on
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:254 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:254
**on**<`Emitter`, `Events`\>(`eventEmitter`, `eventName`): `AsyncIterableIterator`<`Emitter` extends `Client`<`boolean`\> ? `ClientEvents`[`Events`] : `any`\> `Static` **on**<`E`, `K`\>(`eventEmitter`, `eventName`): `AsyncIterableIterator`<`E` extends `Client`<`boolean`\> ? `ClientEvents`[`K`] : `any`\>
#### Type parameters #### Type parameters
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `Emitter` | extends `__module` | | `E` | extends `__module` |
| `Events` | extends keyof `ClientEvents` | | `K` | extends keyof `ClientEvents` |
#### Parameters #### Parameters
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `eventEmitter` | `Emitter` | | `eventEmitter` | `E` |
| `eventName` | `Emitter` extends `Client`<`boolean`\> ? `Events` : `string` | | `eventName` | `E` extends `Client`<`boolean`\> ? `K` : `string` |
#### Returns #### Returns
`AsyncIterableIterator`<`Emitter` extends `Client`<`boolean`\> ? `ClientEvents`[`Events`] : `any`\> `AsyncIterableIterator`<`E` extends `Client`<`boolean`\> ? `ClientEvents`[`K`] : `any`\>
#### Inherited from #### Inherited from
@@ -1003,13 +937,13 @@ EventEmitter.on
#### Defined in #### Defined in
node_modules/discord.js/typings/index.d.ts:243 node_modules/.pnpm/discord.js@14.7.1/node_modules/discord.js/typings/index.d.ts:222
___ ___
### once ### once
**once**(`emitter`, `eventName`, `options?`): `Promise`<`any`[]\> `Static` **once**(`emitter`, `eventName`, `options?`): `Promise`<`any`[]\>
Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given
event or that is rejected if the `EventEmitter` emits `'error'` while waiting. event or that is rejected if the `EventEmitter` emits `'error'` while waiting.
@@ -1091,6 +1025,10 @@ ac.abort(); // Abort waiting for the event
ee.emit('foo'); // Prints: Waiting for the event was canceled! ee.emit('foo'); // Prints: Waiting for the event was canceled!
``` ```
**`Since`**
v11.13.0, v10.16.0
#### Parameters #### Parameters
| Name | Type | | Name | Type |
@@ -1103,19 +1041,15 @@ ee.emit('foo'); // Prints: Waiting for the event was canceled!
`Promise`<`any`[]\> `Promise`<`any`[]\>
**`Since`**
v11.13.0, v10.16.0
#### Inherited from #### Inherited from
EventEmitter.once EventEmitter.once
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:194 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:194
**once**(`emitter`, `eventName`, `options?`): `Promise`<`any`[]\> `Static` **once**(`emitter`, `eventName`, `options?`): `Promise`<`any`[]\>
#### Parameters #### Parameters
@@ -1135,27 +1069,27 @@ EventEmitter.once
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:195 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:195
**once**<`Emitter`, `Event`\>(`eventEmitter`, `eventName`): `Promise`<`Emitter` extends `Client`<`boolean`\> ? `ClientEvents`[`Event`] : `any`[]\> `Static` **once**<`E`, `K`\>(`eventEmitter`, `eventName`): `Promise`<`E` extends `Client`<`boolean`\> ? `ClientEvents`[`K`] : `any`[]\>
#### Type parameters #### Type parameters
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `Emitter` | extends `__module` | | `E` | extends `__module` |
| `Event` | extends keyof `ClientEvents` | | `K` | extends keyof `ClientEvents` |
#### Parameters #### Parameters
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `eventEmitter` | `Emitter` | | `eventEmitter` | `E` |
| `eventName` | `Emitter` extends `Client`<`boolean`\> ? `Event` : `string` | | `eventName` | `E` extends `Client`<`boolean`\> ? `K` : `string` |
#### Returns #### Returns
`Promise`<`Emitter` extends `Client`<`boolean`\> ? `ClientEvents`[`Event`] : `any`[]\> `Promise`<`E` extends `Client`<`boolean`\> ? `ClientEvents`[`K`] : `any`[]\>
#### Inherited from #### Inherited from
@@ -1163,13 +1097,13 @@ EventEmitter.once
#### Defined in #### Defined in
node_modules/discord.js/typings/index.d.ts:239 node_modules/.pnpm/discord.js@14.7.1/node_modules/discord.js/typings/index.d.ts:218
___ ___
### payload ### payload
**payload**<`T`\>(`type`, `module?`, `reason?`): `T` `Static` `Private` **payload**<`T`\>(`type`, `module?`, `reason?`): `T`
#### Type parameters #### Type parameters
@@ -1182,7 +1116,7 @@ ___
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `type` | [`PayloadType`](../enums/PayloadType.md) | | `type` | [`PayloadType`](../enums/PayloadType.md) |
| `module?` | `Module` | | `module?` | [`Module`](../interfaces/Module.md) |
| `reason?` | `unknown` | | `reason?` | `unknown` |
#### Returns #### Returns
@@ -1191,13 +1125,13 @@ ___
#### Defined in #### Defined in
[src/core/structures/sern-emitter.ts:46](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/sern-emitter.ts#L46) [src/handler/sernEmitter.ts:40](https://github.com/sern-handler/handler/blob/33f1446/src/handler/sernEmitter.ts#L40)
___ ___
### setMaxListeners ### setMaxListeners
**setMaxListeners**(`n?`, `...eventTargets`): `void` `Static` **setMaxListeners**(`n?`, ...`eventTargets`): `void`
```js ```js
const { const {
@@ -1211,6 +1145,10 @@ const emitter = new EventEmitter();
setMaxListeners(5, target, emitter); setMaxListeners(5, target, emitter);
``` ```
**`Since`**
v15.4.0
#### Parameters #### Parameters
| Name | Type | Description | | Name | Type | Description |
@@ -1222,23 +1160,19 @@ setMaxListeners(5, target, emitter);
`void` `void`
**`Since`**
v15.4.0
#### Inherited from #### Inherited from
EventEmitter.setMaxListeners EventEmitter.setMaxListeners
#### Defined in #### Defined in
node_modules/@types/node/events.d.ts:346 node_modules/.pnpm/@types+node@18.11.18/node_modules/@types/node/ts4.8/events.d.ts:317
___ ___
### success ### success
**success**(`module`): `Object` `Static` **success**(`module`): { `module`: [`AnyModule`](../modules.md#anymodule) ; `type`: [`Success`](../enums/PayloadType.md#success) } & { `type`: [`Success`](../enums/PayloadType.md#success) } & `never` & `never`
Creates a compliant SernEmitter module success payload Creates a compliant SernEmitter module success payload
@@ -1246,26 +1180,21 @@ Creates a compliant SernEmitter module success payload
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `module` | `Module` | | `module` | [`Module`](../interfaces/Module.md) |
#### Returns #### Returns
`Object` { `module`: [`AnyModule`](../modules.md#anymodule) ; `type`: [`Success`](../enums/PayloadType.md#success) } & { `type`: [`Success`](../enums/PayloadType.md#success) } & `never` & `never`
| Name | Type |
| :------ | :------ |
| `module` | `AnyModule` |
| `type` | [`Success`](../enums/PayloadType.md#success) |
#### Defined in #### Defined in
[src/core/structures/sern-emitter.ts:72](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/sern-emitter.ts#L72) [src/handler/sernEmitter.ts:66](https://github.com/sern-handler/handler/blob/33f1446/src/handler/sernEmitter.ts#L66)
___ ___
### warning ### warning
**warning**(`reason`): `Object` `Static` **warning**(`reason`): `never` & `never` & { `reason`: `string` ; `type`: [`Warning`](../enums/PayloadType.md#warning) } & { `type`: [`Warning`](../enums/PayloadType.md#warning) }
Creates a compliant SernEmitter module warning payload Creates a compliant SernEmitter module warning payload
@@ -1277,13 +1206,8 @@ Creates a compliant SernEmitter module warning payload
#### Returns #### Returns
`Object` `never` & `never` & { `reason`: `string` ; `type`: [`Warning`](../enums/PayloadType.md#warning) } & { `type`: [`Warning`](../enums/PayloadType.md#warning) }
| Name | Type |
| :------ | :------ |
| `reason` | `string` |
| `type` | [`Warning`](../enums/PayloadType.md#warning) |
#### Defined in #### Defined in
[src/core/structures/sern-emitter.ts:82](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/sern-emitter.ts#L82) [src/handler/sernEmitter.ts:76](https://github.com/sern-handler/handler/blob/33f1446/src/handler/sernEmitter.ts#L76)

View File

@@ -6,9 +6,6 @@ sidebar_position: 0
custom_edit_url: null custom_edit_url: null
--- ---
**`Since`**
1.0.0
A bitfield that discriminates command modules A bitfield that discriminates command modules
**`Example`** **`Example`**
@@ -30,9 +27,11 @@ export default commandModule({
**Both** = ``3`` **Both** = ``3``
The CommandType for hybrid commands, text and slash
#### Defined in #### Defined in
[src/core/structures/enums.ts:20](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L20) [src/handler/structures/enums.ts:28](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L28)
___ ___
@@ -40,19 +39,23 @@ ___
• **Button** = ``16`` • **Button** = ``16``
The CommandType for ButtonInteraction commands
#### Defined in #### Defined in
[src/core/structures/enums.ts:23](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L23) [src/handler/structures/enums.ts:40](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L40)
___ ___
### ChannelSelect ### ChannelSelect
• **ChannelSelect** = ``1024`` • **ChannelSelect** = ``256``
The CommandType for the other SelectMenuInteractions
#### Defined in #### Defined in
[src/core/structures/enums.ts:29](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L29) [src/handler/structures/enums.ts:52](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L52)
___ ___
@@ -60,9 +63,11 @@ ___
• **CtxMsg** = ``8`` • **CtxMsg** = ``8``
The CommandType for MessageContextMenuInteraction commands
#### Defined in #### Defined in
[src/core/structures/enums.ts:22](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L22) [src/handler/structures/enums.ts:36](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L36)
___ ___
@@ -70,9 +75,11 @@ ___
• **CtxUser** = ``4`` • **CtxUser** = ``4``
The CommandType for UserContextMenuInteraction commands
#### Defined in #### Defined in
[src/core/structures/enums.ts:21](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L21) [src/handler/structures/enums.ts:32](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L32)
___ ___
@@ -82,7 +89,7 @@ ___
#### Defined in #### Defined in
[src/core/structures/enums.ts:28](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L28) [src/handler/structures/enums.ts:53](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L53)
___ ___
@@ -90,19 +97,21 @@ ___
• **Modal** = ``64`` • **Modal** = ``64``
The CommandType for ModalSubmitInteraction commands
#### Defined in #### Defined in
[src/core/structures/enums.ts:25](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L25) [src/handler/structures/enums.ts:48](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L48)
___ ___
### RoleSelect ### RoleSelect
• **RoleSelect** = ``256`` • **RoleSelect** = ``1024``
#### Defined in #### Defined in
[src/core/structures/enums.ts:27](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L27) [src/handler/structures/enums.ts:54](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L54)
___ ___
@@ -110,9 +119,11 @@ ___
• **Slash** = ``2`` • **Slash** = ``2``
The CommandType for slash commands
#### Defined in #### Defined in
[src/core/structures/enums.ts:19](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L19) [src/handler/structures/enums.ts:24](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L24)
___ ___
@@ -120,9 +131,11 @@ ___
• **StringSelect** = ``32`` • **StringSelect** = ``32``
The CommandType for StringSelectMenuInteraction commands
#### Defined in #### Defined in
[src/core/structures/enums.ts:24](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L24) [src/handler/structures/enums.ts:44](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L44)
___ ___
@@ -130,16 +143,18 @@ ___
• **Text** = ``1`` • **Text** = ``1``
The CommandType for text commands
#### Defined in #### Defined in
[src/core/structures/enums.ts:18](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L18) [src/handler/structures/enums.ts:20](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L20)
___ ___
### UserSelect ### UserSelect
• **UserSelect** = ``128`` • **UserSelect** = ``2048``
#### Defined in #### Defined in
[src/core/structures/enums.ts:26](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L26) [src/handler/structures/enums.ts:55](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L55)

View File

@@ -31,7 +31,7 @@ The EventType for handling discord events
#### Defined in #### Defined in
[src/core/structures/enums.ts:51](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L51) [src/handler/structures/enums.ts:77](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L77)
___ ___
@@ -44,7 +44,7 @@ Could be for example, `process` events, database events
#### Defined in #### Defined in
[src/core/structures/enums.ts:60](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L60) [src/handler/structures/enums.ts:86](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L86)
___ ___
@@ -56,4 +56,4 @@ The EventType for handling sern events
#### Defined in #### Defined in
[src/core/structures/enums.ts:55](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L55) [src/handler/structures/enums.ts:81](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L81)

View File

@@ -16,7 +16,7 @@ The PayloadType for a SernEmitter failure event
#### Defined in #### Defined in
[src/core/structures/enums.ts:98](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L98) [src/handler/structures/enums.ts:134](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L134)
___ ___
@@ -28,7 +28,7 @@ The PayloadType for a SernEmitter success event
#### Defined in #### Defined in
[src/core/structures/enums.ts:94](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L94) [src/handler/structures/enums.ts:130](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L130)
___ ___
@@ -40,4 +40,4 @@ The PayloadType for a SernEmitter warning event
#### Defined in #### Defined in
[src/core/structures/enums.ts:102](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L102) [src/handler/structures/enums.ts:138](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L138)

View File

@@ -22,6 +22,20 @@ export default function myPlugin() : EventPlugin<CommandType.Text> {
## Enumeration Members ## Enumeration Members
### Command
**Command** = ``1``
**`Deprecated`**
Use PluginType.Init instead
#### Defined in
[src/handler/structures/enums.ts:112](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L112)
___
### Control ### Control
• **Control** = ``2`` • **Control** = ``2``
@@ -30,7 +44,21 @@ The PluginType for EventPlugins
#### Defined in #### Defined in
[src/core/structures/enums.ts:85](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L85) [src/handler/structures/enums.ts:121](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L121)
___
### Event
• **Event** = ``2``
**`Deprecated`**
Use PluginType.Control instead
#### Defined in
[src/handler/structures/enums.ts:117](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L117)
___ ___
@@ -42,4 +70,4 @@ The PluginType for InitPlugins
#### Defined in #### Defined in
[src/core/structures/enums.ts:81](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/structures/enums.ts#L81) [src/handler/structures/enums.ts:107](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/enums.ts#L107)

View File

@@ -17,7 +17,7 @@ This means it is undefined or an invalid command type was provided
#### Defined in #### Defined in
[src/handler/structures/errors.ts:9](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/structures/errors.ts#L9) [src/handler/structures/errors.ts:9](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/errors.ts#L9)
___ ___
@@ -29,7 +29,7 @@ A crash that occurs when accessing an invalid property of Context
#### Defined in #### Defined in
[src/handler/structures/errors.ts:29](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/structures/errors.ts#L29) [src/handler/structures/errors.ts:29](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/errors.ts#L29)
___ ___
@@ -41,7 +41,7 @@ Attempted to lookup module in command module store. Nothing was found!
#### Defined in #### Defined in
[src/handler/structures/errors.ts:17](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/structures/errors.ts#L17) [src/handler/structures/errors.ts:17](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/errors.ts#L17)
___ ___
@@ -53,7 +53,7 @@ Required Dependency not found
#### Defined in #### Defined in
[src/handler/structures/errors.ts:37](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/structures/errors.ts#L37) [src/handler/structures/errors.ts:37](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/errors.ts#L37)
___ ___
@@ -65,7 +65,7 @@ Unsupported interaction at this moment.
#### Defined in #### Defined in
[src/handler/structures/errors.ts:21](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/structures/errors.ts#L21) [src/handler/structures/errors.ts:21](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/errors.ts#L21)
___ ___
@@ -77,7 +77,7 @@ Unsupported feature attempted to access at this time
#### Defined in #### Defined in
[src/handler/structures/errors.ts:33](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/structures/errors.ts#L33) [src/handler/structures/errors.ts:33](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/errors.ts#L33)
___ ___
@@ -89,7 +89,7 @@ One plugin called `controller.stop()` (end command execution / loading)
#### Defined in #### Defined in
[src/handler/structures/errors.ts:25](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/structures/errors.ts#L25) [src/handler/structures/errors.ts:25](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/errors.ts#L25)
___ ___
@@ -101,4 +101,4 @@ Attempted to lookup module in command module store. Nothing was found!
#### Defined in #### Defined in
[src/handler/structures/errors.ts:13](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/structures/errors.ts#L13) [src/handler/structures/errors.ts:13](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/errors.ts#L13)

View File

@@ -11,7 +11,7 @@ custom_edit_url: null
</div> </div>
<h1 align="center">Handlers. Redefined.</h1> <h1 align="center">Handlers. Redefined.</h1>
<h4 align="center">A complete, customizable, typesafe, & reactive framework for discord bots</h4> <h4 align="center">A customizable, batteries-included, powerful discord.js framework to streamline bot development.</h4>
<div align="center" styles="margin-top: 10px"> <div align="center" styles="margin-top: 10px">
<img src="https://img.shields.io/badge/open-source-brightgreen" /> <img src="https://img.shields.io/badge/open-source-brightgreen" />
@@ -22,63 +22,90 @@ custom_edit_url: null
<img alt="Lines of code" src="https://img.shields.io/badge/total%20lines-2k-blue" /> <img alt="Lines of code" src="https://img.shields.io/badge/total%20lines-2k-blue" />
</div> </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 ## 📜 Installation
[Start here!!](https://sern.dev/docs/guide/walkthrough/new-project)
```sh
npm install @sern/handler
```
```sh
yarn add @sern/handler
```
```sh
pnpm add @sern/handler
```
## Why?
- Most handlers don't support discord.js 14.7+
- Customizable commands
- Plug and play or customize to your liking
- Embraces reactive programming for consistent and reliable backend
- Customizable logger, error handling, and more
- Active development and growing [community](https://sern.dev/discord)
## 👀 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
## 👶 Basic Usage ## 👶 Basic Usage
<details><summary>ping.ts</summary>
```ts #### ` index.js (CommonJS)`
export default commandModule({
type: CommandType.Slash, ```js
//Installed plugin to publish to discord api and allow access to owners only. // Import the discord.js Client and GatewayIntentBits
plugins: [publish(), ownerOnly()], 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
]
});
export const useContainer = Sern.makeDependencies({
build: root => root
.add({ '@sern/client': single(client) })
.add({ '@sern/logger': single(new DefaultLogging()) })
});
//View docs for all options
Sern.init({
defaultPrefix: '!', // removing defaultPrefix will shut down text commands
commands: 'src/commands',
// events: 'src/events' (optional),
containerConfig : {
get: useContainer
}
});
client.login(token);
```
#### ` ping.js (CommonJS)`
```js
const { CommandType, commandModule } = require('@sern/handler');
exports.default = commandModule({
name: 'ping',
description: 'A ping pong command', description: 'A ping pong command',
type: CommandType.Slash,
execute(ctx) { execute(ctx) {
ctx.reply('Hello owner of the bot'); ctx.reply('pong!');
} }
}); });
``` ```
</details>
<details><summary>modal.ts</summary>
```ts See our [templates](https://github.com/sern-handler/templates) for TypeScript examples and more.
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 ## 💻 CLI
@@ -90,6 +117,11 @@ It is **highly encouraged** to use the [command line interface](https://github.c
- [Support Server](https://sern.dev/discord) - [Support Server](https://sern.dev/discord)
## 👋 Contribute ## 👋 Contribute
- Read our contribution [guidelines](https://github.com/sern-handler/handler/blob/main/.github/CONTRIBUTING.md) 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 - Pull up on [issues](https://github.com/sern-handler/handler/issues) and report bugs
- All kinds of contributions are welcomed. - 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.

View File

@@ -38,7 +38,7 @@ Omit.execute
#### Defined in #### Defined in
[src/types/module.ts:111](https://github.com/sern-handler/handler/blob/c1f6906/src/types/module.ts#L111) [src/types/module.ts:111](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L111)
___ ___
@@ -52,4 +52,4 @@ Omit.onEvent
#### Defined in #### Defined in
[src/types/module.ts:110](https://github.com/sern-handler/handler/blob/c1f6906/src/types/module.ts#L110) [src/types/module.ts:110](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L110)

View File

@@ -8,7 +8,7 @@ custom_edit_url: null
## Hierarchy ## Hierarchy
- `Module` - [`Module`](Module.md)
**`BothCommand`** **`BothCommand`**
@@ -20,7 +20,7 @@ custom_edit_url: null
#### Defined in #### Defined in
[src/types/core-modules.ts:126](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L126) [src/types/module.ts:57](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L57)
___ ___
@@ -30,11 +30,11 @@ ___
#### Overrides #### Overrides
Module.description [Module](Module.md).[description](Module.md#description)
#### Defined in #### Defined in
[src/types/core-modules.ts:127](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L127) [src/types/module.ts:58](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L58)
___ ___
@@ -59,11 +59,11 @@ ___
#### Overrides #### Overrides
Module.execute [Module](Module.md).[execute](Module.md#execute)
#### Defined in #### Defined in
[src/types/core-modules.ts:129](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L129) [src/types/module.ts:60](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L60)
___ ___
@@ -73,11 +73,11 @@ ___
#### Inherited from #### Inherited from
Module.name [Module](Module.md).[name](Module.md#name)
#### Defined in #### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34) [src/types/module.ts:35](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L35)
___ ___
@@ -87,21 +87,21 @@ ___
#### Inherited from #### Inherited from
Module.onEvent [Module](Module.md).[onEvent](Module.md#onevent)
#### Defined in #### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35) [src/types/module.ts:36](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L36)
___ ___
### options ### options
`Optional` **options**: [`SernOptionsData`](../modules.md#sernoptionsdata)[] `Optional` **options**: ([`SernSubCommandData`](SernSubCommandData.md) \| [`SernSubCommandGroupData`](SernSubCommandGroupData.md) \| [`BaseOptions`](../modules.md#baseoptions))[]
#### Defined in #### Defined in
[src/types/core-modules.ts:128](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L128) [src/types/module.ts:59](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L59)
___ ___
@@ -111,11 +111,11 @@ ___
#### Inherited from #### Inherited from
Module.plugins [Module](Module.md).[plugins](Module.md#plugins)
#### Defined in #### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36) [src/types/module.ts:37](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L37)
___ ___
@@ -125,8 +125,8 @@ ___
#### Overrides #### Overrides
Module.type [Module](Module.md).[type](Module.md#type)
#### Defined in #### Defined in
[src/types/core-modules.ts:125](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L125) [src/types/module.ts:56](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L56)

View File

@@ -8,7 +8,7 @@ custom_edit_url: null
## Hierarchy ## Hierarchy
- `Module` - [`Module`](Module.md)
**`ButtonCommand`** **`ButtonCommand`**
@@ -20,11 +20,11 @@ custom_edit_url: null
#### Inherited from #### Inherited from
Module.description [Module](Module.md).[description](Module.md#description)
#### Defined in #### Defined in
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37) [src/types/module.ts:38](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L38)
___ ___
@@ -48,11 +48,11 @@ ___
#### Overrides #### Overrides
Module.execute [Module](Module.md).[execute](Module.md#execute)
#### Defined in #### Defined in
[src/types/core-modules.ts:66](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L66) [src/types/module.ts:75](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L75)
___ ___
@@ -62,11 +62,11 @@ ___
#### Inherited from #### Inherited from
Module.name [Module](Module.md).[name](Module.md#name)
#### Defined in #### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34) [src/types/module.ts:35](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L35)
___ ___
@@ -76,11 +76,11 @@ ___
#### Inherited from #### Inherited from
Module.onEvent [Module](Module.md).[onEvent](Module.md#onevent)
#### Defined in #### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35) [src/types/module.ts:36](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L36)
___ ___
@@ -90,11 +90,11 @@ ___
#### Inherited from #### Inherited from
Module.plugins [Module](Module.md).[plugins](Module.md#plugins)
#### Defined in #### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36) [src/types/module.ts:37](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L37)
___ ___
@@ -104,8 +104,8 @@ ___
#### Overrides #### Overrides
Module.type [Module](Module.md).[type](Module.md#type)
#### Defined in #### Defined in
[src/types/core-modules.ts:65](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L65) [src/types/module.ts:74](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L74)

View File

@@ -8,7 +8,7 @@ custom_edit_url: null
## Hierarchy ## Hierarchy
- `Module` - [`Module`](Module.md)
**`ChannelSelectCommand`** **`ChannelSelectCommand`**
@@ -20,11 +20,11 @@ custom_edit_url: null
#### Inherited from #### Inherited from
Module.description [Module](Module.md).[description](Module.md#description)
#### Defined in #### Defined in
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37) [src/types/module.ts:38](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L38)
___ ___
@@ -48,11 +48,11 @@ ___
#### Overrides #### Overrides
Module.execute [Module](Module.md).[execute](Module.md#execute)
#### Defined in #### Defined in
[src/types/core-modules.ts:76](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L76) [src/types/module.ts:85](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L85)
___ ___
@@ -62,11 +62,11 @@ ___
#### Inherited from #### Inherited from
Module.name [Module](Module.md).[name](Module.md#name)
#### Defined in #### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34) [src/types/module.ts:35](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L35)
___ ___
@@ -76,11 +76,11 @@ ___
#### Inherited from #### Inherited from
Module.onEvent [Module](Module.md).[onEvent](Module.md#onevent)
#### Defined in #### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35) [src/types/module.ts:36](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L36)
___ ___
@@ -90,11 +90,11 @@ ___
#### Inherited from #### Inherited from
Module.plugins [Module](Module.md).[plugins](Module.md#plugins)
#### Defined in #### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36) [src/types/module.ts:37](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L37)
___ ___
@@ -104,8 +104,8 @@ ___
#### Overrides #### Overrides
Module.type [Module](Module.md).[type](Module.md#type)
#### Defined in #### Defined in
[src/types/core-modules.ts:75](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L75) [src/types/module.ts:84](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L84)

View File

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

View File

@@ -1,127 +0,0 @@
---
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)

View File

@@ -24,7 +24,7 @@ Use the newer helper functions and import { controller } from '@sern/handler'
#### Defined in #### Defined in
[src/types/plugin.ts:51](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L51) [src/types/plugin.ts:51](https://github.com/sern-handler/handler/blob/33f1446/src/types/plugin.ts#L51)
___ ___
@@ -49,7 +49,7 @@ ___
#### Defined in #### Defined in
[src/types/plugin.ts:53](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L53) [src/types/plugin.ts:53](https://github.com/sern-handler/handler/blob/33f1446/src/types/plugin.ts#L53)
___ ___
@@ -59,7 +59,7 @@ ___
#### Defined in #### Defined in
[src/types/plugin.ts:50](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L50) [src/types/plugin.ts:50](https://github.com/sern-handler/handler/blob/33f1446/src/types/plugin.ts#L50)
___ ___
@@ -69,4 +69,4 @@ ___
#### Defined in #### Defined in
[src/types/plugin.ts:52](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L52) [src/types/plugin.ts:52](https://github.com/sern-handler/handler/blob/33f1446/src/types/plugin.ts#L52)

View File

@@ -8,7 +8,7 @@ custom_edit_url: null
## Hierarchy ## Hierarchy
- `Module` - [`Module`](Module.md)
**`ContextMenuMsg`** **`ContextMenuMsg`**
@@ -20,11 +20,11 @@ custom_edit_url: null
#### Inherited from #### Inherited from
Module.description [Module](Module.md).[description](Module.md#description)
#### Defined in #### Defined in
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37) [src/types/module.ts:38](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L38)
___ ___
@@ -48,11 +48,11 @@ ___
#### Overrides #### Overrides
Module.execute [Module](Module.md).[execute](Module.md#execute)
#### Defined in #### Defined in
[src/types/core-modules.ts:61](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L61) [src/types/module.ts:70](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L70)
___ ___
@@ -62,11 +62,11 @@ ___
#### Inherited from #### Inherited from
Module.name [Module](Module.md).[name](Module.md#name)
#### Defined in #### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34) [src/types/module.ts:35](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L35)
___ ___
@@ -76,11 +76,11 @@ ___
#### Inherited from #### Inherited from
Module.onEvent [Module](Module.md).[onEvent](Module.md#onevent)
#### Defined in #### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35) [src/types/module.ts:36](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L36)
___ ___
@@ -90,11 +90,11 @@ ___
#### Inherited from #### Inherited from
Module.plugins [Module](Module.md).[plugins](Module.md#plugins)
#### Defined in #### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36) [src/types/module.ts:37](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L37)
___ ___
@@ -104,8 +104,8 @@ ___
#### Overrides #### Overrides
Module.type [Module](Module.md).[type](Module.md#type)
#### Defined in #### Defined in
[src/types/core-modules.ts:60](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L60) [src/types/module.ts:69](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L69)

View File

@@ -8,7 +8,7 @@ custom_edit_url: null
## Hierarchy ## Hierarchy
- `Module` - [`Module`](Module.md)
**`ContextMenuUser`** **`ContextMenuUser`**
@@ -20,11 +20,11 @@ custom_edit_url: null
#### Inherited from #### Inherited from
Module.description [Module](Module.md).[description](Module.md#description)
#### Defined in #### Defined in
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37) [src/types/module.ts:38](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L38)
___ ___
@@ -48,11 +48,11 @@ ___
#### Overrides #### Overrides
Module.execute [Module](Module.md).[execute](Module.md#execute)
#### Defined in #### Defined in
[src/types/core-modules.ts:56](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L56) [src/types/module.ts:65](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L65)
___ ___
@@ -62,11 +62,11 @@ ___
#### Inherited from #### Inherited from
Module.name [Module](Module.md).[name](Module.md#name)
#### Defined in #### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34) [src/types/module.ts:35](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L35)
___ ___
@@ -76,11 +76,11 @@ ___
#### Inherited from #### Inherited from
Module.onEvent [Module](Module.md).[onEvent](Module.md#onevent)
#### Defined in #### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35) [src/types/module.ts:36](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L36)
___ ___
@@ -90,11 +90,11 @@ ___
#### Inherited from #### Inherited from
Module.plugins [Module](Module.md).[plugins](Module.md#plugins)
#### Defined in #### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36) [src/types/module.ts:37](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L37)
___ ___
@@ -104,8 +104,8 @@ ___
#### Overrides #### Overrides
Module.type [Module](Module.md).[type](Module.md#type)
#### Defined in #### Defined in
[src/types/core-modules.ts:55](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L55) [src/types/module.ts:64](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L64)

View File

@@ -20,7 +20,7 @@ custom_edit_url: null
#### Type declaration #### Type declaration
▸ (`...args`): [`PluginResult`](../modules.md#pluginresult) ▸ (...`args`): [`PluginResult`](../modules.md#pluginresult)
##### Parameters ##### Parameters
@@ -34,14 +34,14 @@ custom_edit_url: null
#### Defined in #### Defined in
[src/types/core-plugin.ts:73](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-plugin.ts#L73) [src/types/plugin.ts:39](https://github.com/sern-handler/handler/blob/33f1446/src/types/plugin.ts#L39)
___ ___
### type ### type
**type**: [`Control`](../enums/PluginType.md#control) **type**: [`Event`](../enums/PluginType.md#event)
#### Defined in #### Defined in
[src/types/core-plugin.ts:72](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-plugin.ts#L72) [src/types/plugin.ts:38](https://github.com/sern-handler/handler/blob/33f1446/src/types/plugin.ts#L38)

View File

@@ -22,7 +22,7 @@ custom_edit_url: null
#### Defined in #### Defined in
[src/types/core-plugin.ts:59](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-plugin.ts#L59) [src/types/plugin.ts:25](https://github.com/sern-handler/handler/blob/33f1446/src/types/plugin.ts#L25)
___ ___
@@ -40,4 +40,4 @@ ___
#### Defined in #### Defined in
[src/types/core-plugin.ts:60](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-plugin.ts#L60) [src/types/plugin.ts:26](https://github.com/sern-handler/handler/blob/33f1446/src/types/plugin.ts#L26)

View File

@@ -1,115 +0,0 @@
---
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)

View File

@@ -1,33 +0,0 @@
---
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)

View File

@@ -14,7 +14,7 @@ custom_edit_url: null
#### Defined in #### Defined in
[src/types/handler.ts:40](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L40) [src/types/handler.ts:40](https://github.com/sern-handler/handler/blob/33f1446/src/types/handler.ts#L40)
___ ___
@@ -24,7 +24,7 @@ ___
#### Defined in #### Defined in
[src/types/handler.ts:42](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L42) [src/types/handler.ts:42](https://github.com/sern-handler/handler/blob/33f1446/src/types/handler.ts#L42)
___ ___
@@ -34,7 +34,7 @@ ___
#### Defined in #### Defined in
[src/types/handler.ts:45](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L45) [src/types/handler.ts:45](https://github.com/sern-handler/handler/blob/33f1446/src/types/handler.ts#L45)
___ ___
@@ -44,7 +44,7 @@ ___
#### Defined in #### Defined in
[src/types/handler.ts:41](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L41) [src/types/handler.ts:41](https://github.com/sern-handler/handler/blob/33f1446/src/types/handler.ts#L41)
___ ___
@@ -54,7 +54,7 @@ ___
#### Defined in #### Defined in
[src/types/handler.ts:44](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L44) [src/types/handler.ts:44](https://github.com/sern-handler/handler/blob/33f1446/src/types/handler.ts#L44)
___ ___
@@ -64,4 +64,4 @@ ___
#### Defined in #### Defined in
[src/types/handler.ts:43](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L43) [src/types/handler.ts:43](https://github.com/sern-handler/handler/blob/33f1446/src/types/handler.ts#L43)

View File

@@ -34,7 +34,7 @@ custom_edit_url: null
#### Defined in #### Defined in
[src/types/handler.ts:68](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L68) [src/types/handler.ts:68](https://github.com/sern-handler/handler/blob/33f1446/src/types/handler.ts#L68)
___ ___
@@ -44,4 +44,4 @@ ___
#### Defined in #### Defined in
[src/types/handler.ts:67](https://github.com/sern-handler/handler/blob/c1f6906/src/types/handler.ts#L67) [src/types/handler.ts:67](https://github.com/sern-handler/handler/blob/33f1446/src/types/handler.ts#L67)

View File

@@ -14,7 +14,7 @@ custom_edit_url: null
## Hierarchy ## Hierarchy
- `Module` - [`Module`](Module.md)
**`DiscordEventCommand`** **`DiscordEventCommand`**
@@ -26,11 +26,11 @@ custom_edit_url: null
#### Inherited from #### Inherited from
Module.description [Module](Module.md).[description](Module.md#description)
#### Defined in #### Defined in
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37) [src/types/module.ts:38](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L38)
___ ___
@@ -40,11 +40,11 @@ ___
#### Overrides #### Overrides
Module.name [Module](Module.md).[name](Module.md#name)
#### Defined in #### Defined in
[src/types/core-modules.ts:107](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L107) [src/types/module.ts:123](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L123)
___ ___
@@ -54,11 +54,11 @@ ___
#### Inherited from #### Inherited from
Module.onEvent [Module](Module.md).[onEvent](Module.md#onevent)
#### Defined in #### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35) [src/types/module.ts:36](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L36)
___ ___
@@ -68,11 +68,11 @@ ___
#### Inherited from #### Inherited from
Module.plugins [Module](Module.md).[plugins](Module.md#plugins)
#### Defined in #### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36) [src/types/module.ts:37](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L37)
___ ___
@@ -82,17 +82,17 @@ ___
#### Overrides #### Overrides
Module.type [Module](Module.md).[type](Module.md#type)
#### Defined in #### Defined in
[src/types/core-modules.ts:108](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L108) [src/types/module.ts:124](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L124)
## Methods ## Methods
### execute ### execute
**execute**(`...args`): `unknown` **execute**(...`args`): `unknown`
#### Parameters #### Parameters
@@ -110,4 +110,4 @@ Module.execute
#### Defined in #### Defined in
[src/types/core-modules.ts:109](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L109) [src/types/module.ts:125](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L125)

View File

@@ -1,24 +0,0 @@
---
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)

View File

@@ -1,70 +0,0 @@
---
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)

View File

@@ -6,37 +6,43 @@ sidebar_position: 0
custom_edit_url: null custom_edit_url: null
--- ---
**`Since`**
2.0.0
## Implemented by ## Implemented by
- [`DefaultErrorHandling`](../classes/DefaultErrorHandling.md) - [`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:8](https://github.com/sern-handler/handler/blob/33f1446/src/handler/contracts/errorHandling.ts#L8)
## Methods ## Methods
### crash ### crash
**crash**(`err`): `never` **crash**(`error`): `never`
Utility function to crash
#### Parameters #### Parameters
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `err` | `Error` | | `error` | `Error` |
#### Returns #### Returns
`never` `never`
**`Deprecated`**
Version 4 will remove this method
#### Defined in #### Defined in
[src/core/contracts/error-handling.ts:11](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/error-handling.ts#L11) [src/handler/contracts/errorHandling.ts:14](https://github.com/sern-handler/handler/blob/33f1446/src/handler/contracts/errorHandling.ts#L14)
___ ___
@@ -44,7 +50,7 @@ ___
**updateAlive**(`error`): `void` **updateAlive**(`error`): `void`
A function that is called on every throw. A function that is called on every crash. Updates keepAlive
#### Parameters #### Parameters
@@ -58,4 +64,4 @@ A function that is called on every throw.
#### Defined in #### Defined in
[src/core/contracts/error-handling.ts:16](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/error-handling.ts#L16) [src/handler/contracts/errorHandling.ts:20](https://github.com/sern-handler/handler/blob/33f1446/src/handler/contracts/errorHandling.ts#L20)

View File

@@ -1,37 +0,0 @@
---
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)

View File

@@ -24,7 +24,7 @@ Use the newer helper functions
#### Defined in #### Defined in
[src/types/plugin.ts:64](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L64) [src/types/plugin.ts:61](https://github.com/sern-handler/handler/blob/33f1446/src/types/plugin.ts#L61)
___ ___
@@ -49,7 +49,7 @@ ___
#### Defined in #### Defined in
[src/types/plugin.ts:66](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L66) [src/types/plugin.ts:63](https://github.com/sern-handler/handler/blob/33f1446/src/types/plugin.ts#L63)
___ ___
@@ -59,7 +59,7 @@ ___
#### Defined in #### Defined in
[src/types/plugin.ts:63](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L63) [src/types/plugin.ts:60](https://github.com/sern-handler/handler/blob/33f1446/src/types/plugin.ts#L60)
___ ___
@@ -69,4 +69,4 @@ ___
#### Defined in #### Defined in
[src/types/plugin.ts:65](https://github.com/sern-handler/handler/blob/c1f6906/src/types/plugin.ts#L65) [src/types/plugin.ts:62](https://github.com/sern-handler/handler/blob/33f1446/src/types/plugin.ts#L62)

View File

@@ -8,7 +8,7 @@ custom_edit_url: null
## Hierarchy ## Hierarchy
- `Module` - [`Module`](Module.md)
**`ExternalEventCommand`** **`ExternalEventCommand`**
@@ -20,21 +20,21 @@ custom_edit_url: null
#### Inherited from #### Inherited from
Module.description [Module](Module.md).[description](Module.md#description)
#### Defined in #### Defined in
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37) [src/types/module.ts:38](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L38)
___ ___
### emitter ### emitter
**emitter**: keyof `Dependencies` **emitter**: `string`
#### Defined in #### Defined in
[src/types/core-modules.ts:49](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L49) [src/types/module.ts:130](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L130)
___ ___
@@ -44,11 +44,11 @@ ___
#### Overrides #### Overrides
Module.name [Module](Module.md).[name](Module.md#name)
#### Defined in #### Defined in
[src/types/core-modules.ts:48](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L48) [src/types/module.ts:129](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L129)
___ ___
@@ -58,11 +58,11 @@ ___
#### Inherited from #### Inherited from
Module.onEvent [Module](Module.md).[onEvent](Module.md#onevent)
#### Defined in #### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35) [src/types/module.ts:36](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L36)
___ ___
@@ -72,11 +72,11 @@ ___
#### Inherited from #### Inherited from
Module.plugins [Module](Module.md).[plugins](Module.md#plugins)
#### Defined in #### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36) [src/types/module.ts:37](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L37)
___ ___
@@ -86,17 +86,17 @@ ___
#### Overrides #### Overrides
Module.type [Module](Module.md).[type](Module.md#type)
#### Defined in #### Defined in
[src/types/core-modules.ts:50](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L50) [src/types/module.ts:131](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L131)
## Methods ## Methods
### execute ### execute
**execute**(`...args`): `unknown` **execute**(...`args`): `unknown`
#### Parameters #### Parameters
@@ -114,4 +114,4 @@ Module.execute
#### Defined in #### Defined in
[src/types/core-modules.ts:51](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L51) [src/types/module.ts:132](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L132)

View File

@@ -1,24 +0,0 @@
---
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)

View File

@@ -20,7 +20,7 @@ custom_edit_url: null
#### Defined in #### Defined in
[src/handler/plugins/args.ts:107](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/plugins/args.ts#L107) [src/handler/plugins/args.ts:106](https://github.com/sern-handler/handler/blob/33f1446/src/handler/plugins/args.ts#L106)
___ ___
@@ -30,4 +30,4 @@ ___
#### Defined in #### Defined in
[src/handler/plugins/args.ts:106](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/plugins/args.ts#L106) [src/handler/plugins/args.ts:105](https://github.com/sern-handler/handler/blob/33f1446/src/handler/plugins/args.ts#L105)

View File

@@ -20,7 +20,7 @@ custom_edit_url: null
#### Type declaration #### Type declaration
▸ (`...args`): [`PluginResult`](../modules.md#pluginresult) ▸ (...`args`): [`PluginResult`](../modules.md#pluginresult)
##### Parameters ##### Parameters
@@ -34,7 +34,7 @@ custom_edit_url: null
#### Defined in #### Defined in
[src/types/core-plugin.ts:69](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-plugin.ts#L69) [src/types/plugin.ts:35](https://github.com/sern-handler/handler/blob/33f1446/src/types/plugin.ts#L35)
___ ___
@@ -44,4 +44,4 @@ ___
#### Defined in #### Defined in
[src/types/core-plugin.ts:68](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-plugin.ts#L68) [src/types/plugin.ts:34](https://github.com/sern-handler/handler/blob/33f1446/src/types/plugin.ts#L34)

View File

@@ -6,10 +6,6 @@ sidebar_position: 0
custom_edit_url: null custom_edit_url: null
--- ---
**`Since`**
2.0.0
## Type parameters ## Type parameters
| Name | Type | | Name | Type |
@@ -38,7 +34,7 @@ custom_edit_url: null
#### Defined in #### Defined in
[src/core/contracts/logging.ts:8](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/logging.ts#L8) [src/handler/contracts/logging.ts:7](https://github.com/sern-handler/handler/blob/33f1446/src/handler/contracts/logging.ts#L7)
___ ___
@@ -58,7 +54,7 @@ ___
#### Defined in #### Defined in
[src/core/contracts/logging.ts:5](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/logging.ts#L5) [src/handler/contracts/logging.ts:4](https://github.com/sern-handler/handler/blob/33f1446/src/handler/contracts/logging.ts#L4)
___ ___
@@ -78,7 +74,7 @@ ___
#### Defined in #### Defined in
[src/core/contracts/logging.ts:7](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/logging.ts#L7) [src/handler/contracts/logging.ts:6](https://github.com/sern-handler/handler/blob/33f1446/src/handler/contracts/logging.ts#L6)
___ ___
@@ -98,4 +94,4 @@ ___
#### Defined in #### Defined in
[src/core/contracts/logging.ts:6](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/logging.ts#L6) [src/handler/contracts/logging.ts:5](https://github.com/sern-handler/handler/blob/33f1446/src/handler/contracts/logging.ts#L5)

View File

@@ -8,7 +8,7 @@ custom_edit_url: null
## Hierarchy ## Hierarchy
- `Module` - [`Module`](Module.md)
**`MentionableSelectCommand`** **`MentionableSelectCommand`**
@@ -20,11 +20,11 @@ custom_edit_url: null
#### Inherited from #### Inherited from
Module.description [Module](Module.md).[description](Module.md#description)
#### Defined in #### Defined in
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37) [src/types/module.ts:38](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L38)
___ ___
@@ -48,11 +48,11 @@ ___
#### Overrides #### Overrides
Module.execute [Module](Module.md).[execute](Module.md#execute)
#### Defined in #### Defined in
[src/types/core-modules.ts:86](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L86) [src/types/module.ts:95](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L95)
___ ___
@@ -62,11 +62,11 @@ ___
#### Inherited from #### Inherited from
Module.name [Module](Module.md).[name](Module.md#name)
#### Defined in #### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34) [src/types/module.ts:35](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L35)
___ ___
@@ -76,11 +76,11 @@ ___
#### Inherited from #### Inherited from
Module.onEvent [Module](Module.md).[onEvent](Module.md#onevent)
#### Defined in #### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35) [src/types/module.ts:36](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L36)
___ ___
@@ -90,11 +90,11 @@ ___
#### Inherited from #### Inherited from
Module.plugins [Module](Module.md).[plugins](Module.md#plugins)
#### Defined in #### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36) [src/types/module.ts:37](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L37)
___ ___
@@ -104,8 +104,8 @@ ___
#### Overrides #### Overrides
Module.type [Module](Module.md).[type](Module.md#type)
#### Defined in #### Defined in
[src/types/core-modules.ts:85](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L85) [src/types/module.ts:94](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L94)

View File

@@ -8,7 +8,7 @@ custom_edit_url: null
## Hierarchy ## Hierarchy
- `Module` - [`Module`](Module.md)
**`ModalSubmitCommand`** **`ModalSubmitCommand`**
@@ -20,11 +20,11 @@ custom_edit_url: null
#### Inherited from #### Inherited from
Module.description [Module](Module.md).[description](Module.md#description)
#### Defined in #### Defined in
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37) [src/types/module.ts:38](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L38)
___ ___
@@ -48,11 +48,11 @@ ___
#### Overrides #### Overrides
Module.execute [Module](Module.md).[execute](Module.md#execute)
#### Defined in #### Defined in
[src/types/core-modules.ts:96](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L96) [src/types/module.ts:105](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L105)
___ ___
@@ -62,11 +62,11 @@ ___
#### Inherited from #### Inherited from
Module.name [Module](Module.md).[name](Module.md#name)
#### Defined in #### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34) [src/types/module.ts:35](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L35)
___ ___
@@ -76,11 +76,11 @@ ___
#### Inherited from #### Inherited from
Module.onEvent [Module](Module.md).[onEvent](Module.md#onevent)
#### Defined in #### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35) [src/types/module.ts:36](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L36)
___ ___
@@ -90,11 +90,11 @@ ___
#### Inherited from #### Inherited from
Module.plugins [Module](Module.md).[plugins](Module.md#plugins)
#### Defined in #### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36) [src/types/module.ts:37](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L37)
___ ___
@@ -104,8 +104,8 @@ ___
#### Overrides #### Overrides
Module.type [Module](Module.md).[type](Module.md#type)
#### Defined in #### Defined in
[src/types/core-modules.ts:95](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L95) [src/types/module.ts:104](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L104)

View File

@@ -48,7 +48,7 @@ custom_edit_url: null
#### Defined in #### Defined in
[src/types/module.ts:38](https://github.com/sern-handler/handler/blob/c1f6906/src/types/module.ts#L38) [src/types/module.ts:38](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L38)
___ ___
@@ -72,7 +72,7 @@ ___
#### Defined in #### Defined in
[src/types/module.ts:39](https://github.com/sern-handler/handler/blob/c1f6906/src/types/module.ts#L39) [src/types/module.ts:39](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L39)
___ ___
@@ -82,7 +82,7 @@ ___
#### Defined in #### Defined in
[src/types/module.ts:35](https://github.com/sern-handler/handler/blob/c1f6906/src/types/module.ts#L35) [src/types/module.ts:35](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L35)
___ ___
@@ -92,7 +92,7 @@ ___
#### Defined in #### Defined in
[src/types/module.ts:36](https://github.com/sern-handler/handler/blob/c1f6906/src/types/module.ts#L36) [src/types/module.ts:36](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L36)
___ ___
@@ -102,7 +102,7 @@ ___
#### Defined in #### Defined in
[src/types/module.ts:37](https://github.com/sern-handler/handler/blob/c1f6906/src/types/module.ts#L37) [src/types/module.ts:37](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L37)
___ ___
@@ -112,4 +112,4 @@ ___
#### Defined in #### Defined in
[src/types/module.ts:34](https://github.com/sern-handler/handler/blob/c1f6906/src/types/module.ts#L34) [src/types/module.ts:34](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L34)

View File

@@ -6,17 +6,6 @@ sidebar_position: 0
custom_edit_url: null 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 ## Implemented by
- [`DefaultModuleManager`](../classes/DefaultModuleManager.md) - [`DefaultModuleManager`](../classes/DefaultModuleManager.md)
@@ -25,27 +14,7 @@ custom_edit_url: null
### get ### get
**get**(`id`): `undefined` \| `string` **get**<`T`\>(`strat`): `undefined` \| [`CommandModuleDefs`](../modules.md#commandmoduledefs)[`T`]
#### 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 #### Type parameters
@@ -57,67 +26,27 @@ ___
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `name` | `string` | | `strat` | (`ms`: [`ModuleStore`](../classes/ModuleStore.md)) => `undefined` \| [`Processed`](../modules.md#processed)<[`CommandModuleDefs`](../modules.md#commandmoduledefs)[`T`]\> |
| `commandType` | `T` |
#### Returns #### Returns
`undefined` \| `Promise`<[`CommandModuleDefs`](CommandModuleDefs.md)[`T`]\> `undefined` \| [`CommandModuleDefs`](../modules.md#commandmoduledefs)[`T`]
#### Defined in #### Defined in
[src/core/contracts/module-manager.ts:23](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/module-manager.ts#L23) [src/handler/contracts/moduleManager.ts:6](https://github.com/sern-handler/handler/blob/33f1446/src/handler/contracts/moduleManager.ts#L6)
___
### getMetadata
**getMetadata**(`m`): `undefined` \| `CommandMeta`
#### Parameters
| Name | Type |
| :------ | :------ |
| `m` | `Module` |
#### Returns
`undefined` \| `CommandMeta`
#### Inherited from
MetadataAccess.getMetadata
#### Defined in
[src/core/contracts/module-manager.ts:10](https://github.com/sern-handler/handler/blob/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
**set**(`id`, `path`): `void` **set**(`strat`): `void`
#### Parameters #### Parameters
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `id` | `string` | | `strat` | (`ms`: [`ModuleStore`](../classes/ModuleStore.md)) => `void` |
| `path` | `string` |
#### Returns #### Returns
@@ -125,29 +54,4 @@ ___
#### Defined in #### Defined in
[src/core/contracts/module-manager.ts:21](https://github.com/sern-handler/handler/blob/9d5c6c7/src/core/contracts/module-manager.ts#L21) [src/handler/contracts/moduleManager.ts:9](https://github.com/sern-handler/handler/blob/33f1446/src/handler/contracts/moduleManager.ts#L9)
___
### 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)

View File

@@ -20,7 +20,7 @@ custom_edit_url: null
#### Type declaration #### Type declaration
▸ (`...args`): [`PluginResult`](../modules.md#pluginresult) ▸ (...`args`): [`PluginResult`](../modules.md#pluginresult)
##### Parameters ##### Parameters
@@ -34,7 +34,7 @@ custom_edit_url: null
#### Defined in #### Defined in
[src/types/core-plugin.ts:64](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-plugin.ts#L64) [src/types/plugin.ts:30](https://github.com/sern-handler/handler/blob/33f1446/src/types/plugin.ts#L30)
___ ___
@@ -44,4 +44,4 @@ ___
#### Defined in #### Defined in
[src/types/core-plugin.ts:63](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-plugin.ts#L63) [src/types/plugin.ts:29](https://github.com/sern-handler/handler/blob/33f1446/src/types/plugin.ts#L29)

View File

@@ -1,82 +0,0 @@
---
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)

View File

@@ -8,7 +8,7 @@ custom_edit_url: null
## Hierarchy ## Hierarchy
- `Module` - [`Module`](Module.md)
**`RoleSelectCommand`** **`RoleSelectCommand`**
@@ -20,11 +20,11 @@ custom_edit_url: null
#### Inherited from #### Inherited from
Module.description [Module](Module.md).[description](Module.md#description)
#### Defined in #### Defined in
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37) [src/types/module.ts:38](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L38)
___ ___
@@ -48,11 +48,11 @@ ___
#### Overrides #### Overrides
Module.execute [Module](Module.md).[execute](Module.md#execute)
#### Defined in #### Defined in
[src/types/core-modules.ts:81](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L81) [src/types/module.ts:90](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L90)
___ ___
@@ -62,11 +62,11 @@ ___
#### Inherited from #### Inherited from
Module.name [Module](Module.md).[name](Module.md#name)
#### Defined in #### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34) [src/types/module.ts:35](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L35)
___ ___
@@ -76,11 +76,11 @@ ___
#### Inherited from #### Inherited from
Module.onEvent [Module](Module.md).[onEvent](Module.md#onevent)
#### Defined in #### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35) [src/types/module.ts:36](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L36)
___ ___
@@ -90,11 +90,11 @@ ___
#### Inherited from #### Inherited from
Module.plugins [Module](Module.md).[plugins](Module.md#plugins)
#### Defined in #### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36) [src/types/module.ts:37](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L37)
___ ___
@@ -104,8 +104,8 @@ ___
#### Overrides #### Overrides
Module.type [Module](Module.md).[type](Module.md#type)
#### Defined in #### Defined in
[src/types/core-modules.ts:80](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L80) [src/types/module.ts:89](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L89)

View File

@@ -20,17 +20,17 @@ custom_edit_url: null
#### Defined in #### Defined in
[src/types/core-modules.ts:173](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L173) [src/types/module.ts:177](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L177)
___ ___
### command ### command
• **command**: `AutocompleteCommand` • **command**: [`AutocompleteCommand`](AutocompleteCommand.md)
#### Defined in #### Defined in
[src/types/core-modules.ts:178](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L178) [src/types/module.ts:182](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L182)
___ ___
@@ -44,7 +44,7 @@ Omit.description
#### Defined in #### Defined in
node_modules/discord.js/typings/index.d.ts:4493 node_modules/.pnpm/discord.js@14.7.1/node_modules/discord.js/typings/index.d.ts:4200
___ ___
@@ -58,7 +58,7 @@ Omit.descriptionLocalizations
#### Defined in #### Defined in
node_modules/discord.js/typings/index.d.ts:4494 node_modules/.pnpm/discord.js@14.7.1/node_modules/discord.js/typings/index.d.ts:4201
___ ___
@@ -72,7 +72,7 @@ Omit.name
#### Defined in #### Defined in
node_modules/discord.js/typings/index.d.ts:4491 node_modules/.pnpm/discord.js@14.7.1/node_modules/discord.js/typings/index.d.ts:4198
___ ___
@@ -86,7 +86,7 @@ Omit.nameLocalizations
#### Defined in #### Defined in
node_modules/discord.js/typings/index.d.ts:4492 node_modules/.pnpm/discord.js@14.7.1/node_modules/discord.js/typings/index.d.ts:4199
___ ___
@@ -100,7 +100,7 @@ Omit.required
#### Defined in #### Defined in
node_modules/discord.js/typings/index.d.ts:4495 node_modules/.pnpm/discord.js@14.7.1/node_modules/discord.js/typings/index.d.ts:4202
___ ___
@@ -110,4 +110,4 @@ ___
#### Defined in #### Defined in
[src/types/core-modules.ts:174](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L174) [src/types/module.ts:178](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L178)

View File

@@ -10,11 +10,11 @@ custom_edit_url: null
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `T` | extends keyof [`SernEventsMapping`](SernEventsMapping.md) = keyof [`SernEventsMapping`](SernEventsMapping.md) | | `T` | extends keyof [`SernEventsMapping`](../modules.md#serneventsmapping) = keyof [`SernEventsMapping`](../modules.md#serneventsmapping) |
## Hierarchy ## Hierarchy
- `Module` - [`Module`](Module.md)
**`SernEventCommand`** **`SernEventCommand`**
@@ -26,11 +26,11 @@ custom_edit_url: null
#### Inherited from #### Inherited from
Module.description [Module](Module.md).[description](Module.md#description)
#### Defined in #### Defined in
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37) [src/types/module.ts:38](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L38)
___ ___
@@ -40,11 +40,11 @@ ___
#### Overrides #### Overrides
Module.name [Module](Module.md).[name](Module.md#name)
#### Defined in #### Defined in
[src/types/core-modules.ts:43](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L43) [src/types/module.ts:116](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L116)
___ ___
@@ -54,11 +54,11 @@ ___
#### Inherited from #### Inherited from
Module.onEvent [Module](Module.md).[onEvent](Module.md#onevent)
#### Defined in #### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35) [src/types/module.ts:36](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L36)
___ ___
@@ -68,11 +68,11 @@ ___
#### Inherited from #### Inherited from
Module.plugins [Module](Module.md).[plugins](Module.md#plugins)
#### Defined in #### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36) [src/types/module.ts:37](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L37)
___ ___
@@ -82,23 +82,23 @@ ___
#### Overrides #### Overrides
Module.type [Module](Module.md).[type](Module.md#type)
#### Defined in #### Defined in
[src/types/core-modules.ts:44](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L44) [src/types/module.ts:117](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L117)
## Methods ## Methods
### execute ### execute
**execute**(`...args`): `unknown` **execute**(...`args`): `unknown`
#### Parameters #### Parameters
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `...args` | [`SernEventsMapping`](SernEventsMapping.md)[`T`] | | `...args` | [`SernEventsMapping`](../modules.md#serneventsmapping)[`T`] |
#### Returns #### Returns
@@ -110,4 +110,4 @@ Module.execute
#### Defined in #### Defined in
[src/types/core-modules.ts:45](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L45) [src/types/module.ts:118](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L118)

View File

@@ -1,57 +0,0 @@
---
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)

View File

@@ -8,37 +8,51 @@ custom_edit_url: null
## Hierarchy ## Hierarchy
- `APIApplicationCommandOptionBase`<`ApplicationCommandOptionType.Subcommand`\> - `BaseApplicationCommandOptionsData`
**`SernSubCommandData`** **`SernSubCommandData`**
## Properties ## Properties
### autocomplete
`Optional` **autocomplete**: `undefined`
#### Inherited from
BaseApplicationCommandOptionsData.autocomplete
#### Defined in
node_modules/.pnpm/discord.js@14.7.1/node_modules/discord.js/typings/index.d.ts:4203
___
### description ### description
**description**: `string` **description**: `string`
#### Inherited from #### Inherited from
APIApplicationCommandOptionBase.description BaseApplicationCommandOptionsData.description
#### Defined in #### Defined in
node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.d.ts:7 node_modules/.pnpm/discord.js@14.7.1/node_modules/discord.js/typings/index.d.ts:4200
___ ___
### description\_localizations ### descriptionLocalizations
`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`\>\> `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 #### Inherited from
APIApplicationCommandOptionBase.description\_localizations BaseApplicationCommandOptionsData.descriptionLocalizations
#### Defined in #### Defined in
node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.d.ts:8 node_modules/.pnpm/discord.js@14.7.1/node_modules/discord.js/typings/index.d.ts:4201
___ ___
@@ -48,49 +62,49 @@ ___
#### Inherited from #### Inherited from
APIApplicationCommandOptionBase.name BaseApplicationCommandOptionsData.name
#### Defined in #### Defined in
node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.d.ts:5 node_modules/.pnpm/discord.js@14.7.1/node_modules/discord.js/typings/index.d.ts:4198
___ ___
### name\_localizations ### nameLocalizations
• `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`\>\> • `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 #### Inherited from
APIApplicationCommandOptionBase.name\_localizations BaseApplicationCommandOptionsData.nameLocalizations
#### Defined in #### Defined in
node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.d.ts:6 node_modules/.pnpm/discord.js@14.7.1/node_modules/discord.js/typings/index.d.ts:4199
___ ___
### options ### options
• `Optional` **options**: [`SernOptionsData`](../modules.md#sernoptionsdata)[] • `Optional` **options**: [`BaseOptions`](../modules.md#baseoptions)[]
#### Defined in #### Defined in
[src/types/core-modules.ts:210](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L210) [src/types/module.ts:214](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L214)
___ ___
### required ### required
• `Optional` **required**: `boolean` • `Optional` **required**: `undefined`
#### Inherited from #### Overrides
APIApplicationCommandOptionBase.required BaseApplicationCommandOptionsData.required
#### Defined in #### Defined in
node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base.d.ts:9 [src/types/module.ts:213](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L213)
___ ___
@@ -98,10 +112,6 @@ ___
• **type**: `Subcommand` • **type**: `Subcommand`
#### Overrides
APIApplicationCommandOptionBase.type
#### Defined in #### Defined in
[src/types/core-modules.ts:209](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L209) [src/types/module.ts:212](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L212)

View File

@@ -24,7 +24,7 @@ BaseApplicationCommandOptionsData.autocomplete
#### Defined in #### Defined in
node_modules/discord.js/typings/index.d.ts:4496 node_modules/.pnpm/discord.js@14.7.1/node_modules/discord.js/typings/index.d.ts:4203
___ ___
@@ -38,7 +38,7 @@ BaseApplicationCommandOptionsData.description
#### Defined in #### Defined in
node_modules/discord.js/typings/index.d.ts:4493 node_modules/.pnpm/discord.js@14.7.1/node_modules/discord.js/typings/index.d.ts:4200
___ ___
@@ -52,7 +52,7 @@ BaseApplicationCommandOptionsData.descriptionLocalizations
#### Defined in #### Defined in
node_modules/discord.js/typings/index.d.ts:4494 node_modules/.pnpm/discord.js@14.7.1/node_modules/discord.js/typings/index.d.ts:4201
___ ___
@@ -66,7 +66,7 @@ BaseApplicationCommandOptionsData.name
#### Defined in #### Defined in
node_modules/discord.js/typings/index.d.ts:4491 node_modules/.pnpm/discord.js@14.7.1/node_modules/discord.js/typings/index.d.ts:4198
___ ___
@@ -80,7 +80,7 @@ BaseApplicationCommandOptionsData.nameLocalizations
#### Defined in #### Defined in
node_modules/discord.js/typings/index.d.ts:4492 node_modules/.pnpm/discord.js@14.7.1/node_modules/discord.js/typings/index.d.ts:4199
___ ___
@@ -90,21 +90,21 @@ ___
#### Defined in #### Defined in
[src/types/core-modules.ts:215](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L215) [src/types/module.ts:220](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L220)
___ ___
### required ### required
• `Optional` **required**: `boolean` • `Optional` **required**: `undefined`
#### Inherited from #### Overrides
BaseApplicationCommandOptionsData.required BaseApplicationCommandOptionsData.required
#### Defined in #### Defined in
node_modules/discord.js/typings/index.d.ts:4495 [src/types/module.ts:219](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L219)
___ ___
@@ -114,4 +114,4 @@ ___
#### Defined in #### Defined in
[src/types/core-modules.ts:214](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L214) [src/types/module.ts:218](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L218)

View File

@@ -8,7 +8,7 @@ custom_edit_url: null
## Hierarchy ## Hierarchy
- `Module` - [`Module`](Module.md)
**`SlashCommand`** **`SlashCommand`**
@@ -20,11 +20,11 @@ custom_edit_url: null
#### Overrides #### Overrides
Module.description [Module](Module.md).[description](Module.md#description)
#### Defined in #### Defined in
[src/types/core-modules.ts:119](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L119) [src/types/module.ts:50](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L50)
___ ___
@@ -49,11 +49,11 @@ ___
#### Overrides #### Overrides
Module.execute [Module](Module.md).[execute](Module.md#execute)
#### Defined in #### Defined in
[src/types/core-modules.ts:121](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L121) [src/types/module.ts:52](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L52)
___ ___
@@ -63,11 +63,11 @@ ___
#### Inherited from #### Inherited from
Module.name [Module](Module.md).[name](Module.md#name)
#### Defined in #### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34) [src/types/module.ts:35](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L35)
___ ___
@@ -77,21 +77,21 @@ ___
#### Inherited from #### Inherited from
Module.onEvent [Module](Module.md).[onEvent](Module.md#onevent)
#### Defined in #### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35) [src/types/module.ts:36](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L36)
___ ___
### options ### options
`Optional` **options**: [`SernOptionsData`](../modules.md#sernoptionsdata)[] `Optional` **options**: ([`SernSubCommandData`](SernSubCommandData.md) \| [`SernSubCommandGroupData`](SernSubCommandGroupData.md) \| [`BaseOptions`](../modules.md#baseoptions))[]
#### Defined in #### Defined in
[src/types/core-modules.ts:120](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L120) [src/types/module.ts:51](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L51)
___ ___
@@ -101,11 +101,11 @@ ___
#### Inherited from #### Inherited from
Module.plugins [Module](Module.md).[plugins](Module.md#plugins)
#### Defined in #### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36) [src/types/module.ts:37](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L37)
___ ___
@@ -115,8 +115,8 @@ ___
#### Overrides #### Overrides
Module.type [Module](Module.md).[type](Module.md#type)
#### Defined in #### Defined in
[src/types/core-modules.ts:118](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L118) [src/types/module.ts:49](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L49)

View File

@@ -8,7 +8,7 @@ custom_edit_url: null
## Hierarchy ## Hierarchy
- `Module` - [`Module`](Module.md)
**`StringSelectCommand`** **`StringSelectCommand`**
@@ -20,11 +20,11 @@ custom_edit_url: null
#### Inherited from #### Inherited from
Module.description [Module](Module.md).[description](Module.md#description)
#### Defined in #### Defined in
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37) [src/types/module.ts:38](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L38)
___ ___
@@ -48,11 +48,11 @@ ___
#### Overrides #### Overrides
Module.execute [Module](Module.md).[execute](Module.md#execute)
#### Defined in #### Defined in
[src/types/core-modules.ts:71](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L71) [src/types/module.ts:80](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L80)
___ ___
@@ -62,11 +62,11 @@ ___
#### Inherited from #### Inherited from
Module.name [Module](Module.md).[name](Module.md#name)
#### Defined in #### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34) [src/types/module.ts:35](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L35)
___ ___
@@ -76,11 +76,11 @@ ___
#### Inherited from #### Inherited from
Module.onEvent [Module](Module.md).[onEvent](Module.md#onevent)
#### Defined in #### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35) [src/types/module.ts:36](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L36)
___ ___
@@ -90,11 +90,11 @@ ___
#### Inherited from #### Inherited from
Module.plugins [Module](Module.md).[plugins](Module.md#plugins)
#### Defined in #### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36) [src/types/module.ts:37](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L37)
___ ___
@@ -104,8 +104,8 @@ ___
#### Overrides #### Overrides
Module.type [Module](Module.md).[type](Module.md#type)
#### Defined in #### Defined in
[src/types/core-modules.ts:70](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L70) [src/types/module.ts:79](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L79)

View File

@@ -8,7 +8,7 @@ custom_edit_url: null
## Hierarchy ## Hierarchy
- `Module` - [`Module`](Module.md)
**`TextCommand`** **`TextCommand`**
@@ -20,7 +20,7 @@ custom_edit_url: null
#### Defined in #### Defined in
[src/types/core-modules.ts:113](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L113) [src/types/module.ts:44](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L44)
___ ___
@@ -30,11 +30,11 @@ ___
#### Inherited from #### Inherited from
Module.description [Module](Module.md).[description](Module.md#description)
#### Defined in #### Defined in
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37) [src/types/module.ts:38](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L38)
___ ___
@@ -59,11 +59,11 @@ ___
#### Overrides #### Overrides
Module.execute [Module](Module.md).[execute](Module.md#execute)
#### Defined in #### Defined in
[src/types/core-modules.ts:114](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L114) [src/types/module.ts:45](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L45)
___ ___
@@ -73,11 +73,11 @@ ___
#### Inherited from #### Inherited from
Module.name [Module](Module.md).[name](Module.md#name)
#### Defined in #### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34) [src/types/module.ts:35](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L35)
___ ___
@@ -87,11 +87,11 @@ ___
#### Inherited from #### Inherited from
Module.onEvent [Module](Module.md).[onEvent](Module.md#onevent)
#### Defined in #### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35) [src/types/module.ts:36](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L36)
___ ___
@@ -101,11 +101,11 @@ ___
#### Inherited from #### Inherited from
Module.plugins [Module](Module.md).[plugins](Module.md#plugins)
#### Defined in #### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36) [src/types/module.ts:37](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L37)
___ ___
@@ -115,8 +115,8 @@ ___
#### Overrides #### Overrides
Module.type [Module](Module.md).[type](Module.md#type)
#### Defined in #### Defined in
[src/types/core-modules.ts:112](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L112) [src/types/module.ts:43](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L43)

View File

@@ -8,7 +8,7 @@ custom_edit_url: null
## Hierarchy ## Hierarchy
- `Module` - [`Module`](Module.md)
**`UserSelectCommand`** **`UserSelectCommand`**
@@ -20,11 +20,11 @@ custom_edit_url: null
#### Inherited from #### Inherited from
Module.description [Module](Module.md).[description](Module.md#description)
#### Defined in #### Defined in
[src/types/core-modules.ts:37](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L37) [src/types/module.ts:38](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L38)
___ ___
@@ -48,11 +48,11 @@ ___
#### Overrides #### Overrides
Module.execute [Module](Module.md).[execute](Module.md#execute)
#### Defined in #### Defined in
[src/types/core-modules.ts:91](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L91) [src/types/module.ts:100](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L100)
___ ___
@@ -62,11 +62,11 @@ ___
#### Inherited from #### Inherited from
Module.name [Module](Module.md).[name](Module.md#name)
#### Defined in #### Defined in
[src/types/core-modules.ts:34](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L34) [src/types/module.ts:35](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L35)
___ ___
@@ -76,11 +76,11 @@ ___
#### Inherited from #### Inherited from
Module.onEvent [Module](Module.md).[onEvent](Module.md#onevent)
#### Defined in #### Defined in
[src/types/core-modules.ts:35](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L35) [src/types/module.ts:36](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L36)
___ ___
@@ -90,11 +90,11 @@ ___
#### Inherited from #### Inherited from
Module.plugins [Module](Module.md).[plugins](Module.md#plugins)
#### Defined in #### Defined in
[src/types/core-modules.ts:36](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L36) [src/types/module.ts:37](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L37)
___ ___
@@ -104,8 +104,8 @@ ___
#### Overrides #### Overrides
Module.type [Module](Module.md).[type](Module.md#type)
#### Defined in #### Defined in
[src/types/core-modules.ts:90](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core-modules.ts#L90) [src/types/module.ts:99](https://github.com/sern-handler/handler/blob/33f1446/src/types/module.ts#L99)

View File

@@ -6,64 +6,50 @@ sidebar_position: 0
custom_edit_url: null custom_edit_url: null
--- ---
An object to be passed into Sern#init() function.
## Properties ## Properties
### commands ### commands
**commands**: `string` `Readonly` **commands**: `string`
#### Defined in #### Defined in
[src/types/core.ts:9](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core.ts#L9) [src/handler/structures/wrapper.ts:9](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/wrapper.ts#L9)
___ ___
### containerConfig ### containerConfig
`Optional` **containerConfig**: `Object` `Readonly` **containerConfig**: `Object`
#### Type declaration #### Type declaration
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `get` | (...`keys`: keyof `Dependencies`[]) => `unknown`[] | | `get` | (...`keys`: keyof [`Dependencies`](Dependencies.md)[]) => `unknown`[] |
#### Defined in #### Defined in
[src/types/core.ts:20](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core.ts#L20) [src/handler/structures/wrapper.ts:11](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/wrapper.ts#L11)
___ ___
### defaultPrefix ### defaultPrefix
`Optional` **defaultPrefix**: `string` `Optional` `Readonly` **defaultPrefix**: `string`
#### Defined in #### Defined in
[src/types/core.ts:10](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core.ts#L10) [src/handler/structures/wrapper.ts:8](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/wrapper.ts#L8)
___ ___
### events ### events
`Optional` **events**: `string` `Optional` `Readonly` **events**: `string`
#### Defined in #### Defined in
[src/types/core.ts:11](https://github.com/sern-handler/handler/blob/9d5c6c7/src/types/core.ts#L11) [src/handler/structures/wrapper.ts:10](https://github.com/sern-handler/handler/blob/33f1446/src/handler/structures/wrapper.ts#L10)
___
### 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)

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -1,93 +0,0 @@
---
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)

View File

@@ -6,35 +6,115 @@ sidebar_position: 0
custom_edit_url: null 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)
___
### controller
Re-exports [controller](../modules.md#controller)
___
### discordEvent
Re-exports [discordEvent](../modules.md#discordevent)
___
### eventModule
Re-exports [eventModule](../modules.md#eventmodule-1)
## Functions ## Functions
### init ### init
**init**(`maybeWrapper`): `void` **init**(`wrapper`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| `maybeWrapper` | [`Wrapper`](../interfaces/Wrapper.md) \| ``"file"`` |
#### Returns
`void`
**`Since`**
1.0.0
**`Example`** **`Example`**
```ts title="src/index.ts" ```ts title="src/index.ts"
Sern.init({ Sern.init({
defaultPrefix: '!',
commands: 'dist/commands', commands: 'dist/commands',
events: 'dist/events', events: 'dist/events',
containerConfig : {
get: useContainer
}
}) })
``` ```
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `wrapper` | [`Wrapper`](../interfaces/Wrapper.md) | Options to pass into sern. Function to start the handler up |
#### Returns
`void`
#### Defined in #### Defined in
[src/sern.ts:27](https://github.com/sern-handler/handler/blob/9d5c6c7/src/sern.ts#L27) [src/handler/sern.ts:38](https://github.com/sern-handler/handler/blob/33f1446/src/handler/sern.ts#L38)
___
### 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` | [`DependencyConfiguration`](../interfaces/DependencyConfiguration.md)<`T`\> | a configuration for creating your project dependencies |
#### 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`\>
#### Defined in
[src/handler/sern.ts:107](https://github.com/sern-handler/handler/blob/33f1446/src/handler/sern.ts#L107)

View File

@@ -1,30 +0,0 @@
# 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
```

View File

@@ -1,211 +0,0 @@
```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>

View File

@@ -1,11 +0,0 @@
```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.

View File

@@ -1,92 +0,0 @@
```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>
MODE=<DEV|PROD>
```
- Calls the discord API with the [PUT route](https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands). Wherever your commands directory is located, publish will override the existing application commands at Discord. Existing commands do not count towards the command limit creation daily.
You may pass these in as command line arguments as well. **CLI arguments take precedence.**
If you do not know how to obtain either of these credentials, [click here](https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-&-getting-a-token)
## Usage
![usage](../../static/img/Code_-_Insiders_2kTVzm0uIQ.gif)
## Features
- Automatically syncs api with your command base
- generates JSON file of output (**.sern/command-data-remote.json**)
- supports publishing direct esm typescript files
- 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')
}
})
```

View File

@@ -4,9 +4,6 @@ Welcome to our official guide. This guide will go through all the core features
- 💖 Thank you for choosing sern to be your framework! - 💖 Thank you for choosing sern to be your framework!
- Teaching the discord.js library and / or Javascript / Typescript is out of scope of this project, so the documentation assumes you already know these elements. - 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 - discord.js v14 is the only supported library at the moment
@@ -15,13 +12,11 @@ Welcome to our official guide. This guide will go through all the core features
* How to use sern with the [CLI](walkthrough/cli.md) * How to use sern with the [CLI](walkthrough/cli.md)
* [Your first command](walkthrough/first-command.md) * [Your first command](walkthrough/first-command.md)
* [The Context class](walkthrough/first-command.md#context-class) * [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 ### Working with plugins
* [Plugins](walkthrough/plugins.md) * [Plugins](walkthrough/plugins.md)
- [Init Plugins](walkthrough/plugins.md#command-plugins) - [Command Plugins](walkthrough/plugins.md#command-plugins)
- [Control Plugins](walkthrough/plugins.md#event-plugins) - [Event Plugins](walkthrough/plugins.md#event-plugins)
### Events ### Events
* [The SernEmitter class](walkthrough/sern-emitter.md) * [The SernEmitter class](walkthrough/sern-emitter.md)
* [Your first event](walkthrough/first-event.md) * [Your first event](walkthrough/first-event.md)

View File

@@ -1,11 +1,9 @@
# Choosing an IDE # Choosing an IDE
Choosing an IDE is a matter of personal preference. They make programming easier. The following are some Choosing an IDE is a matter of personal preference. The following are some
suggestions for choosing an IDE: suggestions for choosing an IDE:
* [Visual Studio Code](https://code.visualstudio.com) * [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/) * [Sublime Text](https://www.sublimetext.com/)
* [NotePad++](https://notepad-plus-plus.org/) * [NotePad++](https://notepad-plus-plus.org/)
* [nvim](https://neovim.io/) (chad)

View File

@@ -1,14 +1,16 @@
# Preparing to Code # Preparing to Code
After installing an IDE, you need to install node. After installing and IDE you need to install node.
[Click to 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: After you downloaded node, you can start using us
#### [Discord token](https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-&-getting-a-token) Running this will install our CLI, which allows you to create a template project without writing a single line of code.
```shell
npm install -g @sern/cli
```
CONTINUE 🤓 If you want to do more with our CLI, continue reading our guides.

View File

@@ -1,45 +0,0 @@
---
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.

View File

@@ -5,24 +5,25 @@ sidebar_position: 2
# CLI # CLI
Setting up the [CLI](https://github.com/sern-handler/cli) is easy. <br /> Setting up the [CLI](https://github.com/sern-handler/cli) is easy. <br />
The cli is your plug to the sern ecosystem. This will allow you to install plugins with ease, install extra utilities, and much more. - To start a brand-new project, run :
If you haven't yet:
```sh ```sh
npm install -g @sern/cli sern init (-y)
``` ```
- To install [plugins](plugins.md) maintained by the community [repository](https://github.com/sern-handler/awesome-plugins), :::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 sern plugins
``` ```
:::info :::info
Make sure to have a correct [sern.config.json](./good-to-know.md#sernconfigjson) 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 /> 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. **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. If you want to view plugins, visit the repository linked above.
@@ -31,4 +32,3 @@ If you want to view plugins, visit the repository linked above.
sern extra sern extra
``` ```
We have a more in depth [guide](../../cli/README.md) of the CLI

View File

@@ -1,11 +1,8 @@
--- ---
sidebar_position: 9 sidebar_position: 8
--- ---
# Conclusion # Conclusion
If you reached this far, thank you for reading! We hope you have learned the necessities you need 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 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.
![](/blog/newlogo/paperlogo.png)

View File

@@ -1,107 +0,0 @@
---
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() })
})
```

View File

@@ -1,41 +1,13 @@
--- ---
sidebar_position: 4 sidebar_position: 3
--- ---
# First Command # First Command
We will dissect a basic 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. If you installed a new project via the cli, This is the `ping` command located in src/commands folder.
:::tip Typescript
TLDR: command modules are discord bot commands. There are many types, and each one will correspond to an event from discord. ```typescript
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'; import { commandModule, CommandType } from '@sern/handler';
export default commandModule({ export default commandModule({
@@ -47,14 +19,21 @@ export default commandModule({
await ctx.reply({ content: 'Pong 🏓' }); await ctx.reply({ content: 'Pong 🏓' });
}, },
}); });
``` ```
Javascript
```javascript
const { CommandType, commandModule } = require('@sern/handler');
</TabItem> exports.default = commandModule({
type: CommandType.Both,
</Tabs> plugins: [],
description: 'A ping command',
// alias : [],
execute: async (ctx, args) => {
await ctx.reply('Pong 🏓');
},
})
```
To view what each of these properties mean in depth, visit the [official documentation](https://sern.dev/docs/api/enums/CommandType). 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 ### 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 /> Every command module `type` is part of an enum. This field allows type inference for the rest of a module's fields. <br />
@@ -64,27 +43,7 @@ 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. **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 /> <br />
<Tabs> Typescript:
<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 ```typescript
import { commandModule, CommandType } from '@sern/handler'; import { commandModule, CommandType } from '@sern/handler';
export default commandModule({ export default commandModule({
@@ -99,12 +58,21 @@ export default commandModule({
} }
}); });
``` ```
Javascript:
</TabItem> ```javascript
const { CommandType, commandModule } = require('@sern/handler');
</Tabs> 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' })
}
});
```
Commands are straight forward. Keep in mind, every other property on the commandModule object is Commands are straight forward. Keep in mind, every other property on the commandModule object is
optional **except** the type and execute function. optional **except** the type and execute function.
@@ -117,4 +85,31 @@ The Context class is passed into modules with type:
- `CommandType.Text` - `CommandType.Text`
This data structure helps interop between legacy commands and slash commands with ease. 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!
}
});
```

View File

@@ -1,76 +1,63 @@
--- ---
sidebar_position: 5 sidebar_position: 4
--- ---
# First Event Module # First Event Module
We will dissect a basic event module. <br /> We will dissect a basic event module. <br />
Typescript:
:::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 : [],
name: 'module.activate',
execute(event) {
console.log(event);
}
})
```
</TabItem>
<TabItem value="ts" label="Typescript">
```typescript ```typescript
export default eventModule({ export default eventModule({
type: EventType.Sern, type: EventType.Sern,
plugins : [], plugins : [], //NOT SUPPORTED YET!!
name: 'module.activate', //name of event. name: 'module.activate', //name of event.
execute(event) { execute(event) {
console.log(event); console.log(event);
} }
}) })
``` ```
Javascript:
</TabItem> ```javascript
exports.default = eventModule({
</Tabs> type: EventType.Sern,
plugins : [], //NOT SUPPORTED YET!!
name: 'module.activate',
execute(event) {
console.log(event);
}
})
```
Like command modules, the `type` property denotes what kind of event it is, which 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). 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). To view what each of these properties mean in depth, visit the [official documentation](https://sern.dev/docs/api/enums/EventType).
## External <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.
In version 2 & 3, any dependency that you have passed into makeDependencies can be registered here as well. ### Another example of an event module
```ts title="src/index.ts" Typescript:
await makeDependencies({ ```typescript
build: root => root.add({
eventlistener: single(() => new EventEmitter())
})
})
```
```ts title="events/myevent.ts"
export default eventModule({ export default eventModule({
type: EventType.External, type: EventType.Discord,
emitter: 'eventlistener', plugins : [],
execute: (args) => { name: 'guildMemberAdd', //name of event.
console.log('Got event from eventlistener: ', args); async execute(member: GuildMember) {
} (await member.guild.channels.fetch('channel-id') as TextChannel).send(`Welcome, ${member}`);
}
}) })
``` ```
Javascript:
```javascript
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}`);
}
})
```

View File

@@ -2,50 +2,8 @@
sidebar_position: 1 sidebar_position: 1
--- ---
# Goal # Goal
This walkthrough will be written in [TypeScript](https://www.typescriptlang.org/) but will have JavaScript snippets throughout. 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.
# Make robust, modular, bots It should include all the tools for any bot at any scale.
- *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

View File

@@ -1,5 +1,5 @@
--- ---
sidebar_position: 9 sidebar_position: 7
--- ---
# Good to know # Good to know

View File

@@ -1,12 +0,0 @@
---
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)

View File

@@ -1,45 +1,59 @@
--- ---
sidebar_position: 6 sidebar_position: 5
--- ---
# Plugins # Plugins
:::tip <p>As of now, modules seem a little underwhelming. It appears that sern doesn't have all the features of a standard handler,
TLDR: Plugins help reduce code repetition and are installable via `sern plugins`. Put them onto the plugins field of a command/event module. which manages permissions, categorizes, cool-downs, publishes application commands, role permissions, etc.</p>
:::
## Installing
Chances are, you just want your bot to work. Plugins can preprocess and create reusable conditions for modules.
run: <p>Many important parts that manage access and help streamline command creation to make are apparently absent.
```sh Below is an example of an event plugin, one of the types of plugins.</p>
sern plugins
```
- 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 Typescript:
import { commandModule, CommandType } from '@sern/handler' ```typescript
import { ownerOnly } from '../plugins' export function serenOnly(): EventPlugin<CommandType.Both> {
return {
export default commandModule({ type: PluginType.Event,
type: CommandType.Both, async execute([ctx, args], controller) {
plugins: [ownerOnly(['182326315813306368')], if (ctx.user.id !== "182326315813306368") {
description: 'ping command', await ctx.reply({content: "You cannot use this command"})
execute: (ctx) => { return controller.stop()
ctx.reply('hello, owner'); }
return controller.next();
} }
}) }
}
```
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();
}
}
}
``` ```
#### ┗|O|┛ perfect, your first plugin!
## Creating your own plugins <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.
The controller determines in plugins whether to continue or fail. <br /> At the moment, there are two types of plugins:
- 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 ### The controller object
```typescript ```typescript
export interface Controller { export interface Controller {
@@ -47,38 +61,90 @@ export interface Controller {
stop: () => Err<void>; 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 /> An instance of the above object is passed into every plugin. <br />
This controls whether a module is stored into sern. <br /> This controls whether a module is stored into sern. <br />
Typescript:
```typescript ```typescript
import { CommandInitPlugin } from '@sern/handler' export function inDir(dir : string) : CommandPlugin<CommandType.Both> {
import path from 'path' return {
export const inDir = (dir: string) => { type: PluginType.Command,
return CommandInitPlugin(({ module, absPath }) => { async execute(wrapper, { absPath, module }, controller) {
if(path.dirname(absPath) !== dir) { 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) {
console.log(+new Date(), `${module.name} is not in the correct directory!`); console.log(+new Date(), `${module.name} is not in the correct directory!`);
return controller.stop() return controller.stop()
} }
console.log(+new Date(), `${module.name} is in the correct directory!`); console.log(+new Date(), `${module.name} is in the correct directory!`);
return controller.next(); //continue return controller.next(); //continue
}); }
}
} }
``` ```
Above, this simple plugin logs that the module has been loaded along with a timestamp. <br /> 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 ## Event Plugins
![control-plugins](../../../static/img/eventplugins.drawio.svg) <br /> ![event-plugins](../../../static/img/eventplugins.drawio.svg) <br />
- An event is emitted by discord.js. - An event is emitted by discord.js.
- This event is passed to all plugins (**in order!!**), - This event is passed to all plugins (**in order!!**),
- If all are successful, - If all are successful,
The command is executed. Calling `controller.stop()` notifies sern that this command should not be run, The command is executed. Calling `controller.stop()` notifies sern that this command should not be run,
and command is ignored. and this event 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? 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`. - Before loading into sern, this command module will check if this module is in the correct directory `other`.

View File

@@ -1,5 +1,5 @@
--- ---
sidebar_position: 8 sidebar_position: 6
--- ---
# The SernEmitter class # The SernEmitter class

View File

@@ -1,158 +0,0 @@
---
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.

View File

@@ -1,40 +0,0 @@
---
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 />
![file tree](../../../static/img/fs.png)

View File

@@ -4,12 +4,7 @@ sidebar_position: 0
# Welcome! # Welcome!
:::tip
Please read the [transition](../docs/guide/walkthrough/transition.md) page if you are moving from version 2 to version 3.
:::
## Content ## 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/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! - [/docs/guide](../docs/guide) contains a basic startup guide and details to get started with sern faster!

View File

@@ -1,44 +0,0 @@
---
title: Overview
sidebar_position: 1
---
import GuideFeedback from "../../../../src/components/GuideFeedback";
# Guide Overview
Welcome to the sern Discord Bot Development Guide! 🚀
## What You'll Learn
In this comprehensive guide, we'll take you on a journey from the basics to the advanced concepts of creating and deploying your own Discord bot using the sern framework. Whether you're a beginner or have some coding experience, we've designed this guide to be inclusive and accessible to all.
## Guide Structure
Our guide is structured to take you step by step through the process of building a Discord bot with sern. Here's an overview of what you can expect:
- **Who are we?** Meet the sern team behind sern.
- **What is sern and what problems does it solve?**
Understand why sern, what is it and what does it solve.
- **Preparing** Set up your development environment.
- **Setting up the project** Learn about libraries and tools like @sern/handler and discord.js.
- **Setting Up the Bot** Register your bot, obtain necessary credentials, and set it up.
- **sern Overview** Dive into the core concepts of sern and its components.
- **Example Projects** Build practical Discord bots with sern.
- **Integration with Databases** Learn what is a database, which is the right one for you. And how to use them in your bot.
- **Ship Your Code To GitHub** Learn about Git, GitHub CLI, and version control systems & how to use them.
- **Deploy** Discover hosting options, scaling with AWS Fargate, and more.
- **Other Steps** Explore additional topics like comparing sern to other solutions and planning for future growth.
- **Conclusion** Reflect on what you've learned and your next steps in Discord bot development and sern.
We're excited to embark on this journey with you. Each section is designed to build upon the previous one, so feel free to follow along step by step or jump to the topics that interest you the most. By the end of this guide, you'll have the skills and knowledge to create, deploy, and manage your own Discord bot using sern.
---
<GuideFeedback />

View File

@@ -1,26 +0,0 @@
---
title: What is sern?
sidebar_position: 3
---
import GuideFeedback from "../../../../src/components/GuideFeedback";
We're a discord bot framework. The lack of tooling in the discord.js community is apparent, and is also monolithic. You can make bots easily and concisely with our suite of tools. We're also a community. Please join [here](https://sern.dev/discord)!
### Problem
- **no beginner friendly handler**
- **bad practices in discord.js guide**
- **lack of wholesome community in discord.js**
- **lack of modularity**
sern tries to solve all these problems. This tutorial is for anyone and everyone, beginners and advanced alike.
## Solution
- our handlers are modular and efficient.
- from my personal experience, the community feels pretentious and mean.
- discord.js discord chat feels pretentious and unwelcome to beginners.
- From community plugins to container, swap out tooling and things with ease.
---
<GuideFeedback />

View File

@@ -1,33 +0,0 @@
---
title: Who are we?
sidebar_position: 2
---
import GuideFeedback from "../../../../src/components/GuideFeedback";
Who are we?
Meet the passionate minds behind sern, working tirelessly to make your Discord bot development experience exceptional. Whether we're coding, designing, or building infrastructure, our common goal is to provide you the neccecities and bring your bot ideas to life.
# serendipity {#seren}
Hi.
I believe in making complicated things simpler and am an OSS contributor. OSS for life. This handler has been my baby for a long time now.
My favorite programming language is clojure
# EvolutionX {#evo}
You can call me Evo, I'm the automation lover of the team. discord.js was my turning point into programming and I've been hooked ever since. I'm a full stack developer and I love to learn new things. I'm also a huge fan of open source and I'm always looking for ways to contribute to the community.
sern is close to my heart and I'm proud to be a part of it. Let's make some awesome bots together!
# Sr Izan {#ethan}
Hey! I'm Ethan, the only guy on the development team who is european, and the only one who commits on all repos except for the handler.
Nice to meet you and I hope you enjoy this guide as much as we enjoyed making it!
# ropox {#ropox}
Hey there, I'm ropox! 👋
I'm not just a programmer; I'm one of the passionate maintainers of the sern framework. My mission is to demystify Discord bot development and ensure it's accessible to everyone. But that's not all I wear multiple hats, including design (i designed the logo) and infrastructure
some say [I'm the coolest of all](/blog/newlogo#ropox-thing)
---
<GuideFeedback />

View File

@@ -1,18 +0,0 @@
---
title: Choosing a package manager
---
import GuideFeedback from "../../../../src/components/GuideFeedback";
<!-- Rephrasing and title done by Ethan -->
A package manager is like a helper for your programs. It brings all the tools for your projects and makes sure they fit and work well together. It's like having someone organize things so you can work without problems.
The most used ones are:
- [npm](https://www.npmjs.com)
- [Yarn](https://yarnpkg.com)
- [pnpm](https://pnpm.io/)
For this tutorial, we'll be using **[NPM](https://www.npmjs.com)**, to keep it simple.
---
<GuideFeedback />

View File

@@ -1,26 +0,0 @@
---
title: npm create @sern/bot
sidebar_position: 1
---
import GuideFeedback from "../../../../src/components/GuideFeedback";
Alright, you've got everything set up. Now it's time to create your bot!
## The backstory
In the initial days of sern, we used to create our bots with the `sern init` command in the CLI.
This command was an easy way to set up a sern project in ten, even five minutes!
But now there's a new, cooler and faster sheriff in town: the [`npm create @sern/bot`](https://github.com/sern-handler/create-bot) command.
This was an alternative to the old command, which got deprecated in favor of this tool in no time.
## The GUI
Currently WIP by me, sern GUI will be a graphical frontend to sern CLI and the npm create command.
Follow development on the [Github repo](https://github.com/sern-handler/gui).
See you on the next chapter where we'll use the already discussed command to set up your bot!
---
Written by [Sr Izan](../intro/who-are-we#ethan)
<GuideFeedback />

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