mirror of
https://github.com/sern-handler/website
synced 2026-06-11 02:12:25 +00:00
112 lines
145 KiB
HTML
112 lines
145 KiB
HTML
<!DOCTYPE html><html lang="en" dir="ltr" data-has-toc data-has-sidebar data-theme="dark" class="astro-bguv2lll"> <head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><title>Plugins | sern</title><link rel="canonical" href="https://sern.dev/v4/reference/plugins/"/><link rel="alternate" hreflang="en" href="https://sern.dev/v4/reference/plugins/"/><link rel="alternate" hreflang="es" href="https://sern.dev/es/v4/reference/plugins/"/><link rel="alternate" hreflang="tr" href="https://sern.dev/tr/v4/reference/plugins/"/><link rel="sitemap" href="/sitemap-index.xml"/><script src="https://analytics.sern.dev/ua.js" data-website-id="db608ae9-3ae2-49ed-9f7c-3ba0d5abe1b6" defer></script><link rel="shortcut icon" href="/favicon.svg" type="image/svg+xml"/><meta name="generator" content="Astro v4.9.1"/><meta name="generator" content="Starlight v0.23.1"/><meta property="og:title" content="Plugins"/><meta property="og:type" content="article"/><meta property="og:url" content="https://sern.dev/v4/reference/plugins/"/><meta property="og:locale" content="en"/><meta property="og:description" content="Run code before execution"/><meta property="og:site_name" content="sern"/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:title" content="Plugins"/><meta name="twitter:description" content="Run code before execution"/><meta name="description" content="Run code before execution"/> <meta property="og:title" content="sern - Handlers. Redefined."> <meta property="og:description" content="A modular, customizable, fast Discord.js framework to streamline bot development"> <meta property="og:url" content="https://sern.dev"> <meta property="og:type" content="website"> <meta property="og:image:alt" content="sern logo"> <meta property="og:image" content="https://sern.dev/open-graph/v4/reference/plugins.webp"> <meta property="og:image:height" content="512"> <meta property="og:image:width" content="1024"> <meta name="theme-color" content="#F25186"> <meta name="keywords" content="discord, bot, handler, framework, documentation, sern"> <meta name="twitter:title" content="sern - Handlers. Redefined."> <meta name="twitter:description" content="A modular, customizable, fast Discord.js framework to streamline bot development"> <meta name="twitter:image" content="https://sern.dev/open-graph/v4/reference/plugins.webp"> <meta name="twitter:url" content="https://sern.dev"> <meta property="twitter:site" content="@sern-handler"><script>
|
||
window.StarlightThemeProvider = (() => {
|
||
const storedTheme =
|
||
typeof localStorage !== 'undefined' && localStorage.getItem('starlight-theme');
|
||
const theme =
|
||
storedTheme ||
|
||
(window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark');
|
||
document.documentElement.dataset.theme = theme === 'light' ? 'light' : 'dark';
|
||
return {
|
||
updatePickers(theme = storedTheme || 'auto') {
|
||
document.querySelectorAll('starlight-theme-select').forEach((picker) => {
|
||
const select = picker.querySelector('select');
|
||
if (select) select.value = theme;
|
||
/** @type {HTMLTemplateElement | null} */
|
||
const tmpl = document.querySelector(`#theme-icons`);
|
||
const newIcon = tmpl && tmpl.content.querySelector('.' + theme);
|
||
if (newIcon) {
|
||
const oldIcon = picker.querySelector('svg.label-icon');
|
||
if (oldIcon) {
|
||
oldIcon.replaceChildren(...newIcon.cloneNode(true).childNodes);
|
||
}
|
||
}
|
||
});
|
||
},
|
||
};
|
||
})();
|
||
</script><template id="theme-icons"><svg aria-hidden="true" class="light astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M5 12a1 1 0 0 0-1-1H3a1 1 0 0 0 0 2h1a1 1 0 0 0 1-1Zm.64 5-.71.71a1 1 0 0 0 0 1.41 1 1 0 0 0 1.41 0l.71-.71A1 1 0 0 0 5.64 17ZM12 5a1 1 0 0 0 1-1V3a1 1 0 0 0-2 0v1a1 1 0 0 0 1 1Zm5.66 2.34a1 1 0 0 0 .7-.29l.71-.71a1 1 0 1 0-1.41-1.41l-.66.71a1 1 0 0 0 0 1.41 1 1 0 0 0 .66.29Zm-12-.29a1 1 0 0 0 1.41 0 1 1 0 0 0 0-1.41l-.71-.71a1.004 1.004 0 1 0-1.43 1.41l.73.71ZM21 11h-1a1 1 0 0 0 0 2h1a1 1 0 0 0 0-2Zm-2.64 6A1 1 0 0 0 17 18.36l.71.71a1 1 0 0 0 1.41 0 1 1 0 0 0 0-1.41l-.76-.66ZM12 6.5a5.5 5.5 0 1 0 5.5 5.5A5.51 5.51 0 0 0 12 6.5Zm0 9a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7Zm0 3.5a1 1 0 0 0-1 1v1a1 1 0 0 0 2 0v-1a1 1 0 0 0-1-1Z"/></svg> <svg aria-hidden="true" class="dark astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M21.64 13a1 1 0 0 0-1.05-.14 8.049 8.049 0 0 1-3.37.73 8.15 8.15 0 0 1-8.14-8.1 8.59 8.59 0 0 1 .25-2A1 1 0 0 0 8 2.36a10.14 10.14 0 1 0 14 11.69 1 1 0 0 0-.36-1.05Zm-9.5 6.69A8.14 8.14 0 0 1 7.08 5.22v.27a10.15 10.15 0 0 0 10.14 10.14 9.784 9.784 0 0 0 2.1-.22 8.11 8.11 0 0 1-7.18 4.32v-.04Z"/></svg> <svg aria-hidden="true" class="auto astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M21 14h-1V7a3 3 0 0 0-3-3H7a3 3 0 0 0-3 3v7H3a1 1 0 0 0-1 1v2a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-2a1 1 0 0 0-1-1ZM6 7a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v7H6V7Zm14 10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-1h16v1Z"/></svg> </template><link rel="stylesheet" href="/_astro/index.DiwH0U4k.css">
|
||
<link rel="stylesheet" href="/_astro/Blog.D3jLG7eg.css">
|
||
<style>.author:where(.astro-kbhsbk7c){align-items:center;display:flex;gap:.5rem;line-height:var(--sl-line-height-headings);text-decoration:none}.text:where(.astro-kbhsbk7c){display:flex;flex-direction:column}.name:where(.astro-kbhsbk7c){font-size:var(--sl-text-base);font-weight:600}.author:where(.astro-kbhsbk7c)[href] .name:where(.astro-kbhsbk7c){color:var(--sl-color-text-accent)}.title:where(.astro-kbhsbk7c){font-size:var(--sl-text-xs);color:var(--sl-color-text)}.author:where(.astro-kbhsbk7c)[href]:hover .name:where(.astro-kbhsbk7c){color:var(--sl-color-text)}img:where(.astro-kbhsbk7c){border:1px solid var(--sl-color-gray-2);border-radius:9999px;height:2.5rem;width:2.5rem}.metadata:where(.astro-2oxtfctb){display:flex;flex-direction:column;gap:.75rem}time:where(.astro-2oxtfctb){font-size:var(--sl-text-sm)}.authors:where(.astro-2oxtfctb){display:flex;flex-wrap:wrap;gap:.75rem 1rem}.badges:where(.astro-2oxtfctb){margin-top:.25rem}.draft:where(.astro-2oxtfctb){background-color:var(--sl-color-orange-low);border:1px solid var(--sl-color-orange);border-radius:.3rem;color:var(--sl-color-orange-high);font-size:var(--sl-text-body-sm);line-height:var(--sl-line-height-headings);margin-inline:.2rem;padding:.25rem .5rem .35rem}ul:where(.astro-sg3lsd66){display:inline;padding:0}li:where(.astro-sg3lsd66){display:inline-block;margin-bottom:.25rem;padding:0}a:where(.astro-sg3lsd66){border:1px solid var(--sl-color-gray-5);border-radius:.3rem;font-size:var(--sl-text-sm);margin-inline:.2rem;padding:.25rem .5rem .35rem;text-decoration:none}a:where(.astro-sg3lsd66):hover{border-color:var(--sl-color-gray-2)}
|
||
.card-grid:where(.astro-zntqmydn){display:grid;gap:1rem}.card-grid:where(.astro-zntqmydn)>*{margin-top:0!important}@media (min-width: 50rem){.card-grid:where(.astro-zntqmydn){grid-template-columns:1fr 1fr;gap:1.5rem}.stagger:where(.astro-zntqmydn){--stagger-height: 5rem;padding-bottom:var(--stagger-height)}.stagger:where(.astro-zntqmydn)>*:nth-child(2n){transform:translateY(var(--stagger-height))}}
|
||
.card:where(.astro-v5tidmuc){--sl-card-border: var(--sl-color-purple);--sl-card-bg: var(--sl-color-purple-low);border:1px solid var(--sl-color-gray-5);background-color:var(--sl-color-black);padding:clamp(1rem,calc(.125rem + 3vw),2.5rem);flex-direction:column;gap:clamp(.5rem,calc(.125rem + 1vw),1rem)}.card:where(.astro-v5tidmuc):nth-child(4n+1){--sl-card-border: var(--sl-color-orange);--sl-card-bg: var(--sl-color-orange-low)}.card:where(.astro-v5tidmuc):nth-child(4n+3){--sl-card-border: var(--sl-color-green);--sl-card-bg: var(--sl-color-green-low)}.card:where(.astro-v5tidmuc):nth-child(4n+4){--sl-card-border: var(--sl-color-red);--sl-card-bg: var(--sl-color-red-low)}.card:where(.astro-v5tidmuc):nth-child(4n+5){--sl-card-border: var(--sl-color-blue);--sl-card-bg: var(--sl-color-blue-low)}.title:where(.astro-v5tidmuc){font-weight:600;font-size:var(--sl-text-h4);color:var(--sl-color-white);line-height:var(--sl-line-height-headings);gap:1rem;align-items:center}.card:where(.astro-v5tidmuc) .icon:where(.astro-v5tidmuc){border:1px solid var(--sl-card-border);background-color:var(--sl-card-bg);padding:.2em;border-radius:.25rem}.card:where(.astro-v5tidmuc) .body:where(.astro-v5tidmuc){margin:0;font-size:clamp(var(--sl-text-sm),calc(.5rem + 1vw),var(--sl-text-body))}
|
||
svg:where(.astro-c6vsoqas){color:var(--sl-icon-color);font-size:var(--sl-icon-size, 1em);width:1em;height:1em}
|
||
starlight-tabs:where(.astro-esqgolmp){display:block}.tablist-wrapper:where(.astro-esqgolmp){overflow-x:auto}:where(.astro-esqgolmp)[role=tablist]{display:flex;list-style:none;border-bottom:2px solid var(--sl-color-gray-5);padding:0}.tab:where(.astro-esqgolmp){margin-bottom:-2px}.tab:where(.astro-esqgolmp)>:where(.astro-esqgolmp)[role=tab]{display:flex;align-items:center;gap:.5rem;padding:0 1.25rem;text-decoration:none;border-bottom:2px solid var(--sl-color-gray-5);color:var(--sl-color-gray-3);outline-offset:var(--sl-outline-offset-inside);overflow-wrap:initial}.tab:where(.astro-esqgolmp) :where(.astro-esqgolmp)[role=tab][aria-selected=true]{color:var(--sl-color-white);border-color:var(--sl-color-text-accent);font-weight:600}.tablist-wrapper:where(.astro-esqgolmp)~[role=tabpanel]{margin-top:1rem}
|
||
.sl-link-card:where(.astro-mf7fz2mj){display:grid;grid-template-columns:1fr auto;gap:.5rem;border:1px solid var(--sl-color-gray-5);border-radius:.5rem;padding:1rem;box-shadow:var(--sl-shadow-sm);position:relative}a:where(.astro-mf7fz2mj){text-decoration:none;line-height:var(--sl-line-height-headings)}a:where(.astro-mf7fz2mj):before{content:"";position:absolute;inset:0}.stack:where(.astro-mf7fz2mj){flex-direction:column;gap:.5rem}.title:where(.astro-mf7fz2mj){color:var(--sl-color-white);font-weight:600;font-size:var(--sl-text-lg)}.description:where(.astro-mf7fz2mj){color:var(--sl-color-gray-3);line-height:1.5}.icon:where(.astro-mf7fz2mj){color:var(--sl-color-gray-3)}.sl-link-card:where(.astro-mf7fz2mj):hover{background:var(--sl-color-gray-7, var(--sl-color-gray-6));border-color:var(--sl-color-gray-2)}.sl-link-card:where(.astro-mf7fz2mj):hover .icon:where(.astro-mf7fz2mj){color:var(--sl-color-white)}
|
||
.sl-steps{--bullet-size: calc(var(--sl-line-height) * 1rem);--bullet-margin: .375rem;list-style:none;padding-inline-start:0}.sl-steps>li{position:relative;padding-inline-start:calc(var(--bullet-size) + 1rem);padding-bottom:1px;min-height:calc(var(--bullet-size) + var(--bullet-margin))}.sl-steps>li+li{margin-top:0}.sl-steps>li:before{content:counter(list-item);position:absolute;top:0;inset-inline-start:0;width:var(--bullet-size);height:var(--bullet-size);line-height:var(--bullet-size);font-size:var(--sl-text-xs);font-weight:600;text-align:center;color:var(--sl-color-white);background-color:var(--sl-color-gray-6);border-radius:99rem;box-shadow:inset 0 0 0 1px var(--sl-color-gray-5)}.sl-steps>li:not(:last-of-type):after{--guide-width: 1px;content:"";position:absolute;top:calc(var(--bullet-size) + var(--bullet-margin));bottom:var(--bullet-margin);inset-inline-start:calc((var(--bullet-size) - var(--guide-width)) / 2);width:var(--guide-width);background-color:var(--sl-color-hairline-light)}.sl-steps>li>:first-child{--lh: calc(1em * var(--sl-line-height));--shift-y: calc(.5 * (var(--bullet-size) - var(--lh)));transform:translateY(var(--shift-y));margin-bottom:var(--shift-y)}.sl-steps>li>:first-child:where(h1,h2,h3,h4,h5,h6){--lh: calc(1em * var(--sl-line-height-headings))}@supports (--prop: 1lh){.sl-steps>li>:first-child{--lh: 1lh}}
|
||
starlight-file-tree:where(.astro-p67cqifm){--x-space: 1.5rem;--y-space: .125rem;--y-pad: 0;display:block;border:1px solid var(--sl-color-gray-5);padding:1rem;background-color:var(--sl-color-gray-6);font-size:var(--sl-text-xs);font-family:var(--__sl-font-mono);overflow-x:auto}starlight-file-tree:where(.astro-p67cqifm) .directory>details{border:0;padding:0;padding-inline-start:var(--x-space);background:transparent}starlight-file-tree:where(.astro-p67cqifm) .directory>details>summary{margin-inline-start:calc(-1 * var(--x-space));border:0;padding:var(--y-pad) .625rem;font-weight:400;color:var(--sl-color-white);max-width:100%}starlight-file-tree:where(.astro-p67cqifm) .directory>details>summary::marker,starlight-file-tree:where(.astro-p67cqifm) .directory>details>summary::-webkit-details-marker{color:var(--sl-color-gray-3)}starlight-file-tree:where(.astro-p67cqifm) .directory>details>summary:hover,starlight-file-tree:where(.astro-p67cqifm) .directory>details>summary:hover .tree-icon{cursor:pointer;color:var(--sl-color-text-accent);fill:var(--sl-color-text-accent)}starlight-file-tree:where(.astro-p67cqifm) .directory>details>summary:hover~ul{border-color:var(--sl-color-gray-4)}starlight-file-tree:where(.astro-p67cqifm) .directory>details>summary:hover .highlight .tree-icon{fill:var(--sl-color-text-invert)}starlight-file-tree:where(.astro-p67cqifm) ul{margin-inline-start:.5rem;border-inline-start:1px solid var(--sl-color-gray-5);padding:0;padding-inline-start:.125rem;list-style:none}starlight-file-tree:where(.astro-p67cqifm)>ul{margin:0;border:0;padding:0}starlight-file-tree:where(.astro-p67cqifm) li{margin:var(--y-space) 0;padding:var(--y-pad) 0}starlight-file-tree:where(.astro-p67cqifm) .file{margin-inline-start:calc(var(--x-space) - .125rem);color:var(--sl-color-white)}starlight-file-tree:where(.astro-p67cqifm) .tree-entry{display:inline-flex;align-items:flex-start;flex-wrap:wrap;max-width:calc(100% - 1rem)}@media (min-width: 30em){starlight-file-tree:where(.astro-p67cqifm) .tree-entry{flex-wrap:nowrap}}starlight-file-tree:where(.astro-p67cqifm) .tree-entry>:first-child{flex-shrink:0}starlight-file-tree:where(.astro-p67cqifm) .empty{color:var(--sl-color-gray-3);padding-inline-start:.375rem}starlight-file-tree:where(.astro-p67cqifm) .comment{color:var(--sl-color-gray-3);padding-inline-start:1.625rem;max-width:24rem;min-width:12rem}starlight-file-tree:where(.astro-p67cqifm) .highlight{display:inline-block;border-radius:.25rem;padding-inline-end:.5rem;color:var(--sl-color-text-invert);background-color:var(--sl-color-text-accent)}starlight-file-tree:where(.astro-p67cqifm) svg{display:inline;fill:var(--sl-color-gray-3);vertical-align:middle;margin-inline:.25rem .375rem;width:.875rem;height:.875rem}starlight-file-tree:where(.astro-p67cqifm) .highlight svg.tree-icon{fill:var(--sl-color-text-invert)}
|
||
</style><script type="module" src="/_astro/hoisted.Cn8DqOkI.js"></script>
|
||
<script type="module" src="/_astro/page.LS5KDvwX.js"></script><script src="/_astro/Tabs.astro_astro_type_script_index_0_lang.CCIyraCc.js" type="module"></script></head> <body class="astro-bguv2lll"> <a href="#_top" class="astro-7q3lir66">Skip to content</a> <div class="page sl-flex astro-vrdttmbt"> <header class="header astro-vrdttmbt"><div class="header sl-flex astro-kmkmnagf"> <div class="title-wrapper sl-flex astro-kmkmnagf"> <a href="/" class="site-title sl-flex astro-m46x6ez3"> <img class="astro-m46x6ez3" alt="" src="/_astro/navbar-icon.Bha2ncEb.png" width="1080" height="1080"> <span class="sr-only astro-m46x6ez3"> sern </span> </a> <starlight-select class="md:hidden"><label class="align-center relative ml-4 flex items-center gap-4 text-[var(--sl-color-white)]"><select class="cursor-pointer appearance-none bg-transparent py-2 pe-6 font-semibold text-[var(--sl-color-white)]"><option value="" disabled selected>Menu</option><option value="/v4/reference/getting-started">Docs</option><option value="/plugins">Plugins</option><option value="/sponsors">Sponsors</option><option value="/blog">Blog</option></select><svg aria-hidden="true" class="pointer-events-none absolute end-0 top-1/2 h-6 w-6 -translate-y-1/2 astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M17 9.17a1 1 0 0 0-1.41 0L12 12.71 8.46 9.17a1 1 0 1 0-1.41 1.42l4.24 4.24a1.002 1.002 0 0 0 1.42 0L17 10.59a1.002 1.002 0 0 0 0-1.42Z"/></svg> </label></starlight-select><nav class="hidden items-center gap-4 ps-4 md:flex"><a class="font-semibold text-[var(--sl-color-text-accent)] no-underline" href="/v4/reference/getting-started">Docs</a><a class="font-semibold text-[var(--sl-color-text-accent)] no-underline" href="/plugins">Plugins</a><a class="font-semibold text-[var(--sl-color-text-accent)] no-underline" href="/sponsors">Sponsors</a><a class="font-semibold text-[var(--sl-color-text-accent)] no-underline" href="/blog">Blog</a></nav> </div> <div class="sl-flex astro-kmkmnagf"> <site-search data-translations="{"placeholder":"Search"}" class="astro-v37mnknz"> <button data-open-modal disabled class="astro-v37mnknz"> <svg aria-label="Search" class="astro-v37mnknz astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M21.71 20.29 18 16.61A9 9 0 1 0 16.61 18l3.68 3.68a.999.999 0 0 0 1.42 0 1 1 0 0 0 0-1.39ZM11 18a7 7 0 1 1 0-14 7 7 0 0 1 0 14Z"/></svg> <span class="sl-hidden md:sl-block astro-v37mnknz" aria-hidden="true">Search</span> <svg aria-label="(Press / to Search)" class="sl-hidden md:sl-block astro-v37mnknz astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M17 2H7a5 5 0 0 0-5 5v10a5 5 0 0 0 5 5h10a5 5 0 0 0 5-5V7a5 5 0 0 0-5-5Zm3 15a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v10Z"/><path d="M15.293 6.707a1 1 0 1 1 1.414 1.414l-8.485 8.486a1 1 0 0 1-1.414-1.415l8.485-8.485Z"/></svg> </button> <dialog style="padding:0" aria-label="Search" class="astro-v37mnknz"> <div class="dialog-frame sl-flex astro-v37mnknz"> <button data-close-modal class="sl-flex md:sl-hidden astro-v37mnknz"> Cancel </button> <div class="search-container astro-v37mnknz"> <div id="starlight__search" class="astro-v37mnknz"></div> </div> </div> </dialog> </site-search> </div> <div class="sl-hidden md:sl-flex right-group astro-kmkmnagf"> <div class="sl-flex social-icons astro-kmkmnagf"> <a href="https://github.com/sern-handler" rel="me" class="sl-flex astro-wy4te6ga"><span class="sr-only astro-wy4te6ga">GitHub</span><svg aria-hidden="true" class="astro-wy4te6ga astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M12 .3a12 12 0 0 0-3.8 23.38c.6.12.83-.26.83-.57L9 21.07c-3.34.72-4.04-1.61-4.04-1.61-.55-1.39-1.34-1.76-1.34-1.76-1.08-.74.09-.73.09-.73 1.2.09 1.83 1.24 1.83 1.24 1.08 1.83 2.81 1.3 3.5 1 .1-.78.42-1.31.76-1.61-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.14-.3-.54-1.52.1-3.18 0 0 1-.32 3.3 1.23a11.5 11.5 0 0 1 6 0c2.28-1.55 3.29-1.23 3.29-1.23.64 1.66.24 2.88.12 3.18a4.65 4.65 0 0 1 1.23 3.22c0 4.61-2.8 5.63-5.48 5.92.42.36.81 1.1.81 2.22l-.01 3.29c0 .31.2.69.82.57A12 12 0 0 0 12 .3Z"/></svg> </a><a href="https://discord.gg/DwbF5H5JgQ" rel="me" class="sl-flex astro-wy4te6ga"><span class="sr-only astro-wy4te6ga">Discord</span><svg aria-hidden="true" class="astro-wy4te6ga astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M20.32 4.37a19.8 19.8 0 0 0-4.93-1.51 13.78 13.78 0 0 0-.64 1.28 18.27 18.27 0 0 0-5.5 0 12.64 12.64 0 0 0-.64-1.28h-.05A19.74 19.74 0 0 0 3.64 4.4 20.26 20.26 0 0 0 .11 18.09l.02.02a19.9 19.9 0 0 0 6.04 3.03l.04-.02a14.24 14.24 0 0 0 1.23-2.03.08.08 0 0 0-.05-.07 13.1 13.1 0 0 1-1.9-.92.08.08 0 0 1 .02-.1 10.2 10.2 0 0 0 .41-.31h.04a14.2 14.2 0 0 0 12.1 0l.04.01a9.63 9.63 0 0 0 .4.32.08.08 0 0 1-.03.1 12.29 12.29 0 0 1-1.9.91.08.08 0 0 0-.02.1 15.97 15.97 0 0 0 1.27 2.01h.04a19.84 19.84 0 0 0 6.03-3.05v-.03a20.12 20.12 0 0 0-3.57-13.69ZM8.02 15.33c-1.18 0-2.16-1.08-2.16-2.42 0-1.33.96-2.42 2.16-2.42 1.21 0 2.18 1.1 2.16 2.42 0 1.34-.96 2.42-2.16 2.42Zm7.97 0c-1.18 0-2.15-1.08-2.15-2.42 0-1.33.95-2.42 2.15-2.42 1.22 0 2.18 1.1 2.16 2.42 0 1.34-.94 2.42-2.16 2.42Z"/></svg> </a> </div> <starlight-theme-select> <label style="--sl-select-width: 6.25em" class="astro-4yphtoen"> <span class="sr-only astro-4yphtoen">Select theme</span> <svg aria-hidden="true" class="icon label-icon astro-4yphtoen astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M21 14h-1V7a3 3 0 0 0-3-3H7a3 3 0 0 0-3 3v7H3a1 1 0 0 0-1 1v2a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-2a1 1 0 0 0-1-1ZM6 7a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v7H6V7Zm14 10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-1h16v1Z"/></svg> <select value="auto" class="astro-4yphtoen"> <option value="dark" class="astro-4yphtoen">Dark</option><option value="light" class="astro-4yphtoen">Light</option><option value="auto" selected="true" class="astro-4yphtoen">Auto</option> </select> <svg aria-hidden="true" class="icon caret astro-4yphtoen astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M17 9.17a1 1 0 0 0-1.41 0L12 12.71 8.46 9.17a1 1 0 1 0-1.41 1.42l4.24 4.24a1.002 1.002 0 0 0 1.42 0L17 10.59a1.002 1.002 0 0 0 0-1.42Z"/></svg> </label> </starlight-theme-select> <script>
|
||
StarlightThemeProvider.updatePickers();
|
||
</script> <starlight-lang-select><label style="--sl-select-width: 7em" class="astro-4yphtoen"> <span class="sr-only astro-4yphtoen">Select language</span> <svg aria-hidden="true" class="icon label-icon astro-4yphtoen astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path fill-rule="evenodd" d="M8.516 3a.94.94 0 0 0-.941.94v1.15H2.94a.94.94 0 1 0 0 1.882h7.362a7.422 7.422 0 0 1-1.787 3.958 7.42 7.42 0 0 1-1.422-2.425.94.94 0 1 0-1.774.627 9.303 9.303 0 0 0 1.785 3.043 7.422 7.422 0 0 1-4.164 1.278.94.94 0 1 0 0 1.881 9.303 9.303 0 0 0 5.575-1.855 9.303 9.303 0 0 0 4.11 1.74l-.763 1.525a.968.968 0 0 0-.016.034l-1.385 2.77a.94.94 0 1 0 1.683.841l1.133-2.267h5.806l1.134 2.267a.94.94 0 0 0 1.683-.841l-1.385-2.769a.95.95 0 0 0-.018-.036l-3.476-6.951a.94.94 0 0 0-1.682 0l-1.82 3.639a7.423 7.423 0 0 1-3.593-1.256 9.303 9.303 0 0 0 2.27-5.203h1.894a.94.94 0 0 0 0-1.881H9.456V3.94A.94.94 0 0 0 8.516 3Zm6.426 11.794a1.068 1.068 0 0 1-.02.039l-.703 1.407h3.924l-1.962-3.924-1.24 2.478Z" clip-rule="evenodd"/></svg> <select value="/v4/reference/plugins/" class="astro-4yphtoen"> <option value="/v4/reference/plugins/" class="astro-4yphtoen">English</option><option value="/es/v4/reference/plugins/" class="astro-4yphtoen">Español</option><option value="/tr/v4/reference/plugins/" class="astro-4yphtoen">Türkçe</option> </select> <svg aria-hidden="true" class="icon caret astro-4yphtoen astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M17 9.17a1 1 0 0 0-1.41 0L12 12.71 8.46 9.17a1 1 0 1 0-1.41 1.42l4.24 4.24a1.002 1.002 0 0 0 1.42 0L17 10.59a1.002 1.002 0 0 0 0-1.42Z"/></svg> </label> </starlight-lang-select> </div> </div> </header> <nav class="sidebar astro-vrdttmbt" aria-label="Main"> <starlight-menu-button class="astro-jif73yzw"> <button aria-expanded="false" aria-label="Menu" aria-controls="starlight__sidebar" class="sl-flex md:sl-hidden astro-jif73yzw"> <svg aria-hidden="true" class="astro-jif73yzw astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M3 8h18a1 1 0 1 0 0-2H3a1 1 0 0 0 0 2Zm18 8H3a1 1 0 0 0 0 2h18a1 1 0 0 0 0-2Zm0-5H3a1 1 0 0 0 0 2h18a1 1 0 0 0 0-2Z"/></svg> </button> </starlight-menu-button> <div id="starlight__sidebar" class="sidebar-pane astro-vrdttmbt"> <div class="sidebar-content sl-flex astro-vrdttmbt"> <starlight-multi-sidebar-select class="astro-kcgrvcei"><label class="astro-kcgrvcei"><span class="sr-only astro-kcgrvcei">Menu</span><select class="astro-kcgrvcei"><option value="v4" selected="true" class="astro-kcgrvcei">v4</option><option value="v3" class="astro-kcgrvcei">v3</option></select><svg aria-hidden="true" class="icon astro-kcgrvcei astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M17 9.17a1 1 0 0 0-1.41 0L12 12.71 8.46 9.17a1 1 0 1 0-1.41 1.42l4.24 4.24a1.002 1.002 0 0 0 1.42 0L17 10.59a1.002 1.002 0 0 0 0-1.42Z"/></svg> </label><div data-starlight-multi-sidebar-label="v4" class="astro-kcgrvcei"><ul class="top-level astro-3ii7xxms"> <li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">API</span> <span class="sl-badge default astro-vohx2lp7">Generated</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Namespaces</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Presence</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">interfaces</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v4/api/namespaces/presence/interfaces/result/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Result</span> </a> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">type-aliases</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v4/api/namespaces/presence/type-aliases/config/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Config</span> </a> </li> </ul> </details> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Sern</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">functions</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v4/api/namespaces/sern/functions/init/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">init</span> </a> </li> </ul> </details> </li> </ul> </details> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Enumerations</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v4/api/enumerations/commandtype/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">CommandType</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/enumerations/eventtype/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">EventType</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/enumerations/payloadtype/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">PayloadType</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/enumerations/plugintype/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">PluginType</span> </a> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Classes</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v4/api/classes/context/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Context</span> </a> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Interfaces</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/bothcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">BothCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/buttoncommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">ButtonCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/channelselectcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">ChannelSelectCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/commandmoduledefs/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">CommandModuleDefs</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/contextmenumsg/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">ContextMenuMsg</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/contextmenuuser/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">ContextMenuUser</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/controlplugin/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">ControlPlugin</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/coredependencies/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">CoreDependencies</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/discordeventcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">DiscordEventCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/disposable/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Disposable</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/emitter/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Emitter</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/errorhandling/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">ErrorHandling</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/eventmoduledefs/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">EventModuleDefs</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/externaleventcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">ExternalEventCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/init/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Init</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/initplugin/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">InitPlugin</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/logging/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Logging</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/mentionableselectcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">MentionableSelectCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/modalsubmitcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">ModalSubmitCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/module/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Module</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/plugin/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Plugin</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/roleselectcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">RoleSelectCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/scheduledtask/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">ScheduledTask</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/sdt/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">SDT</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/sernautocompletedata/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">SernAutocompleteData</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/serneventcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">SernEventCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/serneventsmapping/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">SernEventsMapping</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/sernsubcommanddata/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">SernSubCommandData</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/sernsubcommandgroupdata/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">SernSubCommandGroupData</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/slashcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">SlashCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/stringselectcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">StringSelectCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/textcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">TextCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/userselectcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">UserSelectCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/interfaces/wrapper/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Wrapper</span> </a> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Type Aliases</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v4/api/type-aliases/anyplugin/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">AnyPlugin</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/type-aliases/commandmodule/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">CommandModule</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/type-aliases/controller/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Controller</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/type-aliases/eventmodule/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">EventModule</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/type-aliases/logpayload/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">LogPayload</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/type-aliases/payload/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Payload</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/type-aliases/pluginresult/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">PluginResult</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/type-aliases/sernoptionsdata/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">SernOptionsData</span> </a> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Variables</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v4/api/variables/controller/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">controller</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/variables/presence/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Presence</span> </a> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Functions</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v4/api/functions/commandcontrolplugin/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">CommandControlPlugin</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/functions/commandinitplugin/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">CommandInitPlugin</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/functions/commandmodule/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">commandModule</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/functions/discordevent/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">discordEvent</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/functions/eventinitplugin/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">EventInitPlugin</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/functions/eventmodule/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">eventModule</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/functions/makedependencies/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">makeDependencies</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/functions/makeplugin/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">makePlugin</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/functions/scheduledtask/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">scheduledTask</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/functions/service/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Service</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/functions/services/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Services</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/functions/single/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">single</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/api/functions/transient/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">transient</span> </a> </li> </ul> </details> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details open class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">CLI</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v4/cli/about/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">About the CLI</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/cli/build/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Build</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/cli/clear/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Clear</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/cli/extra/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Extra</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/cli/publish/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Publish</span> </a> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details open class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Reference</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v4/reference/getting-started/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Quickstart Guide</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/reference/config/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Config</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/reference/tasks/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Tasks</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/reference/project-layout/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Project Layout</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/reference/modules/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Modules</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/reference/plugins/" aria-current="page" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Plugins</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/reference/presence/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Presence</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/reference/dependencies/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Dependencies</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/reference/autocomplete/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Autocomplete</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/reference/error-handling/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Error Handling</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/reference/conclusion/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Conclusion</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/reference/goal/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Goal</span> </a> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details open class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Snippets</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v4/snippets/command/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Command</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/snippets/event/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Event</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/snippets/plugin/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Plugins</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/snippets/presence/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Presence</span> </a> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details open class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Transition</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v4/transition/from-v3/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Updating your sern app</span> </a> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details open class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Tools</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v4/tools/publisher/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Publisher</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v4/tools/localizer/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Localizer</span> </a> </li> </ul> </details> </li> </ul> <div class="md:sl-hidden"> <div class="mobile-preferences sl-flex astro-wu23bvmt"> <div class="sl-flex social-icons astro-wu23bvmt"> <a href="https://github.com/sern-handler" rel="me" class="sl-flex astro-wy4te6ga"><span class="sr-only astro-wy4te6ga">GitHub</span><svg aria-hidden="true" class="astro-wy4te6ga astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M12 .3a12 12 0 0 0-3.8 23.38c.6.12.83-.26.83-.57L9 21.07c-3.34.72-4.04-1.61-4.04-1.61-.55-1.39-1.34-1.76-1.34-1.76-1.08-.74.09-.73.09-.73 1.2.09 1.83 1.24 1.83 1.24 1.08 1.83 2.81 1.3 3.5 1 .1-.78.42-1.31.76-1.61-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.14-.3-.54-1.52.1-3.18 0 0 1-.32 3.3 1.23a11.5 11.5 0 0 1 6 0c2.28-1.55 3.29-1.23 3.29-1.23.64 1.66.24 2.88.12 3.18a4.65 4.65 0 0 1 1.23 3.22c0 4.61-2.8 5.63-5.48 5.92.42.36.81 1.1.81 2.22l-.01 3.29c0 .31.2.69.82.57A12 12 0 0 0 12 .3Z"/></svg> </a><a href="https://discord.gg/DwbF5H5JgQ" rel="me" class="sl-flex astro-wy4te6ga"><span class="sr-only astro-wy4te6ga">Discord</span><svg aria-hidden="true" class="astro-wy4te6ga astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M20.32 4.37a19.8 19.8 0 0 0-4.93-1.51 13.78 13.78 0 0 0-.64 1.28 18.27 18.27 0 0 0-5.5 0 12.64 12.64 0 0 0-.64-1.28h-.05A19.74 19.74 0 0 0 3.64 4.4 20.26 20.26 0 0 0 .11 18.09l.02.02a19.9 19.9 0 0 0 6.04 3.03l.04-.02a14.24 14.24 0 0 0 1.23-2.03.08.08 0 0 0-.05-.07 13.1 13.1 0 0 1-1.9-.92.08.08 0 0 1 .02-.1 10.2 10.2 0 0 0 .41-.31h.04a14.2 14.2 0 0 0 12.1 0l.04.01a9.63 9.63 0 0 0 .4.32.08.08 0 0 1-.03.1 12.29 12.29 0 0 1-1.9.91.08.08 0 0 0-.02.1 15.97 15.97 0 0 0 1.27 2.01h.04a19.84 19.84 0 0 0 6.03-3.05v-.03a20.12 20.12 0 0 0-3.57-13.69ZM8.02 15.33c-1.18 0-2.16-1.08-2.16-2.42 0-1.33.96-2.42 2.16-2.42 1.21 0 2.18 1.1 2.16 2.42 0 1.34-.96 2.42-2.16 2.42Zm7.97 0c-1.18 0-2.15-1.08-2.15-2.42 0-1.33.95-2.42 2.15-2.42 1.22 0 2.18 1.1 2.16 2.42 0 1.34-.94 2.42-2.16 2.42Z"/></svg> </a> </div> <starlight-theme-select> <label style="--sl-select-width: 6.25em" class="astro-4yphtoen"> <span class="sr-only astro-4yphtoen">Select theme</span> <svg aria-hidden="true" class="icon label-icon astro-4yphtoen astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M21 14h-1V7a3 3 0 0 0-3-3H7a3 3 0 0 0-3 3v7H3a1 1 0 0 0-1 1v2a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-2a1 1 0 0 0-1-1ZM6 7a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v7H6V7Zm14 10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-1h16v1Z"/></svg> <select value="auto" class="astro-4yphtoen"> <option value="dark" class="astro-4yphtoen">Dark</option><option value="light" class="astro-4yphtoen">Light</option><option value="auto" selected="true" class="astro-4yphtoen">Auto</option> </select> <svg aria-hidden="true" class="icon caret astro-4yphtoen astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M17 9.17a1 1 0 0 0-1.41 0L12 12.71 8.46 9.17a1 1 0 1 0-1.41 1.42l4.24 4.24a1.002 1.002 0 0 0 1.42 0L17 10.59a1.002 1.002 0 0 0 0-1.42Z"/></svg> </label> </starlight-theme-select> <script>
|
||
StarlightThemeProvider.updatePickers();
|
||
</script> <starlight-lang-select><label style="--sl-select-width: 7em" class="astro-4yphtoen"> <span class="sr-only astro-4yphtoen">Select language</span> <svg aria-hidden="true" class="icon label-icon astro-4yphtoen astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path fill-rule="evenodd" d="M8.516 3a.94.94 0 0 0-.941.94v1.15H2.94a.94.94 0 1 0 0 1.882h7.362a7.422 7.422 0 0 1-1.787 3.958 7.42 7.42 0 0 1-1.422-2.425.94.94 0 1 0-1.774.627 9.303 9.303 0 0 0 1.785 3.043 7.422 7.422 0 0 1-4.164 1.278.94.94 0 1 0 0 1.881 9.303 9.303 0 0 0 5.575-1.855 9.303 9.303 0 0 0 4.11 1.74l-.763 1.525a.968.968 0 0 0-.016.034l-1.385 2.77a.94.94 0 1 0 1.683.841l1.133-2.267h5.806l1.134 2.267a.94.94 0 0 0 1.683-.841l-1.385-2.769a.95.95 0 0 0-.018-.036l-3.476-6.951a.94.94 0 0 0-1.682 0l-1.82 3.639a7.423 7.423 0 0 1-3.593-1.256 9.303 9.303 0 0 0 2.27-5.203h1.894a.94.94 0 0 0 0-1.881H9.456V3.94A.94.94 0 0 0 8.516 3Zm6.426 11.794a1.068 1.068 0 0 1-.02.039l-.703 1.407h3.924l-1.962-3.924-1.24 2.478Z" clip-rule="evenodd"/></svg> <select value="/v4/reference/plugins/" class="astro-4yphtoen"> <option value="/v4/reference/plugins/" class="astro-4yphtoen">English</option><option value="/es/v4/reference/plugins/" class="astro-4yphtoen">Español</option><option value="/tr/v4/reference/plugins/" class="astro-4yphtoen">Türkçe</option> </select> <svg aria-hidden="true" class="icon caret astro-4yphtoen astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M17 9.17a1 1 0 0 0-1.41 0L12 12.71 8.46 9.17a1 1 0 1 0-1.41 1.42l4.24 4.24a1.002 1.002 0 0 0 1.42 0L17 10.59a1.002 1.002 0 0 0 0-1.42Z"/></svg> </label> </starlight-lang-select> </div> </div></div><div hidden data-starlight-multi-sidebar-label="v3" class="astro-kcgrvcei"><ul class="top-level astro-3ii7xxms"> <li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">API</span> <span class="sl-badge default astro-vohx2lp7">Generated</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Namespaces</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Presence</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">functions</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v3/api/namespaces/presence/functions/module/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">module</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/namespaces/presence/functions/of/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">of</span> </a> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">interfaces</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v3/api/namespaces/presence/interfaces/result/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Result</span> </a> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">type-aliases</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v3/api/namespaces/presence/type-aliases/config/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Config</span> </a> </li> </ul> </details> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Sern</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">functions</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v3/api/namespaces/sern/functions/init/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">init</span> </a> </li> </ul> </details> </li> </ul> </details> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Enumerations</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v3/api/enumerations/commandtype/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">CommandType</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/enumerations/eventtype/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">EventType</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/enumerations/payloadtype/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">PayloadType</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/enumerations/plugintype/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">PluginType</span> </a> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Classes</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v3/api/classes/context/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Context</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/classes/modulestore/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">ModuleStore</span> </a> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Interfaces</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/bothcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">BothCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/buttoncommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">ButtonCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/channelselectcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">ChannelSelectCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/commandmoduledefs/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">CommandModuleDefs</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/contextmenumsg/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">ContextMenuMsg</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/contextmenuuser/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">ContextMenuUser</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/controller/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Controller</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/controlplugin/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">ControlPlugin</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/coredependencies/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">CoreDependencies</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/coremodulestore/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">CoreModuleStore</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/discordeventcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">DiscordEventCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/disposable/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Disposable</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/emitter/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Emitter</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/errorhandling/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">ErrorHandling</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/eventmoduledefs/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">EventModuleDefs</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/externaleventcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">ExternalEventCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/init/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Init</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/initplugin/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">InitPlugin</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/logging/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Logging</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/mentionableselectcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">MentionableSelectCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/modalsubmitcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">ModalSubmitCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/plugin/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Plugin</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/roleselectcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">RoleSelectCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/sernautocompletedata/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">SernAutocompleteData</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/serneventcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">SernEventCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/serneventsmapping/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">SernEventsMapping</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/sernsubcommanddata/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">SernSubCommandData</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/sernsubcommandgroupdata/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">SernSubCommandGroupData</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/slashcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">SlashCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/stringselectcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">StringSelectCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/textcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">TextCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/userselectcommand/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">UserSelectCommand</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/interfaces/wrapper/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Wrapper</span> </a> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Type Aliases</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v3/api/type-aliases/anycommandplugin/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">AnyCommandPlugin</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/type-aliases/anyeventplugin/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">AnyEventPlugin</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/type-aliases/args/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Args</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/type-aliases/commandmodule/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">CommandModule</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/type-aliases/eventmodule/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">EventModule</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/type-aliases/initializable/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Initializable</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/type-aliases/logpayload/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">LogPayload</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/type-aliases/payload/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Payload</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/type-aliases/pluginresult/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">PluginResult</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/type-aliases/sernoptionsdata/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">SernOptionsData</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/type-aliases/singleton/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Singleton</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/type-aliases/slashoptions/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">SlashOptions</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/type-aliases/transient/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Transient</span> </a> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Variables</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v3/api/variables/controller/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">controller</span> </a> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Functions</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v3/api/functions/commandcontrolplugin/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">CommandControlPlugin</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/functions/commandinitplugin/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">CommandInitPlugin</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/functions/commandmodule/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">commandModule</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/functions/discordevent/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">discordEvent</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/functions/discordeventcontrolplugin/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">DiscordEventControlPlugin</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/functions/eventcontrolplugin/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">EventControlPlugin</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/functions/eventinitplugin/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">EventInitPlugin</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/functions/eventmodule/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">eventModule</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/functions/makedependencies/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">makeDependencies</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/functions/makeplugin/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">makePlugin</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/functions/service/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Service</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/functions/services/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Services</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/functions/single/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">single</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/api/functions/transient/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">transient</span> </a> </li> </ul> </details> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details open class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">CLI</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v3/cli/about/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">About the CLI</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/cli/build/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Build</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/cli/clear/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Clear</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/cli/extra/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Extra</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/cli/publish/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Publish</span> </a> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details open class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Guide</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <details open class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Getting Started</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v3/guide/getting-started/choose-ide/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Choosing an IDE</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/guide/getting-started/preparing/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Preparing to Code</span> </a> </li> </ul> </details> </li><li class="astro-3ii7xxms"> <details open class="astro-3ii7xxms"> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"> <span class="large astro-3ii7xxms">Walkthrough</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"> <a href="/v3/guide/walkthrough/goal/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Goal</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/guide/walkthrough/new-project/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">New Project</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/guide/walkthrough/cli/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">CLI</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/guide/walkthrough/transition/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Transition from v2 to v3</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/guide/walkthrough/first-command/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">First Command</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/guide/walkthrough/first-event/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">First Event</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/guide/walkthrough/plugins/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Plugins</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/guide/walkthrough/services/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Services</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/guide/walkthrough/autocomplete/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Autocomplete</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/guide/walkthrough/dependency-injection/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Dependency Injection</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/guide/walkthrough/sern-emitter/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Sern Emitter</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/guide/walkthrough/conclusion/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Conclusion</span> </a> </li><li class="astro-3ii7xxms"> <a href="/v3/guide/walkthrough/good-to-know/" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Good to Know</span> </a> </li> </ul> </details> </li> </ul> </details> </li> </ul> <div class="md:sl-hidden"> <div class="mobile-preferences sl-flex astro-wu23bvmt"> <div class="sl-flex social-icons astro-wu23bvmt"> <a href="https://github.com/sern-handler" rel="me" class="sl-flex astro-wy4te6ga"><span class="sr-only astro-wy4te6ga">GitHub</span><svg aria-hidden="true" class="astro-wy4te6ga astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M12 .3a12 12 0 0 0-3.8 23.38c.6.12.83-.26.83-.57L9 21.07c-3.34.72-4.04-1.61-4.04-1.61-.55-1.39-1.34-1.76-1.34-1.76-1.08-.74.09-.73.09-.73 1.2.09 1.83 1.24 1.83 1.24 1.08 1.83 2.81 1.3 3.5 1 .1-.78.42-1.31.76-1.61-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.14-.3-.54-1.52.1-3.18 0 0 1-.32 3.3 1.23a11.5 11.5 0 0 1 6 0c2.28-1.55 3.29-1.23 3.29-1.23.64 1.66.24 2.88.12 3.18a4.65 4.65 0 0 1 1.23 3.22c0 4.61-2.8 5.63-5.48 5.92.42.36.81 1.1.81 2.22l-.01 3.29c0 .31.2.69.82.57A12 12 0 0 0 12 .3Z"/></svg> </a><a href="https://discord.gg/DwbF5H5JgQ" rel="me" class="sl-flex astro-wy4te6ga"><span class="sr-only astro-wy4te6ga">Discord</span><svg aria-hidden="true" class="astro-wy4te6ga astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M20.32 4.37a19.8 19.8 0 0 0-4.93-1.51 13.78 13.78 0 0 0-.64 1.28 18.27 18.27 0 0 0-5.5 0 12.64 12.64 0 0 0-.64-1.28h-.05A19.74 19.74 0 0 0 3.64 4.4 20.26 20.26 0 0 0 .11 18.09l.02.02a19.9 19.9 0 0 0 6.04 3.03l.04-.02a14.24 14.24 0 0 0 1.23-2.03.08.08 0 0 0-.05-.07 13.1 13.1 0 0 1-1.9-.92.08.08 0 0 1 .02-.1 10.2 10.2 0 0 0 .41-.31h.04a14.2 14.2 0 0 0 12.1 0l.04.01a9.63 9.63 0 0 0 .4.32.08.08 0 0 1-.03.1 12.29 12.29 0 0 1-1.9.91.08.08 0 0 0-.02.1 15.97 15.97 0 0 0 1.27 2.01h.04a19.84 19.84 0 0 0 6.03-3.05v-.03a20.12 20.12 0 0 0-3.57-13.69ZM8.02 15.33c-1.18 0-2.16-1.08-2.16-2.42 0-1.33.96-2.42 2.16-2.42 1.21 0 2.18 1.1 2.16 2.42 0 1.34-.96 2.42-2.16 2.42Zm7.97 0c-1.18 0-2.15-1.08-2.15-2.42 0-1.33.95-2.42 2.15-2.42 1.22 0 2.18 1.1 2.16 2.42 0 1.34-.94 2.42-2.16 2.42Z"/></svg> </a> </div> <starlight-theme-select> <label style="--sl-select-width: 6.25em" class="astro-4yphtoen"> <span class="sr-only astro-4yphtoen">Select theme</span> <svg aria-hidden="true" class="icon label-icon astro-4yphtoen astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M21 14h-1V7a3 3 0 0 0-3-3H7a3 3 0 0 0-3 3v7H3a1 1 0 0 0-1 1v2a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-2a1 1 0 0 0-1-1ZM6 7a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v7H6V7Zm14 10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-1h16v1Z"/></svg> <select value="auto" class="astro-4yphtoen"> <option value="dark" class="astro-4yphtoen">Dark</option><option value="light" class="astro-4yphtoen">Light</option><option value="auto" selected="true" class="astro-4yphtoen">Auto</option> </select> <svg aria-hidden="true" class="icon caret astro-4yphtoen astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M17 9.17a1 1 0 0 0-1.41 0L12 12.71 8.46 9.17a1 1 0 1 0-1.41 1.42l4.24 4.24a1.002 1.002 0 0 0 1.42 0L17 10.59a1.002 1.002 0 0 0 0-1.42Z"/></svg> </label> </starlight-theme-select> <script>
|
||
StarlightThemeProvider.updatePickers();
|
||
</script> <starlight-lang-select><label style="--sl-select-width: 7em" class="astro-4yphtoen"> <span class="sr-only astro-4yphtoen">Select language</span> <svg aria-hidden="true" class="icon label-icon astro-4yphtoen astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path fill-rule="evenodd" d="M8.516 3a.94.94 0 0 0-.941.94v1.15H2.94a.94.94 0 1 0 0 1.882h7.362a7.422 7.422 0 0 1-1.787 3.958 7.42 7.42 0 0 1-1.422-2.425.94.94 0 1 0-1.774.627 9.303 9.303 0 0 0 1.785 3.043 7.422 7.422 0 0 1-4.164 1.278.94.94 0 1 0 0 1.881 9.303 9.303 0 0 0 5.575-1.855 9.303 9.303 0 0 0 4.11 1.74l-.763 1.525a.968.968 0 0 0-.016.034l-1.385 2.77a.94.94 0 1 0 1.683.841l1.133-2.267h5.806l1.134 2.267a.94.94 0 0 0 1.683-.841l-1.385-2.769a.95.95 0 0 0-.018-.036l-3.476-6.951a.94.94 0 0 0-1.682 0l-1.82 3.639a7.423 7.423 0 0 1-3.593-1.256 9.303 9.303 0 0 0 2.27-5.203h1.894a.94.94 0 0 0 0-1.881H9.456V3.94A.94.94 0 0 0 8.516 3Zm6.426 11.794a1.068 1.068 0 0 1-.02.039l-.703 1.407h3.924l-1.962-3.924-1.24 2.478Z" clip-rule="evenodd"/></svg> <select value="/v4/reference/plugins/" class="astro-4yphtoen"> <option value="/v4/reference/plugins/" class="astro-4yphtoen">English</option><option value="/es/v4/reference/plugins/" class="astro-4yphtoen">Español</option><option value="/tr/v4/reference/plugins/" class="astro-4yphtoen">Türkçe</option> </select> <svg aria-hidden="true" class="icon caret astro-4yphtoen astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M17 9.17a1 1 0 0 0-1.41 0L12 12.71 8.46 9.17a1 1 0 1 0-1.41 1.42l4.24 4.24a1.002 1.002 0 0 0 1.42 0L17 10.59a1.002 1.002 0 0 0 0-1.42Z"/></svg> </label> </starlight-lang-select> </div> </div></div></starlight-multi-sidebar-select> </div> </div> </nav> <div class="main-frame astro-vrdttmbt"> <div class="lg:sl-flex astro-67yu43on"> <aside class="right-sidebar-container astro-67yu43on"> <div class="right-sidebar astro-67yu43on"> <div class="lg:sl-hidden astro-pb3aqygn"><mobile-starlight-toc data-min-h="2" data-max-h="3" class="astro-doynk5tl"><nav aria-labelledby="starlight__on-this-page--mobile" class="astro-doynk5tl"><details id="starlight__mobile-toc" class="astro-doynk5tl"><summary id="starlight__on-this-page--mobile" class="sl-flex astro-doynk5tl"><div class="toggle sl-flex astro-doynk5tl">On this page<svg aria-hidden="true" class="caret astro-doynk5tl astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg> </div><span class="display-current astro-doynk5tl"></span></summary><div class="dropdown astro-doynk5tl"><ul class="isMobile astro-g2bywc46" style="--depth: 0;"> <li class="astro-g2bywc46" style="--depth: 0;"> <a href="#_top" class="astro-g2bywc46" style="--depth: 0;"> <span class="astro-g2bywc46" style="--depth: 0;">Overview</span> </a> </li><li class="astro-g2bywc46" style="--depth: 0;"> <a href="#installation" class="astro-g2bywc46" style="--depth: 0;"> <span class="astro-g2bywc46" style="--depth: 0;">Installation</span> </a> </li><li class="astro-g2bywc46" style="--depth: 0;"> <a href="#creating-plugins" class="astro-g2bywc46" style="--depth: 0;"> <span class="astro-g2bywc46" style="--depth: 0;">Creating Plugins</span> </a> </li><li class="astro-g2bywc46" style="--depth: 0;"> <a href="#init-plugins" class="astro-g2bywc46" style="--depth: 0;"> <span class="astro-g2bywc46" style="--depth: 0;">Init Plugins</span> </a> <ul class="isMobile astro-g2bywc46" style="--depth: 1;"> <li class="astro-g2bywc46" style="--depth: 1;"> <a href="#user-data" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">User Data</span> </a> </li> </ul> </li><li class="astro-g2bywc46" style="--depth: 0;"> <a href="#control-plugins" class="astro-g2bywc46" style="--depth: 0;"> <span class="astro-g2bywc46" style="--depth: 0;">Control Plugins</span> </a> <ul class="isMobile astro-g2bywc46" style="--depth: 1;"> <li class="astro-g2bywc46" style="--depth: 1;"> <a href="#controller-object" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">Controller Object</span> </a> </li><li class="astro-g2bywc46" style="--depth: 1;"> <a href="#state" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">State</span> </a> </li><li class="astro-g2bywc46" style="--depth: 1;"> <a href="#dependencies" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">Dependencies</span> </a> </li> </ul> </li> </ul> </div></details></nav></mobile-starlight-toc></div><div class="right-sidebar-panel sl-hidden lg:sl-block astro-pb3aqygn"><div class="sl-container astro-pb3aqygn"><starlight-toc data-min-h="2" data-max-h="3"><nav aria-labelledby="starlight__on-this-page"><h2 id="starlight__on-this-page">On this page</h2><ul class="astro-g2bywc46" style="--depth: 0;"> <li class="astro-g2bywc46" style="--depth: 0;"> <a href="#_top" class="astro-g2bywc46" style="--depth: 0;"> <span class="astro-g2bywc46" style="--depth: 0;">Overview</span> </a> </li><li class="astro-g2bywc46" style="--depth: 0;"> <a href="#installation" class="astro-g2bywc46" style="--depth: 0;"> <span class="astro-g2bywc46" style="--depth: 0;">Installation</span> </a> </li><li class="astro-g2bywc46" style="--depth: 0;"> <a href="#creating-plugins" class="astro-g2bywc46" style="--depth: 0;"> <span class="astro-g2bywc46" style="--depth: 0;">Creating Plugins</span> </a> </li><li class="astro-g2bywc46" style="--depth: 0;"> <a href="#init-plugins" class="astro-g2bywc46" style="--depth: 0;"> <span class="astro-g2bywc46" style="--depth: 0;">Init Plugins</span> </a> <ul class="astro-g2bywc46" style="--depth: 1;"> <li class="astro-g2bywc46" style="--depth: 1;"> <a href="#user-data" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">User Data</span> </a> </li> </ul> </li><li class="astro-g2bywc46" style="--depth: 0;"> <a href="#control-plugins" class="astro-g2bywc46" style="--depth: 0;"> <span class="astro-g2bywc46" style="--depth: 0;">Control Plugins</span> </a> <ul class="astro-g2bywc46" style="--depth: 1;"> <li class="astro-g2bywc46" style="--depth: 1;"> <a href="#controller-object" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">Controller Object</span> </a> </li><li class="astro-g2bywc46" style="--depth: 1;"> <a href="#state" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">State</span> </a> </li><li class="astro-g2bywc46" style="--depth: 1;"> <a href="#dependencies" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">Dependencies</span> </a> </li> </ul> </li> </ul> </nav></starlight-toc></div></div> </div> </aside> <div class="main-pane astro-67yu43on"> <main data-pagefind-body lang="en" dir="ltr" class="astro-bguv2lll"> <div class="content-panel astro-7nkwcw3z"> <div class="sl-container astro-7nkwcw3z"> <h1 id="_top" class="astro-j6tvhyss">Plugins</h1> </div> </div> <div class="content-panel astro-7nkwcw3z"> <div class="sl-container astro-7nkwcw3z"> <div class="sl-markdown-content"> <aside aria-label="Tip" class="starlight-aside starlight-aside--tip"><p class="starlight-aside__title" aria-hidden="true"><svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" class="starlight-aside__icon"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.43909 8.85483L1.44039 8.85354L4.96668 5.33815C5.30653 4.99386 5.7685 4.79662 6.2524 4.78972L6.26553 4.78963L12.9014 4.78962L13.8479 3.84308C16.9187 0.772319 20.0546 0.770617 21.4678 0.975145C21.8617 1.02914 22.2271 1.21053 22.5083 1.4917C22.7894 1.77284 22.9708 2.13821 23.0248 2.53199C23.2294 3.94517 23.2278 7.08119 20.1569 10.1521L19.2107 11.0983V17.7338L19.2106 17.7469C19.2037 18.2308 19.0067 18.6933 18.6624 19.0331L15.1456 22.5608C14.9095 22.7966 14.6137 22.964 14.29 23.0449C13.9663 23.1259 13.6267 23.1174 13.3074 23.0204C12.9881 22.9235 12.7011 22.7417 12.4771 22.4944C12.2533 22.2473 12.1006 21.9441 12.0355 21.6171L11.1783 17.3417L6.65869 12.822L4.34847 12.3589L2.38351 11.965C2.05664 11.8998 1.75272 11.747 1.50564 11.5232C1.25835 11.2992 1.07653 11.0122 0.979561 10.6929C0.882595 10.3736 0.874125 10.034 0.955057 9.7103C1.03599 9.38659 1.20328 9.09092 1.43909 8.85483ZM6.8186 10.8724L2.94619 10.096L6.32006 6.73268H10.9583L6.8186 10.8724ZM15.2219 5.21703C17.681 2.75787 20.0783 2.75376 21.1124 2.8876C21.2462 3.92172 21.2421 6.31895 18.783 8.77812L12.0728 15.4883L8.51172 11.9272L15.2219 5.21703ZM13.9042 21.0538L13.1279 17.1811L17.2676 13.0414V17.68L13.9042 21.0538Z"></path><path d="M9.31827 18.3446C9.45046 17.8529 9.17864 17.3369 8.68945 17.1724C8.56178 17.1294 8.43145 17.1145 8.30512 17.1243C8.10513 17.1398 7.91519 17.2172 7.76181 17.3434C7.62613 17.455 7.51905 17.6048 7.45893 17.7835C6.97634 19.2186 5.77062 19.9878 4.52406 20.4029C4.08525 20.549 3.6605 20.644 3.29471 20.7053C3.35607 20.3395 3.45098 19.9148 3.59711 19.476C4.01221 18.2294 4.78141 17.0237 6.21648 16.5411C6.39528 16.481 6.54504 16.3739 6.65665 16.2382C6.85126 16.0016 6.92988 15.678 6.84417 15.3647C6.83922 15.3466 6.83373 15.3286 6.82767 15.3106C6.74106 15.053 6.55701 14.8557 6.33037 14.7459C6.10949 14.6389 5.84816 14.615 5.59715 14.6994C5.47743 14.7397 5.36103 14.7831 5.24786 14.8294C3.22626 15.6569 2.2347 17.4173 1.75357 18.8621C1.49662 19.6337 1.36993 20.3554 1.30679 20.8818C1.27505 21.1464 1.25893 21.3654 1.25072 21.5213C1.24662 21.5993 1.24448 21.6618 1.24337 21.7066L1.243 21.7226L1.24235 21.7605L1.2422 21.7771L1.24217 21.7827L1.24217 21.7856C1.24217 22.3221 1.67703 22.7579 2.2137 22.7579L2.2155 22.7579L2.22337 22.7578L2.23956 22.7577C2.25293 22.7575 2.27096 22.7572 2.29338 22.7567C2.33821 22.7555 2.40073 22.7534 2.47876 22.7493C2.63466 22.7411 2.85361 22.725 3.11822 22.6932C3.64462 22.6301 4.36636 22.5034 5.13797 22.2464C6.58274 21.7653 8.3431 20.7738 9.17063 18.7522C9.21696 18.639 9.26037 18.5226 9.30064 18.4029C9.30716 18.3835 9.31304 18.364 9.31827 18.3446Z"></path></svg>Tip</p><section class="starlight-aside__content"><p><strong>TLDR:</strong> Plugins are reusable pieces of code and are installable via <code dir="auto">sern plugins</code> or other sources.
|
||
They can modify the module’s fields and also perform preconditions.
|
||
Put them into the <code dir="auto">plugins</code> field of a <a href="/v4/reference/modules">module</a>.</p></section></aside>
|
||
<h2 id="installation">Installation</h2>
|
||
<p>Chances are, you just want your bot to work. Plugins can preprocess and create reusable conditions for modules.</p>
|
||
<p>To install plugins, you can use the CLI:</p>
|
||
<div class="expressive-code"><link rel="stylesheet" href="/_astro/ec.r03g6.css"><script type="module" src="/_astro/ec.8zarh.js"></script><figure class="frame is-terminal not-content"><figcaption class="header"><span class="title"></span><span class="sr-only">Terminal window</span></figcaption><pre data-language="sh"><code><div class="ec-line"><div class="code"><span style="--0:#82AAFF;--1:#3C63B3">sern</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#ECC48D;--1:#3C63B3">plugins</span></div></div></code></pre><div class="copy"><button title="Copy to clipboard" data-copied="Copied!" data-code="sern plugins"><div></div></button></div></figure></div>
|
||
<aside aria-label="Tip" class="starlight-aside starlight-aside--tip"><p class="starlight-aside__title" aria-hidden="true"><svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" class="starlight-aside__icon"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.43909 8.85483L1.44039 8.85354L4.96668 5.33815C5.30653 4.99386 5.7685 4.79662 6.2524 4.78972L6.26553 4.78963L12.9014 4.78962L13.8479 3.84308C16.9187 0.772319 20.0546 0.770617 21.4678 0.975145C21.8617 1.02914 22.2271 1.21053 22.5083 1.4917C22.7894 1.77284 22.9708 2.13821 23.0248 2.53199C23.2294 3.94517 23.2278 7.08119 20.1569 10.1521L19.2107 11.0983V17.7338L19.2106 17.7469C19.2037 18.2308 19.0067 18.6933 18.6624 19.0331L15.1456 22.5608C14.9095 22.7966 14.6137 22.964 14.29 23.0449C13.9663 23.1259 13.6267 23.1174 13.3074 23.0204C12.9881 22.9235 12.7011 22.7417 12.4771 22.4944C12.2533 22.2473 12.1006 21.9441 12.0355 21.6171L11.1783 17.3417L6.65869 12.822L4.34847 12.3589L2.38351 11.965C2.05664 11.8998 1.75272 11.747 1.50564 11.5232C1.25835 11.2992 1.07653 11.0122 0.979561 10.6929C0.882595 10.3736 0.874125 10.034 0.955057 9.7103C1.03599 9.38659 1.20328 9.09092 1.43909 8.85483ZM6.8186 10.8724L2.94619 10.096L6.32006 6.73268H10.9583L6.8186 10.8724ZM15.2219 5.21703C17.681 2.75787 20.0783 2.75376 21.1124 2.8876C21.2462 3.92172 21.2421 6.31895 18.783 8.77812L12.0728 15.4883L8.51172 11.9272L15.2219 5.21703ZM13.9042 21.0538L13.1279 17.1811L17.2676 13.0414V17.68L13.9042 21.0538Z"></path><path d="M9.31827 18.3446C9.45046 17.8529 9.17864 17.3369 8.68945 17.1724C8.56178 17.1294 8.43145 17.1145 8.30512 17.1243C8.10513 17.1398 7.91519 17.2172 7.76181 17.3434C7.62613 17.455 7.51905 17.6048 7.45893 17.7835C6.97634 19.2186 5.77062 19.9878 4.52406 20.4029C4.08525 20.549 3.6605 20.644 3.29471 20.7053C3.35607 20.3395 3.45098 19.9148 3.59711 19.476C4.01221 18.2294 4.78141 17.0237 6.21648 16.5411C6.39528 16.481 6.54504 16.3739 6.65665 16.2382C6.85126 16.0016 6.92988 15.678 6.84417 15.3647C6.83922 15.3466 6.83373 15.3286 6.82767 15.3106C6.74106 15.053 6.55701 14.8557 6.33037 14.7459C6.10949 14.6389 5.84816 14.615 5.59715 14.6994C5.47743 14.7397 5.36103 14.7831 5.24786 14.8294C3.22626 15.6569 2.2347 17.4173 1.75357 18.8621C1.49662 19.6337 1.36993 20.3554 1.30679 20.8818C1.27505 21.1464 1.25893 21.3654 1.25072 21.5213C1.24662 21.5993 1.24448 21.6618 1.24337 21.7066L1.243 21.7226L1.24235 21.7605L1.2422 21.7771L1.24217 21.7827L1.24217 21.7856C1.24217 22.3221 1.67703 22.7579 2.2137 22.7579L2.2155 22.7579L2.22337 22.7578L2.23956 22.7577C2.25293 22.7575 2.27096 22.7572 2.29338 22.7567C2.33821 22.7555 2.40073 22.7534 2.47876 22.7493C2.63466 22.7411 2.85361 22.725 3.11822 22.6932C3.64462 22.6301 4.36636 22.5034 5.13797 22.2464C6.58274 21.7653 8.3431 20.7738 9.17063 18.7522C9.21696 18.639 9.26037 18.5226 9.30064 18.4029C9.30716 18.3835 9.31304 18.364 9.31827 18.3446Z"></path></svg>Tip</p><section class="starlight-aside__content"><p>Feel free to contribute to the <a href="https://github.com/sern-handler/awesome-plugins">repository</a>!</p></section></aside>
|
||
<aside aria-label="Caution" class="starlight-aside starlight-aside--caution"><p class="starlight-aside__title" aria-hidden="true"><svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" class="starlight-aside__icon"><path d="M12 16C11.8022 16 11.6089 16.0587 11.4444 16.1686C11.28 16.2784 11.1518 16.4346 11.0761 16.6173C11.0004 16.8001 10.9806 17.0011 11.0192 17.1951C11.0578 17.3891 11.153 17.5673 11.2929 17.7071C11.4327 17.847 11.6109 17.9422 11.8049 17.9808C11.9989 18.0194 12.2 17.9996 12.3827 17.9239C12.5654 17.8482 12.7216 17.72 12.8315 17.5556C12.9413 17.3911 13 17.1978 13 17C13 16.7348 12.8946 16.4805 12.7071 16.2929C12.5196 16.1054 12.2652 16 12 16ZM22.67 17.47L14.62 3.47003C14.3598 3.00354 13.9798 2.61498 13.5192 2.3445C13.0586 2.07401 12.5341 1.9314 12 1.9314C11.4659 1.9314 10.9414 2.07401 10.4808 2.3445C10.0202 2.61498 9.64019 3.00354 9.38 3.47003L1.38 17.47C1.11079 17.924 0.966141 18.441 0.960643 18.9688C0.955144 19.4966 1.089 20.0166 1.34868 20.4761C1.60837 20.9356 1.9847 21.3185 2.43968 21.5861C2.89466 21.8536 3.41218 21.9964 3.94 22H20.06C20.5921 22.0053 21.1159 21.8689 21.5779 21.6049C22.0399 21.341 22.4234 20.9589 22.689 20.4978C22.9546 20.0368 23.0928 19.5134 23.0895 18.9814C23.0862 18.4493 22.9414 17.9277 22.67 17.47ZM20.94 19.47C20.8523 19.626 20.7245 19.7556 20.5697 19.8453C20.4149 19.935 20.2389 19.9815 20.06 19.98H3.94C3.76111 19.9815 3.5851 19.935 3.43032 19.8453C3.27553 19.7556 3.14765 19.626 3.06 19.47C2.97223 19.318 2.92602 19.1456 2.92602 18.97C2.92602 18.7945 2.97223 18.622 3.06 18.47L11.06 4.47003C11.1439 4.30623 11.2714 4.16876 11.4284 4.07277C11.5855 3.97678 11.766 3.92599 11.95 3.92599C12.134 3.92599 12.3145 3.97678 12.4716 4.07277C12.6286 4.16876 12.7561 4.30623 12.84 4.47003L20.89 18.47C20.9892 18.6199 21.0462 18.7937 21.055 18.9732C21.0638 19.1527 21.0241 19.3312 20.94 19.49V19.47ZM12 8.00003C11.7348 8.00003 11.4804 8.10538 11.2929 8.29292C11.1054 8.48046 11 8.73481 11 9.00003V13C11 13.2652 11.1054 13.5196 11.2929 13.7071C11.4804 13.8947 11.7348 14 12 14C12.2652 14 12.5196 13.8947 12.7071 13.7071C12.8946 13.5196 13 13.2652 13 13V9.00003C13 8.73481 12.8946 8.48046 12.7071 8.29292C12.5196 8.10538 12.2652 8.00003 12 8.00003Z"></path></svg>Caution</p><section class="starlight-aside__content"><p>Some plugins only work with specific command types. Most, however, are targeted towards slash / both modules.</p></section></aside>
|
||
|
||
<ol role="list" class="sl-steps">
|
||
<li>Install your favorite(s) (or the ones that look the coolest). I installed the <code dir="auto">ownerOnly</code> plugin.</li>
|
||
<li>Thank the creator of the plugin. (mandatory)</li>
|
||
<li>Add the plugin to your module in the <code dir="auto">plugins</code> field.</li>
|
||
</ol>
|
||
<div class="expressive-code"><figure class="frame has-title not-content"><figcaption class="header"><span class="title">src/commands/ping.ts</span></figcaption><pre data-language="ts"><code><div class="ec-line"><div class="gutter"><div class="ln">1</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">import</span><span style="--0:#D6DEEB;--1:#403F53"> { commandModule, CommandType } </span><span style="--0:#C792EA;--1:#8D46B4">from</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#9B504E">@sern/handler</span><span style="--0:#D9F5DD;--1:#111111">'</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">2</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">import</span><span style="--0:#D6DEEB;--1:#403F53"> { ownerOnly } </span><span style="--0:#C792EA;--1:#8D46B4">from</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#9B504E">../plugins</span><span style="--0:#D9F5DD;--1:#111111">'</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">3</div></div><div class="code">
|
||
</div></div><div class="ec-line"><div class="gutter"><div class="ln">4</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">export</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#C792EA;--1:#8D46B4">default</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#82AAFF;--1:#3C63B3">commandModule</span><span style="--0:#D6DEEB;--1:#403F53">({</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">5</div></div><div class="code"><span class="indent"><span style="--0:#D6DEEB;--1:#403F53"> </span></span><span style="--0:#D6DEEB;--1:#403F53">type: CommandType</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#7FDBCA;--1:#097174">Both</span><span style="--0:#D6DEEB;--1:#403F53">,</span></div></div><div class="ec-line highlight mark"><div class="gutter"><div class="ln">6</div></div><div class="code"><span class="indent"><span style="--0:#D6DEEB;--1:#403F53"> </span></span><span style="--0:#D6DEEB;--1:#403F53">plugins: [</span><span style="--0:#82AAFF;--1:#335497">ownerOnly</span><span style="--0:#D6DEEB;--1:#403F53">([</span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#834442">182326315813306368</span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#D6DEEB;--1:#403F53">])],</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">7</div></div><div class="code"><span class="indent"><span style="--0:#D6DEEB;--1:#403F53"> </span></span><span style="--0:#D6DEEB;--1:#403F53">description: </span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#9B504E">ping command</span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#D6DEEB;--1:#403F53">,</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">8</div></div><div class="code"><span class="indent"> </span><span style="--0:#82AAFF;--1:#3C63B3">execute</span><span style="--0:#D6DEEB;--1:#403F53">: </span><span style="--0:#D9F5DD;--1:#111111">(</span><span style="--0:#D7DBE0;--1:#403F53">ctx</span><span style="--0:#D9F5DD;--1:#111111">)</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#C792EA;--1:#8D46B4">=></span><span style="--0:#D6DEEB;--1:#403F53"> {</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">9</div></div><div class="code"><span class="indent"><span style="--0:#D6DEEB;--1:#403F53"> </span></span><span style="--0:#D6DEEB;--1:#403F53">ctx</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#82AAFF;--1:#3C63B3">reply</span><span style="--0:#D6DEEB;--1:#403F53">(</span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#9B504E">hello, owner</span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#D6DEEB;--1:#403F53">);</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">10</div></div><div class="code"><span class="indent"><span style="--0:#D6DEEB;--1:#403F53"> </span></span><span style="--0:#D6DEEB;--1:#403F53">}</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">11</div></div><div class="code"><span style="--0:#D6DEEB;--1:#403F53">})</span></div></div></code></pre><div class="copy"><button title="Copy to clipboard" data-copied="Copied!" data-code="import { commandModule, CommandType } from '@sern/handler'import { ownerOnly } from '../plugins'export default commandModule({ type: CommandType.Both, plugins: [ownerOnly(['182326315813306368'])], description: 'ping command', execute: (ctx) => { ctx.reply('hello, owner'); }})"><div></div></button></div></figure></div>
|
||
<p>┗|` O′|┛ perfect, your first plugin!</p>
|
||
<h2 id="creating-plugins">Creating Plugins</h2>
|
||
<p>Plugins are essentially functions that use the controller object to determine whether to continue or stop the execution of a command.</p>
|
||
<h2 id="init-plugins">Init Plugins</h2>
|
||
<p>Init plugins modify how commands are loaded or do preprocessing.</p>
|
||
<div class="expressive-code"><figure class="frame has-title not-content"><figcaption class="header"><span class="title">src/plugins/updateDescription.js</span></figcaption><pre data-language="ts"><code><div class="ec-line"><div class="gutter"><div class="ln">1</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">import</span><span style="--0:#D6DEEB;--1:#403F53"> { CommandInitPlugin } </span><span style="--0:#C792EA;--1:#8D46B4">from</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#ECC48D;--1:#9B504E">@sern/handler</span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#D6DEEB;--1:#403F53">;</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">2</div></div><div class="code">
|
||
</div></div><div class="ec-line highlight mark"><div class="gutter"><div class="ln">3</div></div><div class="code"><span style="--0:#C792EA;--1:#773b98">export const </span><span style="--0:#82AAFF;--1:#335497">updateDescription</span><span style="--0:#C792EA;--1:#773b98"> = </span><span style="--0:#D9F5DD;--1:#111111">(</span><span style="--0:#D7DBE0;--1:#403F53">description</span><span style="--0:#7FDBCA;--1:#086164">:</span><span style="--0:#C792EA;--1:#773b98"> </span><span style="--0:#C5E478;--1:#335497">string</span><span style="--0:#D9F5DD;--1:#111111">)</span><span style="--0:#C792EA;--1:#773b98"> => {</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">4</div></div><div class="code"><span class="indent"><span style="--0:#C792EA;--1:#8D46B4"> </span></span><span style="--0:#C792EA;--1:#8D46B4">return </span><span style="--0:#82AAFF;--1:#3C63B3">CommandInitPlugin</span><span style="--0:#D6DEEB;--1:#403F53">(</span><span style="--0:#D9F5DD;--1:#111111">(</span><span style="--0:#C792EA;--1:#8D46B4">{ </span><span style="--0:#D7DBE0;--1:#403F53">deps</span><span style="--0:#C792EA;--1:#8D46B4"> }</span><span style="--0:#D9F5DD;--1:#111111">)</span><span style="--0:#C792EA;--1:#8D46B4"> => {</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">5</div></div><div class="code"><span class="indent"><span style="--0:#C792EA;--1:#8D46B4"> </span></span><span style="--0:#C792EA;--1:#8D46B4">if</span><span style="--0:#D6DEEB;--1:#403F53">(description</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#7FDBCA;--1:#097174">length</span><span style="--0:#C792EA;--1:#8D46B4"> > </span><span style="--0:#F78C6C;--1:#AA0982">100</span><span style="--0:#D6DEEB;--1:#403F53">)</span><span style="--0:#C792EA;--1:#8D46B4"> {</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">6</div></div><div class="code"><span class="indent"> </span><span style="--0:#D6DEEB;--1:#403F53">deps</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#FAF39F;--1:#111111">logger</span><span style="--0:#C792EA;--1:#8D46B4">?.</span><span style="--0:#82AAFF;--1:#3C63B3">info</span><span style="--0:#D6DEEB;--1:#403F53">(</span><span style="--0:#C792EA;--1:#8D46B4">{ message: </span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#ECC48D;--1:#9B504E">Invalid description</span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#C792EA;--1:#8D46B4"> }</span><span style="--0:#D6DEEB;--1:#403F53">)</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">7</div></div><div class="code"><span class="indent"><span style="--0:#C792EA;--1:#8D46B4"> </span></span><span style="--0:#C792EA;--1:#8D46B4">return </span><span style="--0:#D6DEEB;--1:#403F53">controller</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#82AAFF;--1:#3C63B3">stop</span><span style="--0:#D6DEEB;--1:#403F53">(</span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#ECC48D;--1:#9B504E">From updateDescription: description is invalid</span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#D6DEEB;--1:#403F53">)</span><span style="--0:#C792EA;--1:#8D46B4">;</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">8</div></div><div class="code"><span class="indent"><span style="--0:#C792EA;--1:#8D46B4"> </span></span><span style="--0:#C792EA;--1:#8D46B4">}</span></div></div><div class="ec-line highlight mark"><div class="gutter"><div class="ln">9</div></div><div class="code"><span class="indent"> </span><span style="--0:#C5E478;--1:#335497">module</span><span style="--0:#C792EA;--1:#773b98">.</span><span style="--0:#7FDBCA;--1:#086164">description</span><span style="--0:#C792EA;--1:#773b98"> = </span><span style="--0:#D6DEEB;--1:#403F53">description</span><span style="--0:#C792EA;--1:#773b98">;</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">10</div></div><div class="code"><span class="indent"><span style="--0:#C792EA;--1:#8D46B4"> </span></span><span style="--0:#C792EA;--1:#8D46B4">return </span><span style="--0:#D6DEEB;--1:#403F53">controller</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#82AAFF;--1:#3C63B3">next</span><span style="--0:#D6DEEB;--1:#403F53">()</span><span style="--0:#C792EA;--1:#8D46B4">; </span><span style="--0:#809191;--1:#5E6578">// continue to next plugin</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">11</div></div><div class="code"><span class="indent"><span style="--0:#C792EA;--1:#8D46B4"> </span></span><span style="--0:#C792EA;--1:#8D46B4">}</span><span style="--0:#D6DEEB;--1:#403F53">)</span><span style="--0:#C792EA;--1:#8D46B4">;</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">12</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">}</span><span style="--0:#D6DEEB;--1:#403F53">;</span></div></div></code></pre><div class="copy"><button title="Copy to clipboard" data-copied="Copied!" data-code="import { CommandInitPlugin } from "@sern/handler";export const updateDescription = (description: string) => { return CommandInitPlugin(({ deps }) => { if(description.length > 100) { deps.logger?.info({ message: "Invalid description" }) return controller.stop("From updateDescription: description is invalid"); } module.description = description; return controller.next(); // continue to next plugin });};"><div></div></button></div></figure></div>
|
||
<div><p>You may modify any of the fields of the module, but please careful!
|
||
This also includes double checking any plugins which may modify fields of modules.</p></div>
|
||
<h3 id="user-data">User Data</h3>
|
||
<p>Each module has a <code dir="auto">locals</code> object which you are free to add custom user data. For example, the localizer AND publisher
|
||
take advantage of this to attach metadata.</p>
|
||
<div class="expressive-code"><figure class="frame has-title not-content"><figcaption class="header"><span class="title">src/plugins/dateRegistered.js</span></figcaption><pre data-language="ts"><code><div class="ec-line"><div class="gutter"><div class="ln">1</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">import</span><span style="--0:#D6DEEB;--1:#403F53"> { CommandInitPlugin } </span><span style="--0:#C792EA;--1:#8D46B4">from</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#ECC48D;--1:#9B504E">@sern/handler</span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#D6DEEB;--1:#403F53">;</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">2</div></div><div class="code">
|
||
</div></div><div class="ec-line highlight mark"><div class="gutter"><div class="ln">3</div></div><div class="code"><span style="--0:#C792EA;--1:#773b98">export const </span><span style="--0:#82AAFF;--1:#335497">dateRegistered</span><span style="--0:#C792EA;--1:#773b98"> = </span><span style="--0:#D9F5DD;--1:#111111">(</span><span style="--0:#D7DBE0;--1:#403F53">description</span><span style="--0:#7FDBCA;--1:#086164">:</span><span style="--0:#C792EA;--1:#773b98"> </span><span style="--0:#C5E478;--1:#335497">string</span><span style="--0:#D9F5DD;--1:#111111">)</span><span style="--0:#C792EA;--1:#773b98"> => {</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">4</div></div><div class="code"><span class="indent"><span style="--0:#C792EA;--1:#8D46B4"> </span></span><span style="--0:#C792EA;--1:#8D46B4">return </span><span style="--0:#82AAFF;--1:#3C63B3">CommandInitPlugin</span><span style="--0:#D6DEEB;--1:#403F53">(</span><span style="--0:#D9F5DD;--1:#111111">(</span><span style="--0:#C792EA;--1:#8D46B4">{ </span><span style="--0:#D7DBE0;--1:#403F53">module</span><span style="--0:#C792EA;--1:#8D46B4">, </span><span style="--0:#D7DBE0;--1:#403F53">deps</span><span style="--0:#C792EA;--1:#8D46B4"> }</span><span style="--0:#D9F5DD;--1:#111111">)</span><span style="--0:#C792EA;--1:#8D46B4"> => {</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">5</div></div><div class="code"><span class="indent"> </span><span style="--0:#C5E478;--1:#3C63B3">module</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#FAF39F;--1:#111111">locals</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#7FDBCA;--1:#097174">registered</span><span style="--0:#C792EA;--1:#8D46B4"> = </span><span style="--0:#D6DEEB;--1:#403F53">Date</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#82AAFF;--1:#3C63B3">now</span><span style="--0:#D6DEEB;--1:#403F53">()</span><span style="--0:#C792EA;--1:#8D46B4"> </span><span style="--0:#809191;--1:#5E6578">// save module registration date</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">6</div></div><div class="code"><span class="indent"><span style="--0:#C792EA;--1:#8D46B4"> </span></span><span style="--0:#C792EA;--1:#8D46B4">return </span><span style="--0:#D6DEEB;--1:#403F53">controller</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#82AAFF;--1:#3C63B3">next</span><span style="--0:#D6DEEB;--1:#403F53">()</span><span style="--0:#C792EA;--1:#8D46B4">; </span><span style="--0:#809191;--1:#5E6578">// continue to next plugin</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">7</div></div><div class="code"><span class="indent"><span style="--0:#C792EA;--1:#8D46B4"> </span></span><span style="--0:#C792EA;--1:#8D46B4">}</span><span style="--0:#D6DEEB;--1:#403F53">)</span><span style="--0:#C792EA;--1:#8D46B4">;</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">8</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">}</span><span style="--0:#D6DEEB;--1:#403F53">;</span></div></div></code></pre><div class="copy"><button title="Copy to clipboard" data-copied="Copied!" data-code="import { CommandInitPlugin } from "@sern/handler";export const dateRegistered = (description: string) => { return CommandInitPlugin(({ module, deps }) => { module.locals.registered = Date.now() // save module registration date return controller.next(); // continue to next plugin });};"><div></div></button></div></figure></div>
|
||
<h2 id="control-plugins">Control Plugins</h2>
|
||
<p><img src="/_astro/event-plugins.B5nIs4jY_Z1InWoP.webp" alt="control plugins" width="1899" height="1321" loading="lazy" decoding="async"></p>
|
||
<div class="expressive-code"><figure class="frame not-content"><figcaption class="header"></figcaption><pre data-language="js"><code><div class="ec-line"><div class="gutter"><div class="ln">1</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">import</span><span style="--0:#D6DEEB;--1:#403F53"> { CommandControlPlugin } </span><span style="--0:#C792EA;--1:#8D46B4">from</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#ECC48D;--1:#9B504E">@sern/handler</span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#D6DEEB;--1:#403F53">;</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">2</div></div><div class="code">
|
||
</div></div><div class="ec-line"><div class="gutter"><div class="ln">3</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">export const </span><span style="--0:#82AAFF;--1:#3C63B3">inGuild</span><span style="--0:#C792EA;--1:#8D46B4"> = </span><span style="--0:#D9F5DD;--1:#111111">(</span><span style="--0:#D7DBE0;--1:#403F53">guildId</span><span style="--0:#7FDBCA;--1:#097174">:</span><span style="--0:#C792EA;--1:#8D46B4"> </span><span style="--0:#C5E478;--1:#3C63B3">string</span><span style="--0:#D9F5DD;--1:#111111">)</span><span style="--0:#C792EA;--1:#8D46B4"> => {</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">4</div></div><div class="code"><span class="indent"><span style="--0:#C792EA;--1:#8D46B4"> </span></span><span style="--0:#C792EA;--1:#8D46B4">return </span><span style="--0:#82AAFF;--1:#3C63B3">CommandInitPlugin</span><span style="--1:#403F53"><span style="--0:#D6DEEB">(</span><span style="--0:#D7DBE0">ctx</span></span><span style="--0:#C792EA;--1:#8D46B4">, </span><span style="--1:#403F53"><span style="--0:#D7DBE0">sdt</span><span style="--0:#D6DEEB">)</span></span><span style="--0:#C792EA;--1:#8D46B4"> => {</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">5</div></div><div class="code"><span class="indent"><span style="--0:#C792EA;--1:#8D46B4"> </span></span><span style="--0:#C792EA;--1:#8D46B4">if</span><span style="--0:#D6DEEB;--1:#403F53">(</span><span style="--0:#7FDBCA;--1:#097174">ctx</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#FAF39F;--1:#111111">guild</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#7FDBCA;--1:#097174">id</span><span style="--0:#C792EA;--1:#8D46B4"> !== </span><span style="--1:#403F53"><span style="--0:#D7DBE0">guildId</span><span style="--0:#D6DEEB">)</span></span><span style="--0:#C792EA;--1:#8D46B4"> {</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">6</div></div><div class="code"><span class="indent"><span style="--0:#C792EA;--1:#8D46B4"> </span></span><span style="--0:#C792EA;--1:#8D46B4">return </span><span style="--0:#7FDBCA;--1:#097174">controller</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#82AAFF;--1:#3C63B3">stop</span><span style="--0:#D6DEEB;--1:#403F53">()</span><span style="--0:#C792EA;--1:#8D46B4">;</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">7</div></div><div class="code"><span class="indent"><span style="--0:#C792EA;--1:#8D46B4"> </span></span><span style="--0:#C792EA;--1:#8D46B4">}</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">8</div></div><div class="code"><span class="indent"><span style="--0:#C792EA;--1:#8D46B4"> </span></span><span style="--0:#C792EA;--1:#8D46B4">return </span><span style="--0:#7FDBCA;--1:#097174">controller</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#82AAFF;--1:#3C63B3">next</span><span style="--0:#D6DEEB;--1:#403F53">()</span><span style="--0:#C792EA;--1:#8D46B4">;</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">9</div></div><div class="code"><span class="indent"><span style="--0:#C792EA;--1:#8D46B4"> </span></span><span style="--0:#C792EA;--1:#8D46B4">});</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">10</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">}</span><span style="--0:#D6DEEB;--1:#403F53">;</span></div></div></code></pre><div class="copy"><button title="Copy to clipboard" data-copied="Copied!" data-code="import { CommandControlPlugin } from "@sern/handler";export const inGuild = (guildId: string) => { return CommandInitPlugin(ctx, sdt) => { if(ctx.guild.id !== guildId) { return controller.stop(); } return controller.next(); });};"><div></div></button></div></figure></div>
|
||
<ol role="list" class="sl-steps">
|
||
<li>An event is emitted by <code dir="auto">discord.js</code>.</li>
|
||
<li>This event is passed to all control plugins <strong>in order!!</strong>,</li>
|
||
<li>If all are successful, the command is executed.</li>
|
||
</ol>
|
||
<aside aria-label="Note" class="starlight-aside starlight-aside--note"><p class="starlight-aside__title" aria-hidden="true"><svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" class="starlight-aside__icon"><path d="M12 11C11.7348 11 11.4804 11.1054 11.2929 11.2929C11.1054 11.4804 11 11.7348 11 12V16C11 16.2652 11.1054 16.5196 11.2929 16.7071C11.4804 16.8946 11.7348 17 12 17C12.2652 17 12.5196 16.8946 12.7071 16.7071C12.8946 16.5196 13 16.2652 13 16V12C13 11.7348 12.8946 11.4804 12.7071 11.2929C12.5196 11.1054 12.2652 11 12 11ZM12.38 7.08C12.1365 6.97998 11.8635 6.97998 11.62 7.08C11.4973 7.12759 11.3851 7.19896 11.29 7.29C11.2017 7.3872 11.1306 7.49882 11.08 7.62C11.024 7.73868 10.9966 7.86882 11 8C10.9992 8.13161 11.0245 8.26207 11.0742 8.38391C11.124 8.50574 11.1973 8.61656 11.29 8.71C11.3872 8.79833 11.4988 8.86936 11.62 8.92C11.7715 8.98224 11.936 9.00632 12.099 8.99011C12.2619 8.97391 12.4184 8.91792 12.5547 8.82707C12.691 8.73622 12.8029 8.61328 12.8805 8.46907C12.9582 8.32486 12.9992 8.16378 13 8C12.9963 7.73523 12.8927 7.48163 12.71 7.29C12.6149 7.19896 12.5028 7.12759 12.38 7.08ZM12 2C10.0222 2 8.08879 2.58649 6.4443 3.6853C4.79981 4.78412 3.51809 6.3459 2.76121 8.17317C2.00433 10.0004 1.8063 12.0111 2.19215 13.9509C2.578 15.8907 3.53041 17.6725 4.92894 19.0711C6.32746 20.4696 8.10929 21.422 10.0491 21.8079C11.9889 22.1937 13.9996 21.9957 15.8268 21.2388C17.6541 20.4819 19.2159 19.2002 20.3147 17.5557C21.4135 15.9112 22 13.9778 22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7363 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2ZM12 20C10.4178 20 8.87104 19.5308 7.55544 18.6518C6.23985 17.7727 5.21447 16.5233 4.60897 15.0615C4.00347 13.5997 3.84504 11.9911 4.15372 10.4393C4.4624 8.88743 5.22433 7.46197 6.34315 6.34315C7.46197 5.22433 8.88743 4.4624 10.4393 4.15372C11.9911 3.84504 13.5997 4.00346 15.0615 4.60896C16.5233 5.21447 17.7727 6.23984 18.6518 7.55544C19.5308 8.87103 20 10.4177 20 12C20 14.1217 19.1572 16.1566 17.6569 17.6569C16.1566 19.1571 14.1217 20 12 20Z"></path></svg>Note</p><section class="starlight-aside__content"><p>Calling <code dir="auto">controller.stop()</code> notifies sern that this command should not be run, and command is ignored.
|
||
In addition, this emits a <code dir="auto">module.activate</code> event on the @sern/emitter with <code dir="auto">PayloadType.Failure</code></p></section></aside>
|
||
<aside aria-label="Tip" class="starlight-aside starlight-aside--tip"><p class="starlight-aside__title" aria-hidden="true"><svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" class="starlight-aside__icon"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.43909 8.85483L1.44039 8.85354L4.96668 5.33815C5.30653 4.99386 5.7685 4.79662 6.2524 4.78972L6.26553 4.78963L12.9014 4.78962L13.8479 3.84308C16.9187 0.772319 20.0546 0.770617 21.4678 0.975145C21.8617 1.02914 22.2271 1.21053 22.5083 1.4917C22.7894 1.77284 22.9708 2.13821 23.0248 2.53199C23.2294 3.94517 23.2278 7.08119 20.1569 10.1521L19.2107 11.0983V17.7338L19.2106 17.7469C19.2037 18.2308 19.0067 18.6933 18.6624 19.0331L15.1456 22.5608C14.9095 22.7966 14.6137 22.964 14.29 23.0449C13.9663 23.1259 13.6267 23.1174 13.3074 23.0204C12.9881 22.9235 12.7011 22.7417 12.4771 22.4944C12.2533 22.2473 12.1006 21.9441 12.0355 21.6171L11.1783 17.3417L6.65869 12.822L4.34847 12.3589L2.38351 11.965C2.05664 11.8998 1.75272 11.747 1.50564 11.5232C1.25835 11.2992 1.07653 11.0122 0.979561 10.6929C0.882595 10.3736 0.874125 10.034 0.955057 9.7103C1.03599 9.38659 1.20328 9.09092 1.43909 8.85483ZM6.8186 10.8724L2.94619 10.096L6.32006 6.73268H10.9583L6.8186 10.8724ZM15.2219 5.21703C17.681 2.75787 20.0783 2.75376 21.1124 2.8876C21.2462 3.92172 21.2421 6.31895 18.783 8.77812L12.0728 15.4883L8.51172 11.9272L15.2219 5.21703ZM13.9042 21.0538L13.1279 17.1811L17.2676 13.0414V17.68L13.9042 21.0538Z"></path><path d="M9.31827 18.3446C9.45046 17.8529 9.17864 17.3369 8.68945 17.1724C8.56178 17.1294 8.43145 17.1145 8.30512 17.1243C8.10513 17.1398 7.91519 17.2172 7.76181 17.3434C7.62613 17.455 7.51905 17.6048 7.45893 17.7835C6.97634 19.2186 5.77062 19.9878 4.52406 20.4029C4.08525 20.549 3.6605 20.644 3.29471 20.7053C3.35607 20.3395 3.45098 19.9148 3.59711 19.476C4.01221 18.2294 4.78141 17.0237 6.21648 16.5411C6.39528 16.481 6.54504 16.3739 6.65665 16.2382C6.85126 16.0016 6.92988 15.678 6.84417 15.3647C6.83922 15.3466 6.83373 15.3286 6.82767 15.3106C6.74106 15.053 6.55701 14.8557 6.33037 14.7459C6.10949 14.6389 5.84816 14.615 5.59715 14.6994C5.47743 14.7397 5.36103 14.7831 5.24786 14.8294C3.22626 15.6569 2.2347 17.4173 1.75357 18.8621C1.49662 19.6337 1.36993 20.3554 1.30679 20.8818C1.27505 21.1464 1.25893 21.3654 1.25072 21.5213C1.24662 21.5993 1.24448 21.6618 1.24337 21.7066L1.243 21.7226L1.24235 21.7605L1.2422 21.7771L1.24217 21.7827L1.24217 21.7856C1.24217 22.3221 1.67703 22.7579 2.2137 22.7579L2.2155 22.7579L2.22337 22.7578L2.23956 22.7577C2.25293 22.7575 2.27096 22.7572 2.29338 22.7567C2.33821 22.7555 2.40073 22.7534 2.47876 22.7493C2.63466 22.7411 2.85361 22.725 3.11822 22.6932C3.64462 22.6301 4.36636 22.5034 5.13797 22.2464C6.58274 21.7653 8.3431 20.7738 9.17063 18.7522C9.21696 18.639 9.26037 18.5226 9.30064 18.4029C9.30716 18.3835 9.31304 18.364 9.31827 18.3446Z"></path></svg>Tip</p><section class="starlight-aside__content"><p>Control Plugins are good for filtering, preconditions, parsing.</p></section></aside>
|
||
<h3 id="controller-object">Controller Object</h3>
|
||
<p>The controller object is passed into every plugin. It has two methods: <code dir="auto">next</code> and <code dir="auto">stop</code>.</p>
|
||
<p>Plugins use the controller to control the flow of the command. For example, if a plugin fails, it calls <code dir="auto">controller.stop()</code> to prevent the command from executing.</p>
|
||
<div class="expressive-code"><figure class="frame not-content"><figcaption class="header"></figcaption><pre data-language="ts"><code><div class="ec-line"><div class="gutter"><div class="ln">1</div></div><div class="code"><span style="--0:#809191;--1:#5E6578">// Reference object, import this from @sern/handler</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">2</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">const </span><span style="--0:#82AAFF;--1:#3C63B3">controller</span><span style="--0:#C792EA;--1:#8D46B4"> = {</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">3</div></div><div class="code"><span class="indent"> </span><span style="--0:#82AAFF;--1:#3C63B3">next</span><span style="--0:#C792EA;--1:#8D46B4">: </span><span style="--0:#D9F5DD;--1:#111111">(</span><span style="--0:#D7DBE0;--1:#403F53">val</span><span style="--0:#7FDBCA;--1:#097174">?:</span><span style="--0:#C792EA;--1:#8D46B4"> </span><span style="--0:#FFCB8B;--1:#111111">Record</span><span style="--0:#C792EA;--1:#8D46B4"><</span><span style="--0:#C5E478;--1:#3C63B3">string</span><span style="--0:#C792EA;--1:#8D46B4">,</span><span style="--0:#C5E478;--1:#3C63B3">unknown</span><span style="--0:#C792EA;--1:#8D46B4">></span><span style="--0:#D9F5DD;--1:#111111">)</span><span style="--0:#C792EA;--1:#8D46B4"> => </span><span style="--0:#82AAFF;--1:#3C63B3">Ok</span><span style="--0:#D6DEEB;--1:#403F53">(val)</span><span style="--0:#C792EA;--1:#8D46B4">,</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">4</div></div><div class="code"><span class="indent"> </span><span style="--0:#82AAFF;--1:#3C63B3">stop</span><span style="--0:#C792EA;--1:#8D46B4">: </span><span style="--0:#D9F5DD;--1:#111111">(</span><span style="--0:#D7DBE0;--1:#403F53">val</span><span style="--0:#7FDBCA;--1:#097174">?:</span><span style="--0:#C792EA;--1:#8D46B4"> </span><span style="--0:#C5E478;--1:#3C63B3">string</span><span style="--0:#D9F5DD;--1:#111111">)</span><span style="--0:#C792EA;--1:#8D46B4"> => </span><span style="--0:#82AAFF;--1:#3C63B3">Err</span><span style="--0:#D6DEEB;--1:#403F53">(val)</span><span style="--0:#C792EA;--1:#8D46B4">,</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">5</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">}</span><span style="--0:#D6DEEB;--1:#403F53">;</span></div></div></code></pre><div class="copy"><button title="Copy to clipboard" data-copied="Copied!" data-code="// Reference object, import this from @sern/handlerconst controller = { next: (val?: Record<string,unknown>) => Ok(val), stop: (val?: string) => Err(val),};"><div></div></button></div></figure></div>
|
||
<h3 id="state">State</h3>
|
||
<blockquote>
|
||
<p>SDT = <strong>state</strong>, <a href="/v4/reference/dependencies">dependencies</a>, type (very creative) <br></p>
|
||
</blockquote>
|
||
<p>Plugins can recieve data from previous plugins. State is created when <code dir="auto">controller.next</code> is called with a record.
|
||
If all control plugins are successful, the final state is passed to the module <code dir="auto">execute</code>.</p>
|
||
<div class="expressive-code"><figure class="frame not-content"><figcaption class="header"></figcaption><pre data-language="js"><code><div class="ec-line"><div class="gutter"><div class="ln">1</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">import</span><span style="--0:#D6DEEB;--1:#403F53"> { commandModule, CommandControlPlugin, CommandType } </span><span style="--0:#C792EA;--1:#8D46B4">from</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#9B504E">@sern/handler</span><span style="--0:#D9F5DD;--1:#111111">'</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">2</div></div><div class="code">
|
||
</div></div><div class="ec-line"><div class="gutter"><div class="ln">3</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">const </span><span style="--0:#82AAFF;--1:#3C63B3">plugin</span><span style="--0:#C792EA;--1:#8D46B4"> = </span><span style="--0:#82AAFF;--1:#3C63B3">CommandControlPlugin</span><span style="--0:#D6DEEB;--1:#403F53">(</span><span style="--0:#D9F5DD;--1:#111111">(</span><span style="--0:#D7DBE0;--1:#403F53">ctx</span><span style="--0:#C792EA;--1:#8D46B4">, </span><span style="--0:#D7DBE0;--1:#403F53">sdt</span><span style="--0:#D9F5DD;--1:#111111">)</span><span style="--0:#C792EA;--1:#8D46B4"> => {</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">4</div></div><div class="code"><span class="indent"><span style="--0:#C792EA;--1:#8D46B4"> </span></span><span style="--0:#C792EA;--1:#8D46B4">return </span><span style="--0:#7FDBCA;--1:#097174">controller</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#82AAFF;--1:#3C63B3">next</span><span style="--0:#D6DEEB;--1:#403F53">(</span><span style="--0:#C792EA;--1:#8D46B4">{ a: </span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#9B504E">from plugin1</span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#C792EA;--1:#8D46B4"> }</span><span style="--0:#D6DEEB;--1:#403F53">)</span><span style="--0:#C792EA;--1:#8D46B4">;</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">5</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">}</span><span style="--0:#D6DEEB;--1:#403F53">);</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">6</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">const </span><span style="--0:#82AAFF;--1:#3C63B3">plugin2</span><span style="--0:#C792EA;--1:#8D46B4"> = </span><span style="--0:#82AAFF;--1:#3C63B3">CommandControlPlugin</span><span style="--0:#D6DEEB;--1:#403F53">(</span><span style="--0:#D9F5DD;--1:#111111">(</span><span style="--0:#D7DBE0;--1:#403F53">ctx</span><span style="--0:#C792EA;--1:#8D46B4">, </span><span style="--0:#D7DBE0;--1:#403F53">sdt</span><span style="--0:#D9F5DD;--1:#111111">)</span><span style="--0:#C792EA;--1:#8D46B4"> => {</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">7</div></div><div class="code"><span class="indent"><span style="--0:#C792EA;--1:#8D46B4"> </span></span><span style="--0:#C792EA;--1:#8D46B4">return </span><span style="--0:#7FDBCA;--1:#097174">controller</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#82AAFF;--1:#3C63B3">next</span><span style="--0:#D6DEEB;--1:#403F53">(</span><span style="--0:#C792EA;--1:#8D46B4">{ b: </span><span style="--0:#7FDBCA;--1:#097174">ctx</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#FAF39F;--1:#111111">user</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#7FDBCA;--1:#097174">id</span><span style="--0:#C792EA;--1:#8D46B4"> + </span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#ECC48D;--1:#9B504E">from plugin2</span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#C792EA;--1:#8D46B4"> }</span><span style="--0:#D6DEEB;--1:#403F53">)</span><span style="--0:#C792EA;--1:#8D46B4">;</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">8</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">}</span><span style="--0:#D6DEEB;--1:#403F53">)</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">9</div></div><div class="code">
|
||
</div></div><div class="ec-line"><div class="gutter"><div class="ln">10</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">export</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#C792EA;--1:#8D46B4">default</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#82AAFF;--1:#3C63B3">commandModule</span><span style="--0:#D6DEEB;--1:#403F53">({</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">11</div></div><div class="code"><span class="indent"><span style="--0:#D6DEEB;--1:#403F53"> </span></span><span style="--0:#D6DEEB;--1:#403F53">type: </span><span style="--0:#7FDBCA;--1:#097174">CommandType</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#7FDBCA;--1:#097174">Slash</span><span style="--0:#D6DEEB;--1:#403F53">,</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">12</div></div><div class="code"><span class="indent"><span style="--0:#D6DEEB;--1:#403F53"> </span></span><span style="--0:#D6DEEB;--1:#403F53">plugins: [</span><span style="--0:#D7DBE0;--1:#403F53">plugin</span><span style="--0:#D6DEEB;--1:#403F53">, </span><span style="--0:#D7DBE0;--1:#403F53">plugin2</span><span style="--0:#D6DEEB;--1:#403F53">],</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">13</div></div><div class="code"><span class="indent"> </span><span style="--0:#82AAFF;--1:#3C63B3">execute</span><span style="--0:#D6DEEB;--1:#403F53">: </span><span style="--0:#D9F5DD;--1:#111111">(</span><span style="--1:#403F53"><span style="--0:#D7DBE0">ctx</span><span style="--0:#D6DEEB">, </span><span style="--0:#D7DBE0">sdt</span></span><span style="--0:#D9F5DD;--1:#111111">)</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#C792EA;--1:#8D46B4">=></span><span style="--0:#D6DEEB;--1:#403F53"> {</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">14</div></div><div class="code"><span class="indent"> </span><span style="--0:#7FDBCA;--1:#097174">sdt</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#7FDBCA;--1:#097174">state</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#809191;--1:#5E6578">// { a: 'from plugin1', b: '182326315813306368 from plugin2' }</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">15</div></div><div class="code"><span class="indent"><span style="--0:#D6DEEB;--1:#403F53"> </span></span><span style="--0:#D6DEEB;--1:#403F53">}</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">16</div></div><div class="code"><span style="--0:#D6DEEB;--1:#403F53">})</span></div></div></code></pre><div class="copy"><button title="Copy to clipboard" data-copied="Copied!" data-code="import { commandModule, CommandControlPlugin, CommandType } from '@sern/handler'const plugin = CommandControlPlugin((ctx, sdt) => { return controller.next({ a: 'from plugin1' });});const plugin2 = CommandControlPlugin((ctx, sdt) => { return controller.next({ b: ctx.user.id + "from plugin2" });})export default commandModule({ type: CommandType.Slash, plugins: [plugin, plugin2], execute: (ctx, sdt) => { sdt.state // { a: 'from plugin1', b: '182326315813306368 from plugin2' } }})"><div></div></button></div></figure></div>
|
||
<aside aria-label="Tip" class="starlight-aside starlight-aside--tip"><p class="starlight-aside__title" aria-hidden="true"><svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" class="starlight-aside__icon"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.43909 8.85483L1.44039 8.85354L4.96668 5.33815C5.30653 4.99386 5.7685 4.79662 6.2524 4.78972L6.26553 4.78963L12.9014 4.78962L13.8479 3.84308C16.9187 0.772319 20.0546 0.770617 21.4678 0.975145C21.8617 1.02914 22.2271 1.21053 22.5083 1.4917C22.7894 1.77284 22.9708 2.13821 23.0248 2.53199C23.2294 3.94517 23.2278 7.08119 20.1569 10.1521L19.2107 11.0983V17.7338L19.2106 17.7469C19.2037 18.2308 19.0067 18.6933 18.6624 19.0331L15.1456 22.5608C14.9095 22.7966 14.6137 22.964 14.29 23.0449C13.9663 23.1259 13.6267 23.1174 13.3074 23.0204C12.9881 22.9235 12.7011 22.7417 12.4771 22.4944C12.2533 22.2473 12.1006 21.9441 12.0355 21.6171L11.1783 17.3417L6.65869 12.822L4.34847 12.3589L2.38351 11.965C2.05664 11.8998 1.75272 11.747 1.50564 11.5232C1.25835 11.2992 1.07653 11.0122 0.979561 10.6929C0.882595 10.3736 0.874125 10.034 0.955057 9.7103C1.03599 9.38659 1.20328 9.09092 1.43909 8.85483ZM6.8186 10.8724L2.94619 10.096L6.32006 6.73268H10.9583L6.8186 10.8724ZM15.2219 5.21703C17.681 2.75787 20.0783 2.75376 21.1124 2.8876C21.2462 3.92172 21.2421 6.31895 18.783 8.77812L12.0728 15.4883L8.51172 11.9272L15.2219 5.21703ZM13.9042 21.0538L13.1279 17.1811L17.2676 13.0414V17.68L13.9042 21.0538Z"></path><path d="M9.31827 18.3446C9.45046 17.8529 9.17864 17.3369 8.68945 17.1724C8.56178 17.1294 8.43145 17.1145 8.30512 17.1243C8.10513 17.1398 7.91519 17.2172 7.76181 17.3434C7.62613 17.455 7.51905 17.6048 7.45893 17.7835C6.97634 19.2186 5.77062 19.9878 4.52406 20.4029C4.08525 20.549 3.6605 20.644 3.29471 20.7053C3.35607 20.3395 3.45098 19.9148 3.59711 19.476C4.01221 18.2294 4.78141 17.0237 6.21648 16.5411C6.39528 16.481 6.54504 16.3739 6.65665 16.2382C6.85126 16.0016 6.92988 15.678 6.84417 15.3647C6.83922 15.3466 6.83373 15.3286 6.82767 15.3106C6.74106 15.053 6.55701 14.8557 6.33037 14.7459C6.10949 14.6389 5.84816 14.615 5.59715 14.6994C5.47743 14.7397 5.36103 14.7831 5.24786 14.8294C3.22626 15.6569 2.2347 17.4173 1.75357 18.8621C1.49662 19.6337 1.36993 20.3554 1.30679 20.8818C1.27505 21.1464 1.25893 21.3654 1.25072 21.5213C1.24662 21.5993 1.24448 21.6618 1.24337 21.7066L1.243 21.7226L1.24235 21.7605L1.2422 21.7771L1.24217 21.7827L1.24217 21.7856C1.24217 22.3221 1.67703 22.7579 2.2137 22.7579L2.2155 22.7579L2.22337 22.7578L2.23956 22.7577C2.25293 22.7575 2.27096 22.7572 2.29338 22.7567C2.33821 22.7555 2.40073 22.7534 2.47876 22.7493C2.63466 22.7411 2.85361 22.725 3.11822 22.6932C3.64462 22.6301 4.36636 22.5034 5.13797 22.2464C6.58274 21.7653 8.3431 20.7738 9.17063 18.7522C9.21696 18.639 9.26037 18.5226 9.30064 18.4029C9.30716 18.3835 9.31304 18.364 9.31827 18.3446Z"></path></svg>Tip</p><section class="starlight-aside__content"><p>State passing is a glorified asynchronous <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce">reduce</a>.</p></section></aside>
|
||
<h4 id="caveats">Caveats</h4>
|
||
<p>Passing data with the same key will get overridden by the latest plugin.
|
||
It is recommended to <strong>namespace</strong> data keys if you have multiple plugins, or you can ensure no keys are overridden by the
|
||
plugin chain.</p>
|
||
<div class="expressive-code"><figure class="frame not-content"><figcaption class="header"></figcaption><pre data-language="js"><code><div class="ec-line"><div class="gutter"><div class="ln">1</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">return</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#7FDBCA;--1:#097174">controller</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#82AAFF;--1:#3C63B3">next</span><span style="--0:#D6DEEB;--1:#403F53">({ </span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#9B504E">cheese-plugin/data</span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#D6DEEB;--1:#403F53"> : </span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#ECC48D;--1:#9B504E">From cheese-plugin</span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#D6DEEB;--1:#403F53"> })</span></div></div></code></pre><div class="copy"><button title="Copy to clipboard" data-copied="Copied!" data-code="return controller.next({ 'cheese-plugin/data' : "From cheese-plugin" })"><div></div></button></div></figure></div>
|
||
<h3 id="dependencies">Dependencies</h3>
|
||
<blockquote>
|
||
<p>SDT = state, <strong><a href="/v4/reference/dependencies">dependencies</a></strong>, type (very creative)</p>
|
||
</blockquote>
|
||
<p>Plugins also carry an instance of all of your dependencies. Use them and use them as you please! For example,
|
||
creating a plugin which logs which user uses your command</p>
|
||
<div class="expressive-code"><figure class="frame not-content"><figcaption class="header"></figcaption><pre data-language="js"><code><div class="ec-line"><div class="gutter"><div class="ln">1</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">import</span><span style="--0:#D6DEEB;--1:#403F53"> { commandModule, CommandControlPlugin, CommandType } </span><span style="--0:#C792EA;--1:#8D46B4">from</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#9B504E">@sern/handler</span><span style="--0:#D9F5DD;--1:#111111">'</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">2</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">export const </span><span style="--0:#82AAFF;--1:#3C63B3">log</span><span style="--0:#C792EA;--1:#8D46B4"> = </span><span style="--0:#82AAFF;--1:#3C63B3">CommandControlPlugin</span><span style="--0:#D6DEEB;--1:#403F53">(</span><span style="--0:#D9F5DD;--1:#111111">(</span><span style="--0:#D7DBE0;--1:#403F53">ctx</span><span style="--0:#C792EA;--1:#8D46B4">, </span><span style="--0:#D7DBE0;--1:#403F53">sdt</span><span style="--0:#D9F5DD;--1:#111111">)</span><span style="--0:#C792EA;--1:#8D46B4"> => {</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">3</div></div><div class="code"><span class="indent"> </span><span style="--0:#D7DBE0;--1:#403F53">sdt</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">4</div></div><div class="code"><span class="indent"><span style="--0:#C792EA;--1:#8D46B4"> </span></span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#7FDBCA;--1:#097174">deps</span><span style="--0:#D6DEEB;--1:#403F53">[</span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#9B504E">@sern/logger</span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#D6DEEB;--1:#403F53">]</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">5</div></div><div class="code"><span class="indent"><span style="--0:#C792EA;--1:#8D46B4"> </span></span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#82AAFF;--1:#3C63B3">info</span><span style="--0:#D6DEEB;--1:#403F53">(</span><span style="--0:#C792EA;--1:#8D46B4">{ message: </span><span style="--0:#D6DEEB;--1:#403F53">`</span><span style="--0:#DD6B68;--1:#B73936">${</span><span style="--0:#7FDBCA;--1:#097174">ctx</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#FAF39F;--1:#111111">user</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#7FDBCA;--1:#097174">id</span><span style="--0:#DD6B68;--1:#B73936">}</span><span style="--0:#ECC48D;--1:#3C63B3"> used this command from </span><span style="--0:#DD6B68;--1:#B73936">${</span><span style="--0:#7FDBCA;--1:#097174">ctx</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#FAF39F;--1:#111111">guild</span><span style="--0:#C792EA;--1:#8D46B4">.</span><span style="--0:#7FDBCA;--1:#097174">id</span><span style="--0:#DD6B68;--1:#B73936">}</span><span style="--0:#D6DEEB;--1:#403F53">`</span><span style="--0:#C792EA;--1:#8D46B4"> }</span><span style="--0:#D6DEEB;--1:#403F53">)</span><span style="--0:#C792EA;--1:#8D46B4">;</span></div></div><div class="ec-line"><div class="gutter"><div class="ln">6</div></div><div class="code"><span style="--0:#C792EA;--1:#8D46B4">}</span><span style="--0:#D6DEEB;--1:#403F53">)</span></div></div></code></pre><div class="copy"><button title="Copy to clipboard" data-copied="Copied!" data-code="import { commandModule, CommandControlPlugin, CommandType } from '@sern/handler'export const log = CommandControlPlugin((ctx, sdt) => { sdt .deps['@sern/logger'] .info({ message: `${ctx.user.id} used this command from ${ctx.guild.id}` });})"><div></div></button></div></figure></div> </div> <footer class="astro-3yyafb3n"> <div class="meta sl-flex astro-3yyafb3n"> <a href="https://github.com/sern-handler/website/edit/main/src/content/docs/v4/reference/plugins.mdx" class="sl-flex astro-eez2twj6"><svg aria-hidden="true" class="astro-eez2twj6 astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.2em;"><path d="M22 7.24a1 1 0 0 0-.29-.71l-4.24-4.24a1 1 0 0 0-1.1-.22 1 1 0 0 0-.32.22l-2.83 2.83L2.29 16.05a1 1 0 0 0-.29.71V21a1 1 0 0 0 1 1h4.24a1 1 0 0 0 .76-.29l10.87-10.93L21.71 8c.1-.1.17-.2.22-.33a1 1 0 0 0 0-.24v-.14l.07-.05ZM6.83 20H4v-2.83l9.93-9.93 2.83 2.83L6.83 20ZM18.17 8.66l-2.83-2.83 1.42-1.41 2.82 2.82-1.41 1.42Z"/></svg> Edit page</a> <p>Last updated: <time datetime="2025-06-28T14:47:43.000Z">Jun 28, 2025</time></p> </div> <div class="pagination-links astro-u2l5gyhi" dir="ltr"> <a href="/v4/reference/modules/" rel="prev" class="astro-u2l5gyhi"> <svg aria-hidden="true" class="astro-u2l5gyhi astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M17 11H9.41l3.3-3.29a1.004 1.004 0 1 0-1.42-1.42l-5 5a1 1 0 0 0-.21.33 1 1 0 0 0 0 .76 1 1 0 0 0 .21.33l5 5a1.002 1.002 0 0 0 1.639-.325 1 1 0 0 0-.219-1.095L9.41 13H17a1 1 0 0 0 0-2Z"/></svg> <span class="astro-u2l5gyhi"> Previous <br class="astro-u2l5gyhi"> <span class="link-title astro-u2l5gyhi">Modules</span> </span> </a> <a href="/v4/reference/presence/" rel="next" class="astro-u2l5gyhi"> <svg aria-hidden="true" class="astro-u2l5gyhi astro-c6vsoqas" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M17.92 11.62a1.001 1.001 0 0 0-.21-.33l-5-5a1.003 1.003 0 1 0-1.42 1.42l3.3 3.29H7a1 1 0 0 0 0 2h7.59l-3.3 3.29a1.002 1.002 0 0 0 .325 1.639 1 1 0 0 0 1.095-.219l5-5a1 1 0 0 0 .21-.33 1 1 0 0 0 0-.76Z"/></svg> <span class="astro-u2l5gyhi"> Next <br class="astro-u2l5gyhi"> <span class="link-title astro-u2l5gyhi">Presence</span> </span> </a> </div> </footer> </div> </div> </main> </div> </div> </div> </div> </body></html> |