mirror of
https://github.com/sern-handler/handler
synced 2026-06-06 01:16:55 +00:00
* style: Formatted 17 files & changes messageHelper util * style: Formatted HTML and CSS files * Revert "style: Formatted 17 files & changes messageHelper util" This reverts commit988d7fa6d2. * style(style.css): Formatted main style file with tabwidth 2 * chore: Added docs maintainer * chore: Changed typedoc configration * chore(README.md): Removed coming soon from links * chore: Updated Prettier formatter tab width * docs(readme): Improved Readme readability * docs(README): Fixed installation box * style(README.md): Improved readability * chore: Added CONTRIBUTING.md * docs(README.md): Removed old repo link and it's line * docs(README): Updated Intents to djs v14 Co-authored-by: EvolutionX <85353424+EvolutionX-10@users.noreply.github.com> * docs: Updated README example to djs v14 * docs: Formatted README examples * Update README.md * docs: Updated organization description * docs(README): Rename 'fixed' to 'patched' * chore: Updated LICENSE * chore: Updated LICNESE * chore: Changed license to MIT * Delete LICENSE.md * chore: Recreated LICENSE * chore: First License boilerplate preview * style(index.ts): Added a space * chore(index.ts): First license boilerplate preview * chore(PRETTIER): Re-updated the tab width * chore(SECURITY): Updated security.md file * docs(README): Improved readability * fix(README): Fixed typo * style: Updated license boilerplate * style(*): Updated license boilerplate * style: Updated license boilerplate * style: Updated license boilerplate * style: Updated license boilerplate * style: Updated License boilerplate * style: Updated License boilerplate * docs(README): Added stats * docs(README): Temporarily or permanently removed stats * refactor: DRY Principles * feat: finished interactionCreate.ts handling? (need test) * chore: Updated CONTRIBUTING.md file * chore: Updated credits * chore(NPM): Prepared package.json for release * revert: Some changes * revert: Revert back to MIT LICENSE (#50) * chore: Updated LICENSE boilerplate * style: Improved comments * style: Updated comments * fix: Non-exhaustiveness led to commands not registering readyEvent.ts * feat: Add DefinetlyDefined type, more todo statements * feat: Aliases optional * feat: Optional plugins to reduce bloat * feat: better looking typings for modules * refactor: Simplify sernModule handler signature * refactor: make ApplicationCommandOptions optional * refactor: make description optional * refactor: Bring CommandType and PluginType to top level * fix: Fix return type of sernModule * refactor: Why is that not assignable bruh * revert: Re-add plugins overload * fix(CODE_OF_CONDUCT): Removed unusual dot * Update package.json * fix: Resolve conflicts * fix: Resolve conflicts * feat: should be able to register other nodejs event emitters * fix: Standard for of does not resolve promises. Switched to for await * feat: Adding sern event listeners, overriding and typing methods * feat: Edited event names for more conciseness, finished basic event emitters * style: Run prettier * fix: didn't run prettier, now i am * fix: linting issue in markup.ts * fix: prettier wants lf line ending * fix: prettier changes again * feat: add .prettierignore and ignore README.md * feat: add externallyUsed.ts and support BothCommands again * feat: remove comments about prev commit * style: change prettier print width and reformat * feat: adding modal and autocomplete support * feat: Finishing up autocomplete, need to test * feat: Making name required in auto cmp interactions * feat: move name and description out of OptionsData[] * feat: finishing optionData for autocomplete changes, adding class for builder * feat: finishing autocomplete!! * refactor: Simplifying logic of message filter * feat: Adding docs to some data structures, moving to default from export files * refactor: cleaning up code, removing unuseds * feat: adding refactoring for repetitive event plugin processing * feat: adding better typings, refactoring * refactor: remove unnecessary nullish short circuit * refactor: remove unnecessary nullish short circuit * feat: add docs/ to npmignore * style: Formatted 17 files & changes messageHelper util * style: Formatted HTML and CSS files * Revert "style: Formatted 17 files & changes messageHelper util" This reverts commit988d7fa6d2. * style(style.css): Formatted main style file with tabwidth 2 * chore: Added docs maintainer * chore: Changed typedoc configration * chore(README.md): Removed coming soon from links * docs(readme): Improved Readme readability * chore: Added CONTRIBUTING.md * docs(README): Fixed installation box * style(README.md): Improved readability * docs(README.md): Removed old repo link and it's line * docs: Updated README example to djs v14 * docs(README): Updated Intents to djs v14 Co-authored-by: EvolutionX <85353424+EvolutionX-10@users.noreply.github.com> * docs: Formatted README examples * Update README.md * chore: Updated LICENSE * chore: Updated LICNESE * chore: Changed license to MIT * Delete LICENSE.md * chore: Recreated LICENSE * chore: First License boilerplate preview * style(index.ts): Added a space * chore(index.ts): First license boilerplate preview * chore(SECURITY): Updated security.md file * style: Updated license boilerplate * docs(README): Added stats * chore: Updated CONTRIBUTING.md file * chore: Updated credits * chore(NPM): Prepared package.json for release * revert: Some changes * revert: Revert back to MIT LICENSE (#50) * fix(CODE_OF_CONDUCT): Removed unusual dot * fix: Resolve conflicts * fix: Resolve conflicts Co-authored-by: EvolutionX <85353424+EvolutionX-10@users.noreply.github.com> Co-authored-by: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com>
169 lines
13 KiB
HTML
169 lines
13 KiB
HTML
<!DOCTYPE html>
|
|
<html class="default">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta http-equiv="x-ua-compatible" content="IE=edge" />
|
|
<title>SernHandler</title>
|
|
<meta name="description" content="Documentation for sern-handler" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<link rel="stylesheet" href="assets/style.css" />
|
|
<link rel="stylesheet" href="assets/highlight.css" />
|
|
<script async src="assets/search.js" id="search-script"></script>
|
|
</head>
|
|
<body>
|
|
<script>
|
|
document.body.classList.add(localStorage.getItem('tsd-theme') || 'os');
|
|
</script>
|
|
<header>
|
|
<div class="tsd-page-toolbar">
|
|
<div class="container">
|
|
<div class="table-wrap">
|
|
<div class="table-cell" id="tsd-search" data-base=".">
|
|
<div class="field">
|
|
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label
|
|
><input type="text" id="tsd-search-field" />
|
|
</div>
|
|
<ul class="results">
|
|
<li class="state loading">Preparing search index...</li>
|
|
<li class="state failure">The search index is not available</li>
|
|
</ul>
|
|
<a href="index.html" class="title">sern-handler</a>
|
|
</div>
|
|
<div class="table-cell" id="tsd-widgets">
|
|
<div id="tsd-filter">
|
|
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
|
<div class="tsd-filter-group">
|
|
<div class="tsd-select" id="tsd-filter-visibility">
|
|
<span class="tsd-select-label">All</span>
|
|
<ul class="tsd-select-list">
|
|
<li data-value="public">Public</li>
|
|
<li data-value="protected">Public/Protected</li>
|
|
<li data-value="private" class="selected">All</li>
|
|
</ul>
|
|
</div>
|
|
<input type="checkbox" id="tsd-filter-inherited" checked /><label
|
|
class="tsd-widget"
|
|
for="tsd-filter-inherited"
|
|
>Inherited</label
|
|
><input type="checkbox" id="tsd-filter-externals" checked /><label
|
|
class="tsd-widget"
|
|
for="tsd-filter-externals"
|
|
>Externals</label
|
|
>
|
|
</div>
|
|
</div>
|
|
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="tsd-page-title">
|
|
<div class="container"><h1>sern-handler</h1></div>
|
|
</div>
|
|
</header>
|
|
<div class="container container-main">
|
|
<div class="row">
|
|
<div class="col-8 col-content">
|
|
<div class="tsd-panel tsd-typography">
|
|
<a href="#sern-handler" id="sern-handler" style="color: inherit; text-decoration: none">
|
|
<h1>Sern Handler</h1>
|
|
</a>
|
|
<a href="https://www.npmjs.com/package/sern-handler">
|
|
<img src="https://img.shields.io/npm/v/sern_handler?maxAge=3600" alt="NPM version"
|
|
/></a>
|
|
<a href="https://www.npmjs.com/package/sern-handler"
|
|
><img src="https://img.shields.io/npm/dt/sern_handler?maxAge=3600" alt="NPM downloads"
|
|
/></a>
|
|
<a href="https://www.npmjs.com/package/sern-handler"
|
|
><img src="https://img.shields.io/badge/builds-stable" alt="Builds Passing"
|
|
/></a>
|
|
|
|
<p>
|
|
Sern can automate and streamline development of your discord bot with new version compatibility and full
|
|
customization.
|
|
</p>
|
|
<ul>
|
|
<li>A reincarnation of <a href="https://github.com/jacoobes/sern_handler">this old project</a></li>
|
|
</ul>
|
|
|
|
<a href="#installation" id="installation" style="color: inherit; text-decoration: none">
|
|
<h2>Installation</h2>
|
|
</a>
|
|
<pre><code class="language-sh"><span class="hl-0">npm install sern-handler</span>
|
|
</code></pre>
|
|
<pre><code class="language-sh"><span class="hl-0">yarn add sern-handler</span>
|
|
</code></pre>
|
|
<pre><code class="language-sh"><span class="hl-0">pnpm add sern-handler</span>
|
|
</code></pre>
|
|
|
|
<a href="#basic-usage" id="basic-usage" style="color: inherit; text-decoration: none">
|
|
<h2>Basic Usage</h2>
|
|
</a>
|
|
|
|
<a href="#indexjs" id="indexjs" style="color: inherit; text-decoration: none">
|
|
<h4><code>index.js</code></h4>
|
|
</a>
|
|
<pre><code class="language-js"><span class="hl-1">import</span><span class="hl-0"> { </span><span class="hl-2">Client</span><span class="hl-0">, </span><span class="hl-2">Intents</span><span class="hl-0"> } </span><span class="hl-1">from</span><span class="hl-0"> </span><span class="hl-3">'discord.js'</span><span class="hl-0">;</span><br/><span class="hl-1">import</span><span class="hl-0"> { </span><span class="hl-2">Sern</span><span class="hl-0"> } </span><span class="hl-1">from</span><span class="hl-0"> </span><span class="hl-3">'sern-handler'</span><span class="hl-0">;</span><br/><span class="hl-1">import</span><span class="hl-0"> { </span><span class="hl-2">prefix</span><span class="hl-0">, </span><span class="hl-2">token</span><span class="hl-0"> } </span><span class="hl-1">from</span><span class="hl-0"> </span><span class="hl-3">'../src/secrets.json'</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">client</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-6">Client</span><span class="hl-0">({</span><br/><span class="hl-0"> </span><span class="hl-2">intents:</span><span class="hl-0"> [</span><br/><span class="hl-0"> </span><span class="hl-2">Intents</span><span class="hl-0">.</span><span class="hl-5">FLAGS</span><span class="hl-0">.</span><span class="hl-5">GUILDS</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-2">Intents</span><span class="hl-0">.</span><span class="hl-5">FLAGS</span><span class="hl-0">.</span><span class="hl-5">GUILD_MESSAGES</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-2">Intents</span><span class="hl-0">.</span><span class="hl-5">FLAGS</span><span class="hl-0">.</span><span class="hl-5">GUILD_MEMBERS</span><br/><span class="hl-0"> ]</span><br/><span class="hl-0">});</span><br/><br/><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">Sern</span><span class="hl-0">.</span><span class="hl-6">Handler</span><span class="hl-0">({</span><br/><span class="hl-0"> </span><span class="hl-2">client</span><span class="hl-0">, </span><br/><span class="hl-0"> </span><span class="hl-2">prefix</span><span class="hl-0">, </span><br/><span class="hl-0"> </span><span class="hl-2">commands :</span><span class="hl-0"> </span><span class="hl-3">'dist/commands'</span><span class="hl-0">, </span><br/><span class="hl-0"> </span><span class="hl-2">privateServers :</span><span class="hl-0"> [ </span><br/><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-2">test :</span><span class="hl-0"> </span><span class="hl-4">true</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-2">id:</span><span class="hl-0"> </span><span class="hl-3">'server-id'</span><br/><span class="hl-0"> }</span><br/><span class="hl-0"> ],</span><br/><span class="hl-0"> </span><span class="hl-6">init</span><span class="hl-2">:</span><span class="hl-0"> </span><span class="hl-4">async</span><span class="hl-0"> (</span><span class="hl-2">handler</span><span class="hl-0">) </span><span class="hl-4">=></span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-7">// Optional function to initialize anything else on bot startup</span><br/><span class="hl-0"> },</span><br/><span class="hl-0">});</span><br/><br/><br/><span class="hl-2">client</span><span class="hl-0">.</span><span class="hl-6">login</span><span class="hl-0">(</span><span class="hl-2">token</span><span class="hl-0">);</span>
|
|
</code></pre>
|
|
|
|
<a href="#pingjs" id="pingjs" style="color: inherit; text-decoration: none">
|
|
<h4><code>ping.js</code></h4>
|
|
</a>
|
|
<pre><code class="language-js"><span class="hl-1">import</span><span class="hl-0"> { </span><span class="hl-2">Sern</span><span class="hl-0">, </span><span class="hl-2">Types</span><span class="hl-0"> } </span><span class="hl-1">from</span><span class="hl-0"> </span><span class="hl-3">'sern-handler'</span><span class="hl-0">;</span><br/><span class="hl-1">import</span><span class="hl-0"> { </span><span class="hl-2">Ok</span><span class="hl-0"> } </span><span class="hl-1">from</span><span class="hl-0"> </span><span class="hl-3">'ts-results'</span><span class="hl-0">;</span><br/><br/><span class="hl-1">export</span><span class="hl-0"> </span><span class="hl-1">default</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-2">alias:</span><span class="hl-0"> [],</span><br/><span class="hl-0"> </span><span class="hl-2">desc :</span><span class="hl-0"> </span><span class="hl-3">'A ping pong command'</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-2">visibility :</span><span class="hl-0"> </span><span class="hl-3">'private'</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-2">test :</span><span class="hl-0"> </span><span class="hl-4">false</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-2">type:</span><span class="hl-0"> </span><span class="hl-2">Sern</span><span class="hl-0">.</span><span class="hl-2">CommandType</span><span class="hl-0">.</span><span class="hl-5">SLASH</span><span class="hl-0"> | </span><span class="hl-2">Sern</span><span class="hl-0">.</span><span class="hl-2">CommandType</span><span class="hl-0">.</span><span class="hl-5">TEXT</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-6">execute</span><span class="hl-2"> :</span><span class="hl-0"> </span><span class="hl-4">async</span><span class="hl-0"> ({ </span><span class="hl-2">message</span><span class="hl-0">, </span><span class="hl-2">interaction</span><span class="hl-0"> }, </span><span class="hl-2">args</span><span class="hl-0">) </span><span class="hl-4">=></span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-2">interaction</span><span class="hl-0">.</span><span class="hl-6">reply</span><span class="hl-0">({ </span><span class="hl-2">content:</span><span class="hl-0"> </span><span class="hl-3">'Pong! })</span><span class="hl-8">;</span><br/><span class="hl-0"> }</span><br/><span class="hl-0">};</span>
|
|
</code></pre>
|
|
<p>See <a href="https://sernhandler.js.org">documentation</a> for TypeScript examples and more</p>
|
|
|
|
<a href="#links-" id="links-" style="color: inherit; text-decoration: none">
|
|
<h2>Links <img src="https://img.shields.io/badge/Coming-Soon-purple" alt="link" /></h2>
|
|
</a>
|
|
<ul>
|
|
<li><a href="https://tmp.com">Official Documentation</a></li>
|
|
<li><a href="https://tmp.com">Example Bot</a></li>
|
|
<li><a href="https://google.com">Discord Server</a></li>
|
|
</ul>
|
|
|
|
<a href="#contribute" id="contribute" style="color: inherit; text-decoration: none">
|
|
<h2>Contribute</h2>
|
|
</a>
|
|
<ul>
|
|
<li>
|
|
Pull up on <a href="https://github.com/jacoobes/Sern/issues">issues</a> and tell me if there are bugs
|
|
</li>
|
|
<li>All kinds of contributions are welcomed!</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
<nav class="tsd-navigation primary">
|
|
<ul>
|
|
<li class="current"><a href="modules.html">Exports</a></li>
|
|
<li class="tsd-kind-namespace"><a href="modules/Sern.html">Sern</a></li>
|
|
<li class="tsd-kind-namespace"><a href="modules/Types.html">Types</a></li>
|
|
<li class="tsd-kind-namespace"><a href="modules/Utils.html">Utils</a></li>
|
|
</ul>
|
|
</nav>
|
|
<nav class="tsd-navigation secondary menu-sticky"><ul></ul></nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<footer class="with-border-bottom">
|
|
<div class="container">
|
|
<h2>Settings</h2>
|
|
<p>
|
|
Theme
|
|
<select id="theme">
|
|
<option value="os">OS</option>
|
|
<option value="light">Light</option>
|
|
<option value="dark">Dark</option>
|
|
</select>
|
|
</p>
|
|
</div>
|
|
</footer>
|
|
<div class="container tsd-generator">
|
|
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
|
|
</div>
|
|
<div class="overlay"></div>
|
|
<script src="assets/main.js"></script>
|
|
</body>
|
|
</html>
|