diff --git a/404.html b/404.html index f98a13eed..c1462548f 100644 --- a/404.html +++ b/404.html @@ -5,13 +5,13 @@ Page Not Found | sern - Handlers. Redefined. - +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- + \ No newline at end of file diff --git a/assets/js/c4f5d8e4.57fa0488.js b/assets/js/c4f5d8e4.be1a5759.js similarity index 90% rename from assets/js/c4f5d8e4.57fa0488.js rename to assets/js/c4f5d8e4.be1a5759.js index 3e2aec4da..2c81795b8 100644 --- a/assets/js/c4f5d8e4.57fa0488.js +++ b/assets/js/c4f5d8e4.be1a5759.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_sern_website=self.webpackChunk_sern_website||[]).push([[195],{4660:(e,t,l)=>{l.d(t,{Z:()=>r});var a=l(7294);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:l,...r}=e;return a.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",style:{enableBackground:"new 0 0 512 512"},xmlSpace:"preserve","aria-labelledby":l},r),t?a.createElement("title",{id:l},t):null,a.createElement("path",{style:{fill:"#34485c"},d:"M17.655 441.379h476.69V123.586H17.655z"}),a.createElement("path",{style:{fill:"#4897f7"},d:"M70.621 88.276h52.965V35.31H70.621z"}),a.createElement("path",{style:{fill:"#576d7e"},d:"M61.793 238.345h105.931v-35.311H61.793z"}),a.createElement("path",{style:{fill:"#397abc"},d:"M150.073 123.586H44.142l17.656-35.31h70.62z"}),a.createElement("path",{style:{fill:"#c6421e"},d:"M388.414 88.276h52.965V35.31h-52.965z"}),a.createElement("path",{style:{fill:"#992c13"},d:"M467.866 123.586H361.935l17.656-35.31h70.62z"}),a.createElement("path",{style:{fill:"#576d7e"},d:"M450.211 203.034h-35.31v-35.31h-35.31v35.31H344.28v35.311h35.311v35.31h35.31v-35.31h35.31zM0 476.69h512v-35.311H0zM176.556 44.138v79.448h35.31V79.475a8.854 8.854 0 0 1 8.854-8.854h70.568a8.854 8.854 0 0 1 8.854 8.854v44.111h35.31V44.138c0-4.873-3.955-8.828-8.828-8.828h-141.24c-4.873 0-8.828 3.955-8.828 8.828"}))}},5261:(e,t,l)=>{l.d(t,{Z:()=>r});var a=l(7294);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:l,...r}=e;return a.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 58 58",style:{enableBackground:"new 0 0 58 58"},xmlSpace:"preserve","aria-labelledby":l},r),t?a.createElement("title",{id:l},t):null,a.createElement("path",{style:{fill:"#e57e25"},d:"M25 37.376c1.539 0 2.938.584 4 1.537v-7.298a3.239 3.239 0 0 0-3.239-3.239h-7.448a6 6 0 1 0-6.628 0H3.239A3.239 3.239 0 0 0 0 31.615v8.447a6 6 0 1 1 0 6.628v7.447a3.239 3.239 0 0 0 3.239 3.239h22.523a3.239 3.239 0 0 0 3.239-3.239V47.84a5.973 5.973 0 0 1-4 1.537c-3.314 0-6-2.686-6-6A6 6 0 0 1 25 37.376z"}),a.createElement("path",{style:{fill:"#f0c419"},d:"M26.832 14.761a4.985 4.985 0 0 0 4.619-.971l-.269.917-1.71 5.824a2.693 2.693 0 0 0 1.825 3.343l5.943 1.745a4.99 4.99 0 1 0 5.289 1.554l6.741 1.98a2.693 2.693 0 0 0 3.343-1.825l1.98-6.741a4.99 4.99 0 1 1 1.554-5.289l1.745-5.943a2.693 2.693 0 0 0-1.825-3.343L38.093.733a2.693 2.693 0 0 0-3.343 1.825l-1.476 5.026-.269.917a4.989 4.989 0 0 0-9.554.066 4.99 4.99 0 0 0 3.381 6.194z"}))}},2527:(e,t,l)=>{l.d(t,{Z:()=>s});var a,n,r=l(7294);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:l,...s}=e;return r.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg","aria-label":"TypeScript",viewBox:"0 0 512 512","aria-labelledby":l},s),t?r.createElement("title",{id:l},t):null,a||(a=r.createElement("rect",{width:512,height:512,rx:"15%",fill:"#3178c6"})),n||(n=r.createElement("path",{fill:"#fff",d:"M233 284h64v-41H118v41h64v183h51zm84 173c8.1 4.2 18 7.3 29 9.4s23 3.1 35 3.1 23-1.1 34-3.4 20-6.1 28-11c8.1-5.3 15-12 19-21s7.1-19 7.1-32c0-9.1-1.4-17-4.1-24s-6.6-13-12-18c-5.1-5.3-11-10-18-14s-15-8.2-24-12c-6.6-2.7-12-5.3-18-7.9-5.2-2.6-9.7-5.2-13-7.8-3.7-2.7-6.5-5.5-8.5-8.4-2-3-3-6.3-3-10 0-3.4.89-6.5 2.7-9.3s4.3-5.1 7.5-7.1 7.2-3.5 12-4.6c4.7-1.1 9.9-1.6 16-1.6 4.2 0 8.6.31 13 .94 4.6.63 9.3 1.6 14 2.9 4.7 1.3 9.3 2.9 14 4.9 4.4 2 8.5 4.3 12 6.9v-47c-7.6-2.9-16-5.1-25-6.5s-19-2.1-31-2.1-23 1.3-34 3.8-20 6.5-28 12c-8.1 5.4-14 12-19 21-4.7 8.4-7 18-7 30 0 15 4.3 28 13 38 8.6 11 22 19 39 27 6.9 2.8 13 5.6 19 8.3s11 5.5 15 8.4c4.3 2.9 7.7 6.1 10 9.5 2.5 3.4 3.8 7.4 3.8 12 0 3.2-.78 6.2-2.3 9s-3.9 5.2-7.1 7.2-7.1 3.6-12 4.8c-4.7 1.1-10 1.7-17 1.7-11 0-22-1.9-32-5.7-11-3.8-21-9.5-28.1-15.44z"})))}},2773:(e,t,l)=>{l.r(t),l.d(t,{default:()=>f});var a=l(7294),n=l(6010),r=l(9960),c=l(2263),s=l(2164),i=l(7462);const o="features_t9lD",m="featureSvg_GfXr",d=[{title:"Batteries included",Svg:l(4660).Z,description:a.createElement(a.Fragment,null,"Start or integrate a new project in minutes.")},{title:"Customizable",Svg:l(5261).Z,description:a.createElement(a.Fragment,null,"Extend or customize with community-based plugins to provide utilities, filters, and more.")},{title:"Modern",Svg:l(2527).Z,description:a.createElement(a.Fragment,null,"Uses modern and powerful tooling such as",a.createElement("a",{href:"https://swc.rs/"}," swc"),",",a.createElement("a",{href:"https://tsup.egoist.dev/"}," tsup"),",",a.createElement("a",{href:"https://www.typescriptlang.org/"}," typescript"),", and",a.createElement("a",{href:"https://rxjs.dev/"}," rxjs")," to future-proof and ensure project quality.")}];function h(e){let{Svg:t,title:l,description:r}=e;return a.createElement("div",{className:(0,n.Z)("col col--4")},a.createElement("div",{className:"text--center"},a.createElement(t,{className:m,role:"img"})),a.createElement("div",{className:"text--center padding-horiz--md"},a.createElement("h3",null,l),a.createElement("p",null,r)))}function p(){return a.createElement("section",{className:o},a.createElement("div",{className:"container"},a.createElement("div",{className:"row"},d.map(((e,t)=>a.createElement(h,(0,i.Z)({key:t},e)))))))}const u=l.p+"assets/images/sern-logo-2f73c45b583c361a057d64bbc67a51f5.png";var v=l(1207);function g(){const{siteConfig:e}=(0,c.Z)();return a.createElement("header",{className:(0,n.Z)("hero hero--primary-darker",v.Z.heroBanner)},a.createElement("div",{className:"container"},a.createElement("div",{className:"container"},a.createElement("div",{className:"row"},a.createElement("div",{className:"col col--6 "},a.createElement("h1",{className:(0,n.Z)("hero__title",v.Z["padding-vert--md"]),style:{fontSize:"450%"}},a.createElement("b",null,e.title.slice(6))),a.createElement("p",{className:"hero__subtitle"},e.tagline),a.createElement(r.Z,{className:"button button--secondary button--lg",to:"docs/guide/walkthrough/cli"},"sern init")),a.createElement("div",{className:"col col--6"},a.createElement("img",{src:u,alt:"logo",height:"100%"}))),a.createElement("div",{className:v.Z.buttons}))))}function f(){const{siteConfig:e}=(0,c.Z)();return a.createElement(s.Z,{title:"sern - Handlers. Redefined.",description:"Description will go into a meta tag in"},a.createElement(g,null),a.createElement("main",{className:"user-select-none"},a.createElement("div",{className:"hero"},a.createElement(p,null))))}},1207:(e,t,l)=>{l.d(t,{Z:()=>a});const a={heroBanner:"heroBanner_qdFl",buttons:"buttons_AeoN","padding-vert--md":"padding-vert--md_IMB4"}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_sern_website=self.webpackChunk_sern_website||[]).push([[195],{4660:(e,t,l)=>{l.d(t,{Z:()=>r});var a=l(7294);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:l,...r}=e;return a.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",style:{enableBackground:"new 0 0 512 512"},xmlSpace:"preserve","aria-labelledby":l},r),t?a.createElement("title",{id:l},t):null,a.createElement("path",{style:{fill:"#34485c"},d:"M17.655 441.379h476.69V123.586H17.655z"}),a.createElement("path",{style:{fill:"#4897f7"},d:"M70.621 88.276h52.965V35.31H70.621z"}),a.createElement("path",{style:{fill:"#576d7e"},d:"M61.793 238.345h105.931v-35.311H61.793z"}),a.createElement("path",{style:{fill:"#397abc"},d:"M150.073 123.586H44.142l17.656-35.31h70.62z"}),a.createElement("path",{style:{fill:"#c6421e"},d:"M388.414 88.276h52.965V35.31h-52.965z"}),a.createElement("path",{style:{fill:"#992c13"},d:"M467.866 123.586H361.935l17.656-35.31h70.62z"}),a.createElement("path",{style:{fill:"#576d7e"},d:"M450.211 203.034h-35.31v-35.31h-35.31v35.31H344.28v35.311h35.311v35.31h35.31v-35.31h35.31zM0 476.69h512v-35.311H0zM176.556 44.138v79.448h35.31V79.475a8.854 8.854 0 0 1 8.854-8.854h70.568a8.854 8.854 0 0 1 8.854 8.854v44.111h35.31V44.138c0-4.873-3.955-8.828-8.828-8.828h-141.24c-4.873 0-8.828 3.955-8.828 8.828"}))}},5261:(e,t,l)=>{l.d(t,{Z:()=>r});var a=l(7294);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:l,...r}=e;return a.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 58 58",style:{enableBackground:"new 0 0 58 58"},xmlSpace:"preserve","aria-labelledby":l},r),t?a.createElement("title",{id:l},t):null,a.createElement("path",{style:{fill:"#e57e25"},d:"M25 37.376c1.539 0 2.938.584 4 1.537v-7.298a3.239 3.239 0 0 0-3.239-3.239h-7.448a6 6 0 1 0-6.628 0H3.239A3.239 3.239 0 0 0 0 31.615v8.447a6 6 0 1 1 0 6.628v7.447a3.239 3.239 0 0 0 3.239 3.239h22.523a3.239 3.239 0 0 0 3.239-3.239V47.84a5.973 5.973 0 0 1-4 1.537c-3.314 0-6-2.686-6-6A6 6 0 0 1 25 37.376z"}),a.createElement("path",{style:{fill:"#f0c419"},d:"M26.832 14.761a4.985 4.985 0 0 0 4.619-.971l-.269.917-1.71 5.824a2.693 2.693 0 0 0 1.825 3.343l5.943 1.745a4.99 4.99 0 1 0 5.289 1.554l6.741 1.98a2.693 2.693 0 0 0 3.343-1.825l1.98-6.741a4.99 4.99 0 1 1 1.554-5.289l1.745-5.943a2.693 2.693 0 0 0-1.825-3.343L38.093.733a2.693 2.693 0 0 0-3.343 1.825l-1.476 5.026-.269.917a4.989 4.989 0 0 0-9.554.066 4.99 4.99 0 0 0 3.381 6.194z"}))}},2527:(e,t,l)=>{l.d(t,{Z:()=>s});var a,n,r=l(7294);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:l,...s}=e;return r.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg","aria-label":"TypeScript",viewBox:"0 0 512 512","aria-labelledby":l},s),t?r.createElement("title",{id:l},t):null,a||(a=r.createElement("rect",{width:512,height:512,rx:"15%",fill:"#3178c6"})),n||(n=r.createElement("path",{fill:"#fff",d:"M233 284h64v-41H118v41h64v183h51zm84 173c8.1 4.2 18 7.3 29 9.4s23 3.1 35 3.1 23-1.1 34-3.4 20-6.1 28-11c8.1-5.3 15-12 19-21s7.1-19 7.1-32c0-9.1-1.4-17-4.1-24s-6.6-13-12-18c-5.1-5.3-11-10-18-14s-15-8.2-24-12c-6.6-2.7-12-5.3-18-7.9-5.2-2.6-9.7-5.2-13-7.8-3.7-2.7-6.5-5.5-8.5-8.4-2-3-3-6.3-3-10 0-3.4.89-6.5 2.7-9.3s4.3-5.1 7.5-7.1 7.2-3.5 12-4.6c4.7-1.1 9.9-1.6 16-1.6 4.2 0 8.6.31 13 .94 4.6.63 9.3 1.6 14 2.9 4.7 1.3 9.3 2.9 14 4.9 4.4 2 8.5 4.3 12 6.9v-47c-7.6-2.9-16-5.1-25-6.5s-19-2.1-31-2.1-23 1.3-34 3.8-20 6.5-28 12c-8.1 5.4-14 12-19 21-4.7 8.4-7 18-7 30 0 15 4.3 28 13 38 8.6 11 22 19 39 27 6.9 2.8 13 5.6 19 8.3s11 5.5 15 8.4c4.3 2.9 7.7 6.1 10 9.5 2.5 3.4 3.8 7.4 3.8 12 0 3.2-.78 6.2-2.3 9s-3.9 5.2-7.1 7.2-7.1 3.6-12 4.8c-4.7 1.1-10 1.7-17 1.7-11 0-22-1.9-32-5.7-11-3.8-21-9.5-28.1-15.44z"})))}},2773:(e,t,l)=>{l.r(t),l.d(t,{default:()=>f});var a=l(7294),n=l(6010),r=l(9960),c=l(2263),s=l(2164),i=l(7462);const o="features_t9lD",m="featureSvg_GfXr",d=[{title:"Batteries included",Svg:l(4660).Z,description:a.createElement(a.Fragment,null,"Start or integrate a new project in minutes.")},{title:"Customizable",Svg:l(5261).Z,description:a.createElement(a.Fragment,null,"Extend or customize with community-based plugins to provide utilities, filters, and more.")},{title:"Modern",Svg:l(2527).Z,description:a.createElement(a.Fragment,null,"Uses modern and powerful tooling such as",a.createElement("a",{href:"https://swc.rs/"}," swc"),",",a.createElement("a",{href:"https://tsup.egoist.dev/"}," tsup"),",",a.createElement("a",{href:"https://www.typescriptlang.org/"}," typescript"),", and",a.createElement("a",{href:"https://rxjs.dev/"}," rxjs")," to future-proof and ensure project quality.")}];function h(e){let{Svg:t,title:l,description:r}=e;return a.createElement("div",{className:(0,n.Z)("col col--4")},a.createElement("div",{className:"text--center"},a.createElement(t,{className:m,role:"img"})),a.createElement("div",{className:"text--center padding-horiz--md"},a.createElement("h3",null,l),a.createElement("p",null,r)))}function u(){return a.createElement("section",{className:o},a.createElement("div",{className:"container"},a.createElement("div",{className:"row"},d.map(((e,t)=>a.createElement(h,(0,i.Z)({key:t},e)))))))}const p=l.p+"assets/images/sern-logo-2f73c45b583c361a057d64bbc67a51f5.png";var v=l(1207);function g(){const{siteConfig:e}=(0,c.Z)();return a.createElement("header",{className:(0,n.Z)("hero hero--primary-darker",v.Z.heroBanner)},a.createElement("div",{className:"container"},a.createElement("div",{className:"container"},a.createElement("div",{className:"row"},a.createElement("div",{className:"col col--6 "},a.createElement("h1",{className:(0,n.Z)("hero__title",v.Z["padding-vert--md"]),style:{fontSize:"450%"}},a.createElement("b",null,e.title.slice(6))),a.createElement("p",{className:"hero__subtitle"},e.tagline),a.createElement(r.Z,{className:"button button--secondary button--lg",to:"docs/guide/walkthrough/cli"},"sern init")),a.createElement("div",{className:"col col--6"},a.createElement("img",{src:p,alt:"logo",height:"auto",width:"auto"}))),a.createElement("div",{className:v.Z.buttons}))))}function f(){const{siteConfig:e}=(0,c.Z)();return a.createElement(s.Z,{title:"sern - Handlers. Redefined.",description:"Description will go into a meta tag in"},a.createElement(g,null),a.createElement("main",{className:"user-select-none"},a.createElement("div",{className:"hero"},a.createElement(u,null))))}},1207:(e,t,l)=>{l.d(t,{Z:()=>a});const a={heroBanner:"heroBanner_qdFl",buttons:"buttons_AeoN","padding-vert--md":"padding-vert--md_IMB4"}}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.f0a137da.js b/assets/js/runtime~main.708326b2.js similarity index 98% rename from assets/js/runtime~main.f0a137da.js rename to assets/js/runtime~main.708326b2.js index bf6cec280..639cc4a9f 100644 --- a/assets/js/runtime~main.f0a137da.js +++ b/assets/js/runtime~main.708326b2.js @@ -1 +1 @@ -(()=>{"use strict";var e,t,r,a,f,c={},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={id:e,loaded:!1,exports:{}};return c[e].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}n.m=c,n.c=o,e=[],n.O=(t,r,a,f)=>{if(!r){var c=1/0;for(i=0;i=f)&&Object.keys(n.O).every((e=>n.O[e](r[d])))?r.splice(d--,1):(o=!1,f0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[r,a,f]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,n.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var f=Object.create(null);n.r(f);var c={};t=t||[null,r({}),r([]),r(r)];for(var o=2&a&&e;"object"==typeof o&&!~t.indexOf(o);o=r(o))Object.getOwnPropertyNames(o).forEach((t=>c[t]=()=>e[t]));return c.default=()=>e,n.d(f,c),f},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>"assets/js/"+({5:"1ac1bfe9",45:"888566f1",53:"5bc4ccbc",62:"69369ae2",85:"1f391b9e",127:"7e205c4a",137:"1aef51bd",146:"608ca171",195:"c4f5d8e4",197:"935f2afb",226:"707baeff",270:"e4877132",277:"c4348237",306:"f6aebfbf",322:"a5467962",332:"73bd57bd",363:"26f1f3a5",397:"312c2bc5",414:"393be207",429:"eea0bf40",472:"cf183316",514:"1be78505",597:"5e8c322a",640:"a96c96b0",652:"bcd9df7e",671:"0e384e19",703:"981f6151",712:"3dc7c79a",750:"3a2d3092",803:"9201de17",865:"e8e3d8c7",918:"17896441"}[e]||e)+"."+{5:"50c8b73c",45:"d285839b",53:"9cf1ed02",62:"1291f58b",85:"d7ab1744",127:"2da4208c",137:"b707e9d4",146:"929ab7c1",195:"57fa0488",197:"6efe90b2",226:"528132fe",270:"e0f6e50e",277:"bbd90c09",306:"98ec2cc1",322:"ad0a4733",332:"261b9526",363:"642e76b9",397:"1f24705a",414:"48b8d064",429:"7176d7bf",472:"924590e7",503:"668d49f6",514:"f852ff9f",597:"e656241d",640:"f14372bf",652:"892cfb09",671:"d84e5b34",703:"acf5ae36",712:"64018646",750:"a6116d90",803:"f87db6b3",865:"ea509898",918:"15289f85",972:"61be9a41"}[e]+".js",n.miniCssF=e=>{},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},f="@sern/website:",n.l=(e,t,r,c)=>{if(a[e])a[e].push(t);else{var o,d;if(void 0!==r)for(var b=document.getElementsByTagName("script"),i=0;i{o.onerror=o.onload=null,clearTimeout(s);var f=a[e];if(delete a[e],o.parentNode&&o.parentNode.removeChild(o),f&&f.forEach((e=>e(r))),t)return t(r)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),d&&document.head.appendChild(o)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/",n.gca=function(e){return e={17896441:"918","1ac1bfe9":"5","888566f1":"45","5bc4ccbc":"53","69369ae2":"62","1f391b9e":"85","7e205c4a":"127","1aef51bd":"137","608ca171":"146",c4f5d8e4:"195","935f2afb":"197","707baeff":"226",e4877132:"270",c4348237:"277",f6aebfbf:"306",a5467962:"322","73bd57bd":"332","26f1f3a5":"363","312c2bc5":"397","393be207":"414",eea0bf40:"429",cf183316:"472","1be78505":"514","5e8c322a":"597",a96c96b0:"640",bcd9df7e:"652","0e384e19":"671","981f6151":"703","3dc7c79a":"712","3a2d3092":"750","9201de17":"803",e8e3d8c7:"865"}[e]||e,n.p+n.u(e)},(()=>{var e={303:0,532:0};n.f.j=(t,r)=>{var a=n.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else if(/^(303|532)$/.test(t))e[t]=0;else{var f=new Promise(((r,f)=>a=e[t]=[r,f]));r.push(a[2]=f);var c=n.p+n.u(t),o=new Error;n.l(c,(r=>{if(n.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var f=r&&("load"===r.type?"missing":r.type),c=r&&r.target&&r.target.src;o.message="Loading chunk "+t+" failed.\n("+f+": "+c+")",o.name="ChunkLoadError",o.type=f,o.request=c,a[1](o)}}),"chunk-"+t,t)}},n.O.j=t=>0===e[t];var t=(t,r)=>{var a,f,c=r[0],o=r[1],d=r[2],b=0;if(c.some((t=>0!==e[t]))){for(a in o)n.o(o,a)&&(n.m[a]=o[a]);if(d)var i=d(n)}for(t&&t(r);b{"use strict";var e,t,r,a,f,c={},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={id:e,loaded:!1,exports:{}};return c[e].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}n.m=c,n.c=o,e=[],n.O=(t,r,a,f)=>{if(!r){var c=1/0;for(i=0;i=f)&&Object.keys(n.O).every((e=>n.O[e](r[d])))?r.splice(d--,1):(o=!1,f0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[r,a,f]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,n.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var f=Object.create(null);n.r(f);var c={};t=t||[null,r({}),r([]),r(r)];for(var o=2&a&&e;"object"==typeof o&&!~t.indexOf(o);o=r(o))Object.getOwnPropertyNames(o).forEach((t=>c[t]=()=>e[t]));return c.default=()=>e,n.d(f,c),f},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>"assets/js/"+({5:"1ac1bfe9",45:"888566f1",53:"5bc4ccbc",62:"69369ae2",85:"1f391b9e",127:"7e205c4a",137:"1aef51bd",146:"608ca171",195:"c4f5d8e4",197:"935f2afb",226:"707baeff",270:"e4877132",277:"c4348237",306:"f6aebfbf",322:"a5467962",332:"73bd57bd",363:"26f1f3a5",397:"312c2bc5",414:"393be207",429:"eea0bf40",472:"cf183316",514:"1be78505",597:"5e8c322a",640:"a96c96b0",652:"bcd9df7e",671:"0e384e19",703:"981f6151",712:"3dc7c79a",750:"3a2d3092",803:"9201de17",865:"e8e3d8c7",918:"17896441"}[e]||e)+"."+{5:"50c8b73c",45:"d285839b",53:"9cf1ed02",62:"1291f58b",85:"d7ab1744",127:"2da4208c",137:"b707e9d4",146:"929ab7c1",195:"be1a5759",197:"6efe90b2",226:"528132fe",270:"e0f6e50e",277:"bbd90c09",306:"98ec2cc1",322:"ad0a4733",332:"261b9526",363:"642e76b9",397:"1f24705a",414:"48b8d064",429:"7176d7bf",472:"924590e7",503:"668d49f6",514:"f852ff9f",597:"e656241d",640:"f14372bf",652:"892cfb09",671:"d84e5b34",703:"acf5ae36",712:"64018646",750:"a6116d90",803:"f87db6b3",865:"ea509898",918:"15289f85",972:"61be9a41"}[e]+".js",n.miniCssF=e=>{},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},f="@sern/website:",n.l=(e,t,r,c)=>{if(a[e])a[e].push(t);else{var o,d;if(void 0!==r)for(var b=document.getElementsByTagName("script"),i=0;i{o.onerror=o.onload=null,clearTimeout(s);var f=a[e];if(delete a[e],o.parentNode&&o.parentNode.removeChild(o),f&&f.forEach((e=>e(r))),t)return t(r)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),d&&document.head.appendChild(o)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/",n.gca=function(e){return e={17896441:"918","1ac1bfe9":"5","888566f1":"45","5bc4ccbc":"53","69369ae2":"62","1f391b9e":"85","7e205c4a":"127","1aef51bd":"137","608ca171":"146",c4f5d8e4:"195","935f2afb":"197","707baeff":"226",e4877132:"270",c4348237:"277",f6aebfbf:"306",a5467962:"322","73bd57bd":"332","26f1f3a5":"363","312c2bc5":"397","393be207":"414",eea0bf40:"429",cf183316:"472","1be78505":"514","5e8c322a":"597",a96c96b0:"640",bcd9df7e:"652","0e384e19":"671","981f6151":"703","3dc7c79a":"712","3a2d3092":"750","9201de17":"803",e8e3d8c7:"865"}[e]||e,n.p+n.u(e)},(()=>{var e={303:0,532:0};n.f.j=(t,r)=>{var a=n.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else if(/^(303|532)$/.test(t))e[t]=0;else{var f=new Promise(((r,f)=>a=e[t]=[r,f]));r.push(a[2]=f);var c=n.p+n.u(t),o=new Error;n.l(c,(r=>{if(n.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var f=r&&("load"===r.type?"missing":r.type),c=r&&r.target&&r.target.src;o.message="Loading chunk "+t+" failed.\n("+f+": "+c+")",o.name="ChunkLoadError",o.type=f,o.request=c,a[1](o)}}),"chunk-"+t,t)}},n.O.j=t=>0===e[t];var t=(t,r)=>{var a,f,c=r[0],o=r[1],d=r[2],b=0;if(c.some((t=>0!==e[t]))){for(a in o)n.o(o,a)&&(n.m[a]=o[a]);if(d)var i=d(n)}for(t&&t(r);b @sern/handler | sern - Handlers. Redefined. - +

SernHandler

NPM versionNPM downloadsMIT License

A customizable, batteries-included, powerful discord.js framework to automate and streamline your bot development.

Installation

npm install @sern/handler
yarn add @sern/handler
pnpm add @sern/handler

Basic Usage

index.js (CommonJS)

const { Client, GatewayIntentBits } = require('discord.js');
const { Sern } = require('@sern/handler');
const { defaultPrefix, token } = require('./config.json');

const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages
]
});

Sern.init({
client,
defaultPrefix,
commands : 'src/commands',
});

client.login(token);

ping.js (CommonJS)

const { Sern, CommandType, commandModule } = require('@sern/handler');

exports.default = commandModule({
description: 'A ping pong command',
type: CommandType.Slash,
execute(ctx) {
ctx.reply('pong!');
}
});

See our templates for TypeScript examples and more

CLI

It is highly encouraged to use the command line interface for your project. Don't forget to view it.

Contribute

  • Read our contribution guidelines carefully
  • Pull up on issues and report bugs
  • All kinds of contributions are welcomed.

Roadmap

You can check our roadmap to see what's going to be added or patched in the future.

- + \ No newline at end of file diff --git a/docs/api/classes/Context.html b/docs/api/classes/Context.html index 4fb34de5a..6f4cabebf 100644 --- a/docs/api/classes/Context.html +++ b/docs/api/classes/Context.html @@ -5,7 +5,7 @@ Class: Context | sern - Handlers. Redefined. - + @@ -16,7 +16,7 @@ CommandType.Text or the event fired in a Both command was Message

Returns

ChatInputCommandInteraction<CacheType>

Defined in

src/handler/structures/context.ts:52


member

get member(): Nullish<GuildMember | APIGuildMember>

Returns

Nullish<GuildMember | APIGuildMember>

Defined in

src/handler/structures/context.ts:101


message

get message(): Message<boolean>

Getting the Message object. Crashes if module type is CommandType.Slash or the event fired in a Both command was ChatInputCommandInteraction

Returns

Message<boolean>

Defined in

src/handler/structures/context.ts:44


user

get user(): User

Returns

User

Defined in

src/handler/structures/context.ts:70

Methods

isEmpty

isEmpty(): boolean

Returns

boolean

Defined in

src/handler/structures/context.ts:129


reply

reply(content): Promise<Message<boolean>>

Parameters

NameType
contentstring | Omit<InteractionReplyOptions, "fetchReply"> | ReplyMessageOptions

Returns

Promise<Message<boolean>>

Defined in

src/handler/structures/context.ts:133


wrap

Static wrap(wrappable): Context

Parameters

NameType
wrappableMessage<boolean> | ChatInputCommandInteraction<CacheType>

Returns

Context

Defined in

src/handler/structures/context.ts:122

- + \ No newline at end of file diff --git a/docs/api/classes/SernEmitter.html b/docs/api/classes/SernEmitter.html index 84fed72fd..5ace34e62 100644 --- a/docs/api/classes/SernEmitter.html +++ b/docs/api/classes/SernEmitter.html @@ -5,7 +5,7 @@ Class: SernEmitter | sern - Handlers. Redefined. - + @@ -49,7 +49,7 @@ given event.

This method is intentionally generic and works with the web p semantics and does not listen to the 'error' event.

const { once, EventEmitter } = require('events');

async function run() {
const ee = new EventEmitter();

process.nextTick(() => {
ee.emit('myevent', 42);
});

const [value] = await once(ee, 'myevent');
console.log(value);

const err = new Error('kaboom');
process.nextTick(() => {
ee.emit('error', err);
});

try {
await once(ee, 'myevent');
} catch (err) {
console.log('error happened', err);
}
}

run();

The special handling of the 'error' event is only used when events.once()is used to wait for another event. If events.once() is used to wait for the 'error' event itself, then it is treated as any other kind of event without special handling:

const { EventEmitter, once } = require('events');

const ee = new EventEmitter();

once(ee, 'error')
.then(([err]) => console.log('ok', err.message))
.catch((err) => console.log('error', err.message));

ee.emit('error', new Error('boom'));

// Prints: ok boom

An AbortSignal can be used to cancel waiting for the event:

const { EventEmitter, once } = require('events');

const ee = new EventEmitter();
const ac = new AbortController();

async function foo(emitter, event, signal) {
try {
await once(emitter, event, { signal });
console.log('event emitted!');
} catch (error) {
if (error.name === 'AbortError') {
console.error('Waiting for the event was canceled!');
} else {
console.error('There was an error', error.message);
}
}
}

foo(ee, 'foo', ac.signal);
ac.abort(); // Abort waiting for the event
ee.emit('foo'); // Prints: Waiting for the event was canceled!

Since

v11.13.0, v10.16.0

Parameters

NameType
emitterNodeEventTarget
eventNamestring | symbol
options?StaticEventEmitterOptions

Returns

Promise<any[]>

Inherited from

EventEmitter.once

Defined in

node_modules/@types/node/events.d.ts:157

Static once(emitter, eventName, options?): Promise<any[]>

Parameters

NameType
emitterDOMEventTarget
eventNamestring
options?StaticEventEmitterOptions

Returns

Promise<any[]>

Inherited from

EventEmitter.once

Defined in

node_modules/@types/node/events.d.ts:158

Static once<K>(eventEmitter, eventName): Promise<ClientEvents[K]>

Type parameters

NameType
Kextends keyof ClientEvents

Parameters

NameType
eventEmitterClient<boolean>
eventNameK

Returns

Promise<ClientEvents[K]>

Inherited from

EventEmitter.once

Defined in

node_modules/discord.js/typings/index.d.ts:194


setMaxListeners

Static setMaxListeners(n?, ...eventTargets): void

const {
setMaxListeners,
EventEmitter
} = require('events');

const target = new EventTarget();
const emitter = new EventEmitter();

setMaxListeners(5, target, emitter);

Since

v15.4.0

Parameters

NameTypeDescription
n?numberA non-negative number. The maximum number of listeners per EventTarget event.
...eventTargets(EventEmitter | DOMEventTarget)[]-

Returns

void

Inherited from

EventEmitter.setMaxListeners

Defined in

node_modules/@types/node/events.d.ts:280

- + \ No newline at end of file diff --git a/docs/api/enums/CommandType.html b/docs/api/enums/CommandType.html index 1e3c02013..c6758fa0c 100644 --- a/docs/api/enums/CommandType.html +++ b/docs/api/enums/CommandType.html @@ -5,13 +5,13 @@ Enumeration: CommandType | sern - Handlers. Redefined. - +

Enumeration: CommandType

Example

export default commandModule({
type : CommandType.Text,
name : 'a text command'
execute(message) {
console.log(message.content)
}
})

Enumeration Members

Both

Both = 3

The CommandType for hybrid commands, text and slash

Defined in

src/handler/structures/enums.ts:27


Button

Button = 16

The CommandType for ButtonInteraction commands

Defined in

src/handler/structures/enums.ts:39


MenuMsg = 8

The CommandType for MessageContextMenuInteraction commands

Defined in

src/handler/structures/enums.ts:35


MenuSelect = 32

The CommandType for SelectMenuInteraction commands

Defined in

src/handler/structures/enums.ts:43


MenuUser = 4

The CommandType for UserContextMenuInteraction commands

Defined in

src/handler/structures/enums.ts:31


Modal = 64

The CommandType for ModalSubmitInteraction commands

Defined in

src/handler/structures/enums.ts:47


Slash

Slash = 2

The CommandType for slash commands

Defined in

src/handler/structures/enums.ts:23


Text

Text = 1

The CommandType for text commands

Defined in

src/handler/structures/enums.ts:19

- + \ No newline at end of file diff --git a/docs/api/enums/EventType.html b/docs/api/enums/EventType.html index 5f0594c6f..964ebd249 100644 --- a/docs/api/enums/EventType.html +++ b/docs/api/enums/EventType.html @@ -5,14 +5,14 @@ Enumeration: EventType | sern - Handlers. Redefined. - +

Enumeration: EventType

Example

export default eventModule({
type : EventType.Discord,
name : 'guildMemberAdd'
execute(member : GuildMember) {
console.log(member)
}
})

Enumeration Members

Discord

Discord = 1

The EventType for handling discord events

Defined in

src/handler/structures/enums.ts:68


External

External = 3

The EventType for handling external events. Could be for example, process events, database events

Defined in

src/handler/structures/enums.ts:77


Sern

Sern = 2

The EventType for handling sern events

Defined in

src/handler/structures/enums.ts:72

- + \ No newline at end of file diff --git a/docs/api/enums/PayloadType.html b/docs/api/enums/PayloadType.html index 52e554e9d..48e2a7908 100644 --- a/docs/api/enums/PayloadType.html +++ b/docs/api/enums/PayloadType.html @@ -5,13 +5,13 @@ Enumeration: PayloadType | sern - Handlers. Redefined. - +
- + \ No newline at end of file diff --git a/docs/api/enums/PluginType.html b/docs/api/enums/PluginType.html index 11257fcbe..01df09b43 100644 --- a/docs/api/enums/PluginType.html +++ b/docs/api/enums/PluginType.html @@ -5,13 +5,13 @@ Enumeration: PluginType | sern - Handlers. Redefined. - +

Enumeration: PluginType

Example

export default function myPlugin() : EventPlugin<CommandType.Text> {
type : PluginType.Event,
execute([ctx, args], controller) {
return controller.next();
}
}

Enumeration Members

Command

Command = 1

The PluginType for CommandPlugins

Defined in

src/handler/structures/enums.ts:97


Event

Event = 2

The PluginType for EventPlugins

Defined in

src/handler/structures/enums.ts:101

- + \ No newline at end of file diff --git a/docs/api/interfaces/Controller.html b/docs/api/interfaces/Controller.html index c23d5bfe6..da641ac6b 100644 --- a/docs/api/interfaces/Controller.html +++ b/docs/api/interfaces/Controller.html @@ -5,13 +5,13 @@ Interface: Controller | sern - Handlers. Redefined. - +
- + \ No newline at end of file diff --git a/docs/api/interfaces/Wrapper.html b/docs/api/interfaces/Wrapper.html index 1ffc7c2ac..da9cb4d8c 100644 --- a/docs/api/interfaces/Wrapper.html +++ b/docs/api/interfaces/Wrapper.html @@ -5,13 +5,13 @@ Interface: Wrapper | sern - Handlers. Redefined. - +

Interface: Wrapper

An object to be passed into Sern#init() function.

Properties

client

Readonly client: Client<boolean>

Defined in

src/handler/structures/wrapper.ts:10


commands

Readonly commands: string

Defined in

src/handler/structures/wrapper.ts:13


defaultPrefix

Optional Readonly defaultPrefix: string

Defined in

src/handler/structures/wrapper.ts:12


events

Optional Readonly events: string | { absPath: string ; mod: EventModule }[] | () => { absPath: string ; mod: EventModule }[]

Defined in

src/handler/structures/wrapper.ts:14


sernEmitter

Optional Readonly sernEmitter: SernEmitter

Defined in

src/handler/structures/wrapper.ts:11

- + \ No newline at end of file diff --git a/docs/api/modules.html b/docs/api/modules.html index 73c20af8c..f8cc9c102 100644 --- a/docs/api/modules.html +++ b/docs/api/modules.html @@ -5,7 +5,7 @@ @sern/handler | sern - Handlers. Redefined. - + @@ -13,7 +13,7 @@

@sern/handler

Namespaces

Enumerations

Classes

Interfaces

Type Aliases

Args

Ƭ Args: ParseType<{ slash: SlashOptions ; text: string[] }>

Defined in

src/types/handler.ts:11


AutocompletePlugin

Ƭ AutocompletePlugin: Override<BaseModule, { execute: (autocmp: AutocompleteInteraction, controlller: Controller) => Awaitable<Result<void, void>> ; type: Event }>

Defined in

src/handler/plugins/plugin.ts:92


BaseOptions

Ƭ BaseOptions: ApplicationCommandChoicesData | ApplicationCommandNonOptionsData | ApplicationCommandChannelOptionData | ApplicationCommandNumericOptionData | ApplicationCommandAttachmentOption | SernAutocompleteData

Type that replaces autocomplete with SernAutocompleteData

Defined in

src/handler/structures/module.ts:181


BothCommand

Ƭ BothCommand: Override<BaseModule, { alias?: string[] ; execute: (ctx: Context, args: Args) => Awaitable<void | unknown> ; onEvent: EventPlugin<Both>[] ; options?: SernOptionsData[] ; plugins: CommandPlugin[] ; type: Both }>

Defined in

src/handler/structures/module.ts:55


CommandModuleNoPlugins

Ƭ CommandModuleNoPlugins: { [T in CommandType]: Omit<CommandModuleDefs[T], "plugins" | "onEvent"> }

Defined in

src/handler/plugins/plugin.ts:145


CommandModulePlugin

Ƭ CommandModulePlugin<T>: EventPlugin<T> | CommandPlugin<T>

Type parameters

NameType
Textends CommandType

Defined in

src/handler/plugins/plugin.ts:173


CommandPlugin

Ƭ CommandPlugin<T>: { [K in T]: Override<BasePlugin, Object> }[T]

Type parameters

NameType
Textends keyof CommandModuleDefs = keyof CommandModuleDefs

Defined in

src/handler/plugins/plugin.ts:40


DefinedCommandModule

Ƭ DefinedCommandModule: DefinitelyDefined<CommandModule, "name" | "description">

Defined in

src/types/handler.ts:48


DefinedEventModule

Ƭ DefinedEventModule: DefinitelyDefined<EventModule, "name" | "description">

Defined in

src/types/handler.ts:49


DefinedModule

Ƭ DefinedModule: DefinitelyDefined<Module, "name" | "description">

After modules are transformed, name and description are given default values if none are provided to Module. This type represents that transformation

Defined in

src/types/handler.ts:47


DefinitelyDefined

Ƭ DefinitelyDefined<T, K>: { [L in K]-?: T[L] extends Record<string, unknown> ? DefinitelyDefined<T[L], keyof T[L]> : Required<T>[L] } & T

Type parameters

NameType
TT
Kextends keyof T = keyof T

Defined in

src/types/handler.ts:18


DiscordEmitterPlugin

Ƭ DiscordEmitterPlugin: Override<BasePlugin, { execute: (wrapper: Client, module: DefinitelyDefined<DiscordEventCommand, "name" | "description">, controller: Controller) => Awaitable<Result<void, void>> ; type: Command }>

Defined in

src/handler/plugins/plugin.ts:57


DiscordEventPlugin

Ƭ DiscordEventPlugin<T>: Override<BasePlugin, { execute: (args: ClientEvents[T], controller: Controller) => Awaitable<Result<void, void>> ; name?: T ; type: Event }>

Type parameters

NameType
Textends keyof ClientEvents = keyof ClientEvents

Defined in

src/handler/plugins/plugin.ts:136


EventInput

Ƭ EventInput: string | { absPath: string ; mod: EventModule }[] | () => { absPath: string ; mod: EventModule }[]

Defined in

src/types/handler.ts:24


EventModuleCommandPluginDefs

Ƭ EventModuleCommandPluginDefs: Object

Event Module Command Plugins

Type declaration

NameType
1DiscordEmitterPlugin
2SernEmitterPlugin
3ExternalEmitterPlugin

Defined in

src/handler/plugins/plugin.ts:163


EventModuleEventPluginDefs

Ƭ EventModuleEventPluginDefs: Object

Event Module Event Plugins

Type declaration

NameType
1DiscordEventPlugin
2SernEventPlugin
3ExternalEventPlugin

Defined in

src/handler/plugins/plugin.ts:154


EventModulePlugin

Ƭ EventModulePlugin<T>: EventModuleEventPluginDefs[T] | EventModuleCommandPluginDefs[T]

Type parameters

NameType
Textends EventType

Defined in

src/handler/plugins/plugin.ts:169


EventModulesNoPlugins

Ƭ EventModulesNoPlugins: { [T in EventType]: Omit<EventModuleDefs[T], "plugins" | "onEvent"> }

Defined in

src/handler/plugins/plugin.ts:148


EventPlugin

Ƭ EventPlugin<T>: { [K in T]: Override<BasePlugin, Object> }[T]

Type parameters

NameType
Textends keyof CommandModuleDefs = keyof CommandModuleDefs

Defined in

src/handler/plugins/plugin.ts:103


ExternalEmitterPlugin

Ƭ ExternalEmitterPlugin<T>: Override<BasePlugin, { execute: (wrapper: T, module: DefinitelyDefined<ExternalEventCommand, "name" | "description">, controller: Controller) => Awaitable<Result<void, void>> ; type: Command }>

Type parameters

NameType
Textends EventEmitter = EventEmitter

Defined in

src/handler/plugins/plugin.ts:68


ExternalEventPlugin

Ƭ ExternalEventPlugin: Override<BasePlugin, { execute: (args: unknown[], controller: Controller) => Awaitable<Result<void, void>> ; type: Event }>

Defined in

src/handler/plugins/plugin.ts:128


InputCommandModule

Ƭ InputCommandModule: { [T in CommandType]: CommandModuleNoPlugins[T] & Object }[CommandType]

User inputs this type. Sern processes behind the scenes for better usage

Defined in

src/handler/plugins/plugin.ts:178


InputEventModule

Ƭ InputEventModule: { [T in EventType]: EventModulesNoPlugins[T] & Object }[EventType]

Defined in

src/handler/plugins/plugin.ts:182


IsOptional

Ƭ IsOptional<T>: { [K in keyof T]-?: T[K] extends Required<T>[K] ? false : true }

Type parameters

Name
T

Defined in

src/types/handler.ts:31


Module

Ƭ Module: CommandModule | EventModule

Defined in

src/handler/structures/module.ts:141


Nullish

Ƭ Nullish<T>: T | undefined | null

Type parameters

Name
T

Defined in

src/types/handler.ts:4


Override

Ƭ Override<T1, T2>: Omit<T1, keyof T2> & T2

Type parameters

Name
T1
T2

Defined in

src/types/handler.ts:16


ParseType

Ƭ ParseType<T>: { [K in keyof T]: T[K] extends unknown ? [k: K, args: T[K]] : never }[keyof T]

Type parameters

Name
T

Defined in

src/types/handler.ts:7


Payload

Ƭ Payload: { module: Module ; type: Success } | { module: Module | undefined ; reason: string | Error ; type: Failure }

Defined in

src/types/handler.ts:50


Reconstruct

Ƭ Reconstruct<T>: T extends Omit<infer O, never> ? O & Reconstruct<O> : T

Type parameters

Name
T

Defined in

src/types/handler.ts:29


SernAutocompleteData

Ƭ SernAutocompleteData: Override<BaseApplicationCommandOptionsData, { autocomplete: true ; command: AutocompleteCommand ; type: ApplicationCommandOptionType.String | ApplicationCommandOptionType.Number | ApplicationCommandOptionType.Integer }>

Defined in

src/handler/structures/module.ts:166


SernEmitterPlugin

Ƭ SernEmitterPlugin: Override<BasePlugin, { execute: (wrapper: SernEmitter, module: DefinitelyDefined<SernEventCommand, "name" | "description">, controller: Controller) => Awaitable<Result<void, void>> ; type: Command }>

Defined in

src/handler/plugins/plugin.ts:80


SernEventPlugin

Ƭ SernEventPlugin<T>: Override<BasePlugin, { execute: (args: SernEventsMapping[T], controller: Controller) => Awaitable<Result<void, void>> ; name?: T ; type: Event }>

Type parameters

NameType
Textends keyof SernEventsMapping = keyof SernEventsMapping

Defined in

src/handler/plugins/plugin.ts:116


SernEventsMapping

Ƭ SernEventsMapping: Object

Type declaration

NameType
error[Error | string]
module.activate[Payload]
module.register[Payload]
warning[string]

Defined in

src/types/handler.ts:53


SernOptionsData

Ƭ SernOptionsData<U>: U extends ApplicationCommandSubCommandData ? SernSubCommandData : U extends ApplicationCommandSubGroupData ? SernSubCommandGroupData : BaseOptions

Type parameters

NameType
Uextends ApplicationCommandOptionData = ApplicationCommandOptionData

Defined in

src/handler/structures/module.ts:205


SernSubCommandData

Ƭ SernSubCommandData: Override<Omit<BaseApplicationCommandOptionsData, "required">, { options?: BaseOptions[] ; type: ApplicationCommandOptionType.Subcommand }>

Defined in

src/handler/structures/module.ts:189


SernSubCommandGroupData

Ƭ SernSubCommandGroupData: Override<Omit<BaseApplicationCommandOptionsData, "required">, { options?: SernSubCommandData[] ; type: ApplicationCommandOptionType.SubcommandGroup }>

Defined in

src/handler/structures/module.ts:197


SlashCommand

Ƭ SlashCommand: Override<BaseModule, { execute: (ctx: Context, args: ["slash", SlashOptions]) => Awaitable<void | unknown> ; onEvent: EventPlugin<Slash>[] ; options?: SernOptionsData[] ; plugins: CommandPlugin[] ; type: Slash }>

Defined in

src/handler/structures/module.ts:44


SlashOptions

Ƭ SlashOptions: Omit<CommandInteractionOptionResolver, "getMessage" | "getFocused">

Defined in

src/types/handler.ts:13


SpreadParams

Ƭ SpreadParams<T>: (args: Parameters<T>[number]) => unknown

Type parameters

NameType
Textends (...args: never) => unknown

Type declaration

▸ (args): unknown

Turns a function with a union of array of args into a single union [ T , V , B ] | [ A ] => T | V | B | A

Parameters
NameType
argsParameters<T>[number]
Returns

unknown

Defined in

src/types/handler.ts:39


TextCommand

Ƭ TextCommand: Override<BaseModule, { alias?: string[] ; execute: (ctx: Context, args: ["text", string[]]) => Awaitable<void | unknown> ; onEvent: EventPlugin<Text>[] ; plugins: CommandPlugin[] ; type: Text }>

Defined in

src/handler/structures/module.ts:33

Functions

commandModule

commandModule(mod): CommandModule

The wrapper function to define command modules for sern

Parameters

NameType
modInputCommandModule

Returns

CommandModule

Defined in

src/handler/sern.ts:86


eventModule

eventModule(mod): EventModule

The wrapper function to define event modules for sern

Parameters

NameType
modInputEventModule

Returns

EventModule

Defined in

src/handler/sern.ts:107

- + \ No newline at end of file diff --git a/docs/api/namespaces/Sern.html b/docs/api/namespaces/Sern.html index 421ffb259..831baf99c 100644 --- a/docs/api/namespaces/Sern.html +++ b/docs/api/namespaces/Sern.html @@ -5,13 +5,13 @@ Namespace: Sern | sern - Handlers. Redefined. - +

Namespace: Sern

References

commandModule

Re-exports commandModule


eventModule

Re-exports eventModule

Variables

controller

Const controller: Object

The object passed into every plugin to control a command's behavior

Type declaration

NameType
next() => OkImpl<void>
stop() => ErrImpl<void>

Defined in

src/handler/sern.ts:77

Functions

addExternal

addExternal<T>(emitter): void

Example

src/index.ts
//Add this before initiating Sern!
Sern.addExternal(new Level())

Example

events/level.ts
 export default eventModule({
emitter: 'Level',
type : EventType.External,
name: 'error',
execute(args) {
console.log(args)
}
})

Type parameters

NameType
Textends __module

Parameters

NameTypeDescription
emitterTAny external event emitter. The object will be stored in a map, and then fetched by the name of the instance's class. As there are infinite possibilities to adding external event emitters, Most types aren't provided and are as narrow as possibly can.

Returns

void

Defined in

src/handler/sern.ts:67


init

init(wrapper): void

Example

src/index.ts
Sern.init({
client,
defaultPrefix: '!',
commands: 'dist/commands',
})

Parameters

NameTypeDescription
wrapperWrapperOptions to pass into sern. Function to start the handler up

Returns

void

Defined in

src/handler/sern.ts:34

- + \ No newline at end of file diff --git a/docs/guide.html b/docs/guide.html index b6bcf8d9d..ab70fc2f8 100644 --- a/docs/guide.html +++ b/docs/guide.html @@ -5,13 +5,13 @@ Introduction | sern - Handlers. Redefined. - +

Introduction

Welcome to our official guide. This guide will go through all the core features of the framework.

  • 💖 Thank you for choosing sern to be your framework!

  • Teaching the discord.js library and / or Javascript / Typescript is out of scope of this project, so the documentation assumes you already know these elements.

  • discord.js v14 is the only supported library at the moment

You will learn

Working with plugins

Events

Good to know

- + \ No newline at end of file diff --git a/docs/guide/getting-started/choose-ide.html b/docs/guide/getting-started/choose-ide.html index 411593dba..7485c71de 100644 --- a/docs/guide/getting-started/choose-ide.html +++ b/docs/guide/getting-started/choose-ide.html @@ -5,14 +5,14 @@ Choosing an IDE | sern - Handlers. Redefined. - +
- + \ No newline at end of file diff --git a/docs/guide/getting-started/preparing.html b/docs/guide/getting-started/preparing.html index b14b326f8..a6490d92d 100644 --- a/docs/guide/getting-started/preparing.html +++ b/docs/guide/getting-started/preparing.html @@ -5,13 +5,13 @@ Preparing to Code | sern - Handlers. Redefined. - +

Preparing to Code

After installing and IDE you need to install node.

You can download the LTS version of node right here

- + \ No newline at end of file diff --git a/docs/guide/walkthrough/cli.html b/docs/guide/walkthrough/cli.html index 7ed62d0ac..71298d9eb 100644 --- a/docs/guide/walkthrough/cli.html +++ b/docs/guide/walkthrough/cli.html @@ -5,7 +5,7 @@ CLI | sern - Handlers. Redefined. - + @@ -13,7 +13,7 @@

CLI

Setting up the CLI is easy.

  • To start a brand-new project, run :
sern init (-y)
tip

It creates a directory for you so you don't need to!

Include the -y flag if you want to set up defaults. The default langauge is Typescript

sern plugins
info

Make sure to have a correct sern.config.json

This will display a menu selection of all installable plugins.
Note: You must have a sern.config.json to use this command. If you want to view plugins, visit the repository linked above.

  • To install extra utilities into your project
sern extra
- + \ No newline at end of file diff --git a/docs/guide/walkthrough/conclusion.html b/docs/guide/walkthrough/conclusion.html index 70db68388..4a146d68c 100644 --- a/docs/guide/walkthrough/conclusion.html +++ b/docs/guide/walkthrough/conclusion.html @@ -5,7 +5,7 @@ Conclusion | sern - Handlers. Redefined. - + @@ -13,7 +13,7 @@

Conclusion

If you reached this far, thank you for reading! We hope you have learned the necessities you need to create a bot with the sern framework. If you have any other questions, bugs, feature requests, concerns, please join our community server, and we'll be glad to answer your questions.

- + \ No newline at end of file diff --git a/docs/guide/walkthrough/first-command.html b/docs/guide/walkthrough/first-command.html index 99f3acd1e..f919bfa17 100644 --- a/docs/guide/walkthrough/first-command.html +++ b/docs/guide/walkthrough/first-command.html @@ -5,7 +5,7 @@ First Command | sern - Handlers. Redefined. - + @@ -14,7 +14,7 @@ If you installed a new project via the cli, This is the ping command located in src/commands folder.

Typescript

import { commandModule, CommandType } from '@sern/handler';

export default commandModule({
type: CommandType.Both,
plugins: [],
description: 'A ping command',
//alias : [],
execute: async (ctx, args) => {
await ctx.reply({ content: 'Pong 🏓' });
},
});

Javascript

const { CommandType, commandModule } = require('@sern/handler');

exports.default = commandModule({
type: CommandType.Both,
plugins: [],
description: 'A ping command',
//alias : [],
execute: async (ctx, args) => {
await ctx.reply('Pong 🏓');
},
})

To view what each of these properties mean in depth, visit the official documentation.

Types of command modules

Every command module type is part of an enum. This field allows type inference for the rest of a module's fields.
All the command types can be found in the official documentation!

So, lets say you want to make a command module that listens to modals.

Note: Keep in mind you'll need to send a modal with a custom id dm-me. This example below is the response to a modal being sent.


Typescript:

import { commandModule, CommandType } from '@sern/handler';
export default commandModule({
name: 'dm-me',
type: CommandType.Modal,
async execute (modal) {
const value = modal.fields.getTextInputValue('message');
modal.client.users.fetch('182326315813306368').then( u =>
u.send(value + ` from ${modal.user}`)
);
modal.reply( { ephemeral:true, content: 'Sent' })
}
});

Javascript:

const { CommandType, commandModule } = require('@sern/handler');
exports.default = commandModule({
name: 'dm-me',
type: CommandType.Modal,
async execute (modal) {
const value = modal.fields.getTextInputValue('message');
modal.client.users.fetch('182326315813306368').then( u =>
u.send(value + ` from ${modal.user}`)
);
modal.reply( { ephemeral:true, content: 'Sent' })
}
});

Commands are straight forward. Keep in mind, every other property on the commandModule object is optional except the type and execute function.

Context class

The provided Context class helps with modules of CommandType.Both (A mixture of slash / legacy commands).

The Context class is passed into modules with type :

  • CommandType.Both
  • CommandType.Slash
  • CommandType.Text

This data structure helps interop between legacy commands and slash commands with ease.

note

View the docs

Typescript:

export default commandModule({
name: 'ping',
type: CommandType.Both,
async execute(ctx: Context) {
await ctx.reply(`pong ${ctx.user}`)
// .reply is shared between both message and interaction!
// So is an User object!
}
});

Javascript:

exports.default = commandModule({
name: 'ping',
type: CommandType.Both,
async execute(ctx) { //ctx is a Context instance
await ctx.reply(`pong ${ctx.user}`)
// .reply is shared between both message and interaction!
// So is an User object!
}
});
- + \ No newline at end of file diff --git a/docs/guide/walkthrough/first-event.html b/docs/guide/walkthrough/first-event.html index fa2bf3337..ce863de63 100644 --- a/docs/guide/walkthrough/first-event.html +++ b/docs/guide/walkthrough/first-event.html @@ -5,7 +5,7 @@ First Event Module | sern - Handlers. Redefined. - + @@ -13,7 +13,7 @@

First Event Module

We will dissect a basic event module.
Typescript:

export default eventModule({
type: EventType.Sern,
plugins : [], //NOT SUPPORTED YET!!
name: 'module.activate', //name of event.
execute(event) {
console.log(event);
}
})

Javascript:

exports.default = eventModule({
type: EventType.Sern,
plugins : [], //NOT SUPPORTED YET!!
name: 'module.activate',
execute(event) {
console.log(event);
}
})

Like command modules, the type property denotes what kind of event it is, which can be found here.

To view what each of these properties mean in depth, visit the official documentation.


Event modules are laid out similarly to command modules. These listen to any and all event you provide. In the current version 1.1.0-beta, plugins are not supported.

Another example of an event module

Typescript:

export default eventModule({
type: EventType.Discord,
plugins : [], //NOT SUPPORTED YET!!
name: 'guildMemberAdd', //name of event.
async execute(member: GuildMember) {
(await member.guild.channels.fetch('channel-id') as TextChannel).send(`Welcome, ${member}`);
}
})

Javascript:


exports.default = eventModule({
type: EventType.Discord,
plugins : [], //NOT SUPPORTED YET!!
name: 'guildMemberAdd', //name of event.
async execute(member) {
(await member.guild.channels.fetch('channel-id')).send(`Welcome, ${member}`);
}
})
- + \ No newline at end of file diff --git a/docs/guide/walkthrough/goal.html b/docs/guide/walkthrough/goal.html index 675cc6bbc..cbd67e14f 100644 --- a/docs/guide/walkthrough/goal.html +++ b/docs/guide/walkthrough/goal.html @@ -5,7 +5,7 @@ Goal | sern - Handlers. Redefined. - + @@ -13,7 +13,7 @@

Goal

sern strives to be minimalist, but with all batteries included. Meaning, this framework provides the necessary tools to start up a bot in minutes, and leaves plenty room space to customize your experience and create an amazing project. It should include all the tools for any bot at any scale.

- + \ No newline at end of file diff --git a/docs/guide/walkthrough/good-to-know.html b/docs/guide/walkthrough/good-to-know.html index 0f828c566..7c800a126 100644 --- a/docs/guide/walkthrough/good-to-know.html +++ b/docs/guide/walkthrough/good-to-know.html @@ -5,7 +5,7 @@ Good to know | sern - Handlers. Redefined. - + @@ -13,7 +13,7 @@

Good to know

sern.config.json

A sern.config.json, although not necessary, allows your project to communicate with our cli.

For example, when installing typescript plugins, the language property is necessary to install from our open source repository.

Using the cli and running sern init --sync on pre-existing projects should install this json file in the root directory given. Or, if this is a brand-new project, sern init automatically installs it.

{
"language": "typescript",
"paths": {
"base": "src",
"commands": "commands"
}
}
- + \ No newline at end of file diff --git a/docs/guide/walkthrough/plugins.html b/docs/guide/walkthrough/plugins.html index 21663bae6..789c5f933 100644 --- a/docs/guide/walkthrough/plugins.html +++ b/docs/guide/walkthrough/plugins.html @@ -5,7 +5,7 @@ Plugins | sern - Handlers. Redefined. - + @@ -16,7 +16,7 @@ This controls whether a module is stored into sern.
Typescript:

export function inDir(dir : string) : CommandPlugin<CommandType.Both> {
return {
type: PluginType.Command,
async execute(wrapper, { absPath, module }, controller) {
if(path.dirname(absPath) !== dir) {
console.log(+new Date(), `${module.name} is not in the correct directory!`);
return controller.stop()
}
console.log(+new Date(), `${module.name} is in the correct directory!`);
return controller.next(); //continue
}
}
}

Javascript:

export function inDir(dir : string) {
return {
type: PluginType.Command,
async execute(wrapper, { absPath, module }, controller) {
if(path.dirname(absPath) !== dir) {
console.log(+new Date(), `${module.name} is not in the correct directory!`);
return controller.stop()
}
console.log(+new Date(), `${module.name} is in the correct directory!`);
return controller.next(); //continue
}
}
}

Above, this simple plugin logs that the module has been loaded along with a timestamp.
Again, it is up to you to define plugin logic! The possibilities to customize your bots are endless.

tip

Command Plugins are good for ensuring the shape, location, and preprocessing of your commands.

Event Plugins

event-plugins

  • An event is emitted by discord.js.
  • This event is passed to all plugins (in order!!),
  • If all are successful,

The command is executed. Calling controller.stop() notifies sern that this command should not be run, and this event is ignored.

So, what does a command module look like with plugins?

Typescript:

import { commandModule, CommandType } from '@sern/handler';

export default commandModule({
type: CommandType.Both,
plugins: [
inDir("other"),
serenOnly()
],
description: 'A ping command',
//alias : [],
execute: async (ctx, args) => {
await ctx.reply({ content: 'Pong 🏓' });
},
});

Javascript:

const { commandModule, CommandType } = require('@sern/handler');

exports.default = commandModule({
type: CommandType.Both,
plugins: [
inDir("other"),
serenOnly() //The plugins in this section applied to this module!
],
description: 'A ping command',
//alias : [],
execute: async (ctx, args) => {
await ctx.reply({ content: 'Pong 🏓' });
},
});

Can you predict the behavior of this command?

  • Before loading into sern, this command module will check if this module is in the correct directory other.
  • Before an event occurs, this command module will check if the user has the id 182326315813306368.
tip

Event Plugins are good for filtering, preconditions, parsing.

If all plugins return controller.next(), this command replies Pong 🏓

- + \ No newline at end of file diff --git a/docs/guide/walkthrough/sern-emitter.html b/docs/guide/walkthrough/sern-emitter.html index f264000e6..5ba9eaca8 100644 --- a/docs/guide/walkthrough/sern-emitter.html +++ b/docs/guide/walkthrough/sern-emitter.html @@ -5,13 +5,13 @@ The SernEmitter class | sern - Handlers. Redefined. - +

The SernEmitter class

You're shipped with the SernEmitter. This EventEmitter listens to

  • command modules executing and its status, the module.activate event
  • command modules registered and its status, the module.register event
  • any error that occurs, the error event
  • warn events, where it is possible to throw errors

You can put these and other event listeners into event modules!


View all events
- + \ No newline at end of file diff --git a/docs/intro.html b/docs/intro.html index 36b1f5ecd..046d14b8a 100644 --- a/docs/intro.html +++ b/docs/intro.html @@ -5,13 +5,13 @@ Welcome! | sern - Handlers. Redefined. - +

Welcome!

Content

  • /docs/api contains autogenerated documentation of our codebase using typedoc
  • /docs/guide contains a basic startup guide and details to get started with sern faster!
tip

This site is open source! Please do contribute if you find any bugs, typos, or sections in need of improvements.

tip

If you have problems, join the discord server here

- + \ No newline at end of file diff --git a/fr/404.html b/fr/404.html index 859d56f07..5ead7078b 100644 --- a/fr/404.html +++ b/fr/404.html @@ -5,13 +5,13 @@ Page introuvable | sern - Handlers. Redefined. - +

Page introuvable

Nous n'avons pas trouvé ce que vous recherchez.

Veuillez contacter le propriétaire du site qui vous a lié à l'URL d'origine et leur faire savoir que leur lien est cassé.

- + \ No newline at end of file diff --git a/tr/assets/js/c4f5d8e4.57fa0488.js b/fr/assets/js/c4f5d8e4.be1a5759.js similarity index 90% rename from tr/assets/js/c4f5d8e4.57fa0488.js rename to fr/assets/js/c4f5d8e4.be1a5759.js index 3e2aec4da..2c81795b8 100644 --- a/tr/assets/js/c4f5d8e4.57fa0488.js +++ b/fr/assets/js/c4f5d8e4.be1a5759.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_sern_website=self.webpackChunk_sern_website||[]).push([[195],{4660:(e,t,l)=>{l.d(t,{Z:()=>r});var a=l(7294);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:l,...r}=e;return a.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",style:{enableBackground:"new 0 0 512 512"},xmlSpace:"preserve","aria-labelledby":l},r),t?a.createElement("title",{id:l},t):null,a.createElement("path",{style:{fill:"#34485c"},d:"M17.655 441.379h476.69V123.586H17.655z"}),a.createElement("path",{style:{fill:"#4897f7"},d:"M70.621 88.276h52.965V35.31H70.621z"}),a.createElement("path",{style:{fill:"#576d7e"},d:"M61.793 238.345h105.931v-35.311H61.793z"}),a.createElement("path",{style:{fill:"#397abc"},d:"M150.073 123.586H44.142l17.656-35.31h70.62z"}),a.createElement("path",{style:{fill:"#c6421e"},d:"M388.414 88.276h52.965V35.31h-52.965z"}),a.createElement("path",{style:{fill:"#992c13"},d:"M467.866 123.586H361.935l17.656-35.31h70.62z"}),a.createElement("path",{style:{fill:"#576d7e"},d:"M450.211 203.034h-35.31v-35.31h-35.31v35.31H344.28v35.311h35.311v35.31h35.31v-35.31h35.31zM0 476.69h512v-35.311H0zM176.556 44.138v79.448h35.31V79.475a8.854 8.854 0 0 1 8.854-8.854h70.568a8.854 8.854 0 0 1 8.854 8.854v44.111h35.31V44.138c0-4.873-3.955-8.828-8.828-8.828h-141.24c-4.873 0-8.828 3.955-8.828 8.828"}))}},5261:(e,t,l)=>{l.d(t,{Z:()=>r});var a=l(7294);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:l,...r}=e;return a.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 58 58",style:{enableBackground:"new 0 0 58 58"},xmlSpace:"preserve","aria-labelledby":l},r),t?a.createElement("title",{id:l},t):null,a.createElement("path",{style:{fill:"#e57e25"},d:"M25 37.376c1.539 0 2.938.584 4 1.537v-7.298a3.239 3.239 0 0 0-3.239-3.239h-7.448a6 6 0 1 0-6.628 0H3.239A3.239 3.239 0 0 0 0 31.615v8.447a6 6 0 1 1 0 6.628v7.447a3.239 3.239 0 0 0 3.239 3.239h22.523a3.239 3.239 0 0 0 3.239-3.239V47.84a5.973 5.973 0 0 1-4 1.537c-3.314 0-6-2.686-6-6A6 6 0 0 1 25 37.376z"}),a.createElement("path",{style:{fill:"#f0c419"},d:"M26.832 14.761a4.985 4.985 0 0 0 4.619-.971l-.269.917-1.71 5.824a2.693 2.693 0 0 0 1.825 3.343l5.943 1.745a4.99 4.99 0 1 0 5.289 1.554l6.741 1.98a2.693 2.693 0 0 0 3.343-1.825l1.98-6.741a4.99 4.99 0 1 1 1.554-5.289l1.745-5.943a2.693 2.693 0 0 0-1.825-3.343L38.093.733a2.693 2.693 0 0 0-3.343 1.825l-1.476 5.026-.269.917a4.989 4.989 0 0 0-9.554.066 4.99 4.99 0 0 0 3.381 6.194z"}))}},2527:(e,t,l)=>{l.d(t,{Z:()=>s});var a,n,r=l(7294);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:l,...s}=e;return r.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg","aria-label":"TypeScript",viewBox:"0 0 512 512","aria-labelledby":l},s),t?r.createElement("title",{id:l},t):null,a||(a=r.createElement("rect",{width:512,height:512,rx:"15%",fill:"#3178c6"})),n||(n=r.createElement("path",{fill:"#fff",d:"M233 284h64v-41H118v41h64v183h51zm84 173c8.1 4.2 18 7.3 29 9.4s23 3.1 35 3.1 23-1.1 34-3.4 20-6.1 28-11c8.1-5.3 15-12 19-21s7.1-19 7.1-32c0-9.1-1.4-17-4.1-24s-6.6-13-12-18c-5.1-5.3-11-10-18-14s-15-8.2-24-12c-6.6-2.7-12-5.3-18-7.9-5.2-2.6-9.7-5.2-13-7.8-3.7-2.7-6.5-5.5-8.5-8.4-2-3-3-6.3-3-10 0-3.4.89-6.5 2.7-9.3s4.3-5.1 7.5-7.1 7.2-3.5 12-4.6c4.7-1.1 9.9-1.6 16-1.6 4.2 0 8.6.31 13 .94 4.6.63 9.3 1.6 14 2.9 4.7 1.3 9.3 2.9 14 4.9 4.4 2 8.5 4.3 12 6.9v-47c-7.6-2.9-16-5.1-25-6.5s-19-2.1-31-2.1-23 1.3-34 3.8-20 6.5-28 12c-8.1 5.4-14 12-19 21-4.7 8.4-7 18-7 30 0 15 4.3 28 13 38 8.6 11 22 19 39 27 6.9 2.8 13 5.6 19 8.3s11 5.5 15 8.4c4.3 2.9 7.7 6.1 10 9.5 2.5 3.4 3.8 7.4 3.8 12 0 3.2-.78 6.2-2.3 9s-3.9 5.2-7.1 7.2-7.1 3.6-12 4.8c-4.7 1.1-10 1.7-17 1.7-11 0-22-1.9-32-5.7-11-3.8-21-9.5-28.1-15.44z"})))}},2773:(e,t,l)=>{l.r(t),l.d(t,{default:()=>f});var a=l(7294),n=l(6010),r=l(9960),c=l(2263),s=l(2164),i=l(7462);const o="features_t9lD",m="featureSvg_GfXr",d=[{title:"Batteries included",Svg:l(4660).Z,description:a.createElement(a.Fragment,null,"Start or integrate a new project in minutes.")},{title:"Customizable",Svg:l(5261).Z,description:a.createElement(a.Fragment,null,"Extend or customize with community-based plugins to provide utilities, filters, and more.")},{title:"Modern",Svg:l(2527).Z,description:a.createElement(a.Fragment,null,"Uses modern and powerful tooling such as",a.createElement("a",{href:"https://swc.rs/"}," swc"),",",a.createElement("a",{href:"https://tsup.egoist.dev/"}," tsup"),",",a.createElement("a",{href:"https://www.typescriptlang.org/"}," typescript"),", and",a.createElement("a",{href:"https://rxjs.dev/"}," rxjs")," to future-proof and ensure project quality.")}];function h(e){let{Svg:t,title:l,description:r}=e;return a.createElement("div",{className:(0,n.Z)("col col--4")},a.createElement("div",{className:"text--center"},a.createElement(t,{className:m,role:"img"})),a.createElement("div",{className:"text--center padding-horiz--md"},a.createElement("h3",null,l),a.createElement("p",null,r)))}function p(){return a.createElement("section",{className:o},a.createElement("div",{className:"container"},a.createElement("div",{className:"row"},d.map(((e,t)=>a.createElement(h,(0,i.Z)({key:t},e)))))))}const u=l.p+"assets/images/sern-logo-2f73c45b583c361a057d64bbc67a51f5.png";var v=l(1207);function g(){const{siteConfig:e}=(0,c.Z)();return a.createElement("header",{className:(0,n.Z)("hero hero--primary-darker",v.Z.heroBanner)},a.createElement("div",{className:"container"},a.createElement("div",{className:"container"},a.createElement("div",{className:"row"},a.createElement("div",{className:"col col--6 "},a.createElement("h1",{className:(0,n.Z)("hero__title",v.Z["padding-vert--md"]),style:{fontSize:"450%"}},a.createElement("b",null,e.title.slice(6))),a.createElement("p",{className:"hero__subtitle"},e.tagline),a.createElement(r.Z,{className:"button button--secondary button--lg",to:"docs/guide/walkthrough/cli"},"sern init")),a.createElement("div",{className:"col col--6"},a.createElement("img",{src:u,alt:"logo",height:"100%"}))),a.createElement("div",{className:v.Z.buttons}))))}function f(){const{siteConfig:e}=(0,c.Z)();return a.createElement(s.Z,{title:"sern - Handlers. Redefined.",description:"Description will go into a meta tag in"},a.createElement(g,null),a.createElement("main",{className:"user-select-none"},a.createElement("div",{className:"hero"},a.createElement(p,null))))}},1207:(e,t,l)=>{l.d(t,{Z:()=>a});const a={heroBanner:"heroBanner_qdFl",buttons:"buttons_AeoN","padding-vert--md":"padding-vert--md_IMB4"}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_sern_website=self.webpackChunk_sern_website||[]).push([[195],{4660:(e,t,l)=>{l.d(t,{Z:()=>r});var a=l(7294);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:l,...r}=e;return a.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",style:{enableBackground:"new 0 0 512 512"},xmlSpace:"preserve","aria-labelledby":l},r),t?a.createElement("title",{id:l},t):null,a.createElement("path",{style:{fill:"#34485c"},d:"M17.655 441.379h476.69V123.586H17.655z"}),a.createElement("path",{style:{fill:"#4897f7"},d:"M70.621 88.276h52.965V35.31H70.621z"}),a.createElement("path",{style:{fill:"#576d7e"},d:"M61.793 238.345h105.931v-35.311H61.793z"}),a.createElement("path",{style:{fill:"#397abc"},d:"M150.073 123.586H44.142l17.656-35.31h70.62z"}),a.createElement("path",{style:{fill:"#c6421e"},d:"M388.414 88.276h52.965V35.31h-52.965z"}),a.createElement("path",{style:{fill:"#992c13"},d:"M467.866 123.586H361.935l17.656-35.31h70.62z"}),a.createElement("path",{style:{fill:"#576d7e"},d:"M450.211 203.034h-35.31v-35.31h-35.31v35.31H344.28v35.311h35.311v35.31h35.31v-35.31h35.31zM0 476.69h512v-35.311H0zM176.556 44.138v79.448h35.31V79.475a8.854 8.854 0 0 1 8.854-8.854h70.568a8.854 8.854 0 0 1 8.854 8.854v44.111h35.31V44.138c0-4.873-3.955-8.828-8.828-8.828h-141.24c-4.873 0-8.828 3.955-8.828 8.828"}))}},5261:(e,t,l)=>{l.d(t,{Z:()=>r});var a=l(7294);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:l,...r}=e;return a.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 58 58",style:{enableBackground:"new 0 0 58 58"},xmlSpace:"preserve","aria-labelledby":l},r),t?a.createElement("title",{id:l},t):null,a.createElement("path",{style:{fill:"#e57e25"},d:"M25 37.376c1.539 0 2.938.584 4 1.537v-7.298a3.239 3.239 0 0 0-3.239-3.239h-7.448a6 6 0 1 0-6.628 0H3.239A3.239 3.239 0 0 0 0 31.615v8.447a6 6 0 1 1 0 6.628v7.447a3.239 3.239 0 0 0 3.239 3.239h22.523a3.239 3.239 0 0 0 3.239-3.239V47.84a5.973 5.973 0 0 1-4 1.537c-3.314 0-6-2.686-6-6A6 6 0 0 1 25 37.376z"}),a.createElement("path",{style:{fill:"#f0c419"},d:"M26.832 14.761a4.985 4.985 0 0 0 4.619-.971l-.269.917-1.71 5.824a2.693 2.693 0 0 0 1.825 3.343l5.943 1.745a4.99 4.99 0 1 0 5.289 1.554l6.741 1.98a2.693 2.693 0 0 0 3.343-1.825l1.98-6.741a4.99 4.99 0 1 1 1.554-5.289l1.745-5.943a2.693 2.693 0 0 0-1.825-3.343L38.093.733a2.693 2.693 0 0 0-3.343 1.825l-1.476 5.026-.269.917a4.989 4.989 0 0 0-9.554.066 4.99 4.99 0 0 0 3.381 6.194z"}))}},2527:(e,t,l)=>{l.d(t,{Z:()=>s});var a,n,r=l(7294);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:l,...s}=e;return r.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg","aria-label":"TypeScript",viewBox:"0 0 512 512","aria-labelledby":l},s),t?r.createElement("title",{id:l},t):null,a||(a=r.createElement("rect",{width:512,height:512,rx:"15%",fill:"#3178c6"})),n||(n=r.createElement("path",{fill:"#fff",d:"M233 284h64v-41H118v41h64v183h51zm84 173c8.1 4.2 18 7.3 29 9.4s23 3.1 35 3.1 23-1.1 34-3.4 20-6.1 28-11c8.1-5.3 15-12 19-21s7.1-19 7.1-32c0-9.1-1.4-17-4.1-24s-6.6-13-12-18c-5.1-5.3-11-10-18-14s-15-8.2-24-12c-6.6-2.7-12-5.3-18-7.9-5.2-2.6-9.7-5.2-13-7.8-3.7-2.7-6.5-5.5-8.5-8.4-2-3-3-6.3-3-10 0-3.4.89-6.5 2.7-9.3s4.3-5.1 7.5-7.1 7.2-3.5 12-4.6c4.7-1.1 9.9-1.6 16-1.6 4.2 0 8.6.31 13 .94 4.6.63 9.3 1.6 14 2.9 4.7 1.3 9.3 2.9 14 4.9 4.4 2 8.5 4.3 12 6.9v-47c-7.6-2.9-16-5.1-25-6.5s-19-2.1-31-2.1-23 1.3-34 3.8-20 6.5-28 12c-8.1 5.4-14 12-19 21-4.7 8.4-7 18-7 30 0 15 4.3 28 13 38 8.6 11 22 19 39 27 6.9 2.8 13 5.6 19 8.3s11 5.5 15 8.4c4.3 2.9 7.7 6.1 10 9.5 2.5 3.4 3.8 7.4 3.8 12 0 3.2-.78 6.2-2.3 9s-3.9 5.2-7.1 7.2-7.1 3.6-12 4.8c-4.7 1.1-10 1.7-17 1.7-11 0-22-1.9-32-5.7-11-3.8-21-9.5-28.1-15.44z"})))}},2773:(e,t,l)=>{l.r(t),l.d(t,{default:()=>f});var a=l(7294),n=l(6010),r=l(9960),c=l(2263),s=l(2164),i=l(7462);const o="features_t9lD",m="featureSvg_GfXr",d=[{title:"Batteries included",Svg:l(4660).Z,description:a.createElement(a.Fragment,null,"Start or integrate a new project in minutes.")},{title:"Customizable",Svg:l(5261).Z,description:a.createElement(a.Fragment,null,"Extend or customize with community-based plugins to provide utilities, filters, and more.")},{title:"Modern",Svg:l(2527).Z,description:a.createElement(a.Fragment,null,"Uses modern and powerful tooling such as",a.createElement("a",{href:"https://swc.rs/"}," swc"),",",a.createElement("a",{href:"https://tsup.egoist.dev/"}," tsup"),",",a.createElement("a",{href:"https://www.typescriptlang.org/"}," typescript"),", and",a.createElement("a",{href:"https://rxjs.dev/"}," rxjs")," to future-proof and ensure project quality.")}];function h(e){let{Svg:t,title:l,description:r}=e;return a.createElement("div",{className:(0,n.Z)("col col--4")},a.createElement("div",{className:"text--center"},a.createElement(t,{className:m,role:"img"})),a.createElement("div",{className:"text--center padding-horiz--md"},a.createElement("h3",null,l),a.createElement("p",null,r)))}function u(){return a.createElement("section",{className:o},a.createElement("div",{className:"container"},a.createElement("div",{className:"row"},d.map(((e,t)=>a.createElement(h,(0,i.Z)({key:t},e)))))))}const p=l.p+"assets/images/sern-logo-2f73c45b583c361a057d64bbc67a51f5.png";var v=l(1207);function g(){const{siteConfig:e}=(0,c.Z)();return a.createElement("header",{className:(0,n.Z)("hero hero--primary-darker",v.Z.heroBanner)},a.createElement("div",{className:"container"},a.createElement("div",{className:"container"},a.createElement("div",{className:"row"},a.createElement("div",{className:"col col--6 "},a.createElement("h1",{className:(0,n.Z)("hero__title",v.Z["padding-vert--md"]),style:{fontSize:"450%"}},a.createElement("b",null,e.title.slice(6))),a.createElement("p",{className:"hero__subtitle"},e.tagline),a.createElement(r.Z,{className:"button button--secondary button--lg",to:"docs/guide/walkthrough/cli"},"sern init")),a.createElement("div",{className:"col col--6"},a.createElement("img",{src:p,alt:"logo",height:"auto",width:"auto"}))),a.createElement("div",{className:v.Z.buttons}))))}function f(){const{siteConfig:e}=(0,c.Z)();return a.createElement(s.Z,{title:"sern - Handlers. Redefined.",description:"Description will go into a meta tag in"},a.createElement(g,null),a.createElement("main",{className:"user-select-none"},a.createElement("div",{className:"hero"},a.createElement(u,null))))}},1207:(e,t,l)=>{l.d(t,{Z:()=>a});const a={heroBanner:"heroBanner_qdFl",buttons:"buttons_AeoN","padding-vert--md":"padding-vert--md_IMB4"}}}]); \ No newline at end of file diff --git a/fr/assets/js/runtime~main.5b4df24c.js b/fr/assets/js/runtime~main.4732a3a1.js similarity index 98% rename from fr/assets/js/runtime~main.5b4df24c.js rename to fr/assets/js/runtime~main.4732a3a1.js index 323dac67c..8b860789e 100644 --- a/fr/assets/js/runtime~main.5b4df24c.js +++ b/fr/assets/js/runtime~main.4732a3a1.js @@ -1 +1 @@ -(()=>{"use strict";var e,t,r,a,f,c={},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={id:e,loaded:!1,exports:{}};return c[e].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}n.m=c,n.c=o,e=[],n.O=(t,r,a,f)=>{if(!r){var c=1/0;for(i=0;i=f)&&Object.keys(n.O).every((e=>n.O[e](r[d])))?r.splice(d--,1):(o=!1,f0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[r,a,f]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,n.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var f=Object.create(null);n.r(f);var c={};t=t||[null,r({}),r([]),r(r)];for(var o=2&a&&e;"object"==typeof o&&!~t.indexOf(o);o=r(o))Object.getOwnPropertyNames(o).forEach((t=>c[t]=()=>e[t]));return c.default=()=>e,n.d(f,c),f},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>"assets/js/"+({5:"1ac1bfe9",45:"888566f1",53:"5bc4ccbc",62:"69369ae2",85:"1f391b9e",127:"7e205c4a",137:"1aef51bd",146:"608ca171",195:"c4f5d8e4",197:"935f2afb",226:"707baeff",270:"e4877132",277:"c4348237",306:"f6aebfbf",322:"a5467962",332:"73bd57bd",363:"26f1f3a5",397:"312c2bc5",414:"393be207",429:"eea0bf40",472:"cf183316",514:"1be78505",597:"5e8c322a",640:"a96c96b0",652:"bcd9df7e",671:"0e384e19",703:"981f6151",712:"3dc7c79a",750:"3a2d3092",803:"9201de17",865:"e8e3d8c7",918:"17896441"}[e]||e)+"."+{5:"64b85e25",45:"60608794",53:"51b676b7",62:"1291f58b",85:"d7ab1744",127:"4131c3c4",137:"7add87c1",146:"0fb61f68",195:"57fa0488",197:"5c6d4582",226:"00e5aa3b",270:"b7490350",277:"bbd90c09",306:"06105970",322:"7b61a3f2",332:"cde4e056",363:"7d199635",397:"1f24705a",414:"387b15e8",429:"41d2f7a6",472:"deafb224",503:"668d49f6",514:"f852ff9f",597:"167ec8db",640:"a1b88b8a",652:"d5194af7",671:"63bfcf07",703:"f0f70d80",712:"65162d25",750:"174d0934",803:"13481d25",865:"67ad44d3",918:"15289f85",972:"61be9a41"}[e]+".js",n.miniCssF=e=>{},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},f="@sern/website:",n.l=(e,t,r,c)=>{if(a[e])a[e].push(t);else{var o,d;if(void 0!==r)for(var b=document.getElementsByTagName("script"),i=0;i{o.onerror=o.onload=null,clearTimeout(s);var f=a[e];if(delete a[e],o.parentNode&&o.parentNode.removeChild(o),f&&f.forEach((e=>e(r))),t)return t(r)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),d&&document.head.appendChild(o)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/fr/",n.gca=function(e){return e={17896441:"918","1ac1bfe9":"5","888566f1":"45","5bc4ccbc":"53","69369ae2":"62","1f391b9e":"85","7e205c4a":"127","1aef51bd":"137","608ca171":"146",c4f5d8e4:"195","935f2afb":"197","707baeff":"226",e4877132:"270",c4348237:"277",f6aebfbf:"306",a5467962:"322","73bd57bd":"332","26f1f3a5":"363","312c2bc5":"397","393be207":"414",eea0bf40:"429",cf183316:"472","1be78505":"514","5e8c322a":"597",a96c96b0:"640",bcd9df7e:"652","0e384e19":"671","981f6151":"703","3dc7c79a":"712","3a2d3092":"750","9201de17":"803",e8e3d8c7:"865"}[e]||e,n.p+n.u(e)},(()=>{var e={303:0,532:0};n.f.j=(t,r)=>{var a=n.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else if(/^(303|532)$/.test(t))e[t]=0;else{var f=new Promise(((r,f)=>a=e[t]=[r,f]));r.push(a[2]=f);var c=n.p+n.u(t),o=new Error;n.l(c,(r=>{if(n.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var f=r&&("load"===r.type?"missing":r.type),c=r&&r.target&&r.target.src;o.message="Loading chunk "+t+" failed.\n("+f+": "+c+")",o.name="ChunkLoadError",o.type=f,o.request=c,a[1](o)}}),"chunk-"+t,t)}},n.O.j=t=>0===e[t];var t=(t,r)=>{var a,f,c=r[0],o=r[1],d=r[2],b=0;if(c.some((t=>0!==e[t]))){for(a in o)n.o(o,a)&&(n.m[a]=o[a]);if(d)var i=d(n)}for(t&&t(r);b{"use strict";var e,t,r,a,f,c={},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={id:e,loaded:!1,exports:{}};return c[e].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}n.m=c,n.c=o,e=[],n.O=(t,r,a,f)=>{if(!r){var c=1/0;for(i=0;i=f)&&Object.keys(n.O).every((e=>n.O[e](r[d])))?r.splice(d--,1):(o=!1,f0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[r,a,f]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,n.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var f=Object.create(null);n.r(f);var c={};t=t||[null,r({}),r([]),r(r)];for(var o=2&a&&e;"object"==typeof o&&!~t.indexOf(o);o=r(o))Object.getOwnPropertyNames(o).forEach((t=>c[t]=()=>e[t]));return c.default=()=>e,n.d(f,c),f},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>"assets/js/"+({5:"1ac1bfe9",45:"888566f1",53:"5bc4ccbc",62:"69369ae2",85:"1f391b9e",127:"7e205c4a",137:"1aef51bd",146:"608ca171",195:"c4f5d8e4",197:"935f2afb",226:"707baeff",270:"e4877132",277:"c4348237",306:"f6aebfbf",322:"a5467962",332:"73bd57bd",363:"26f1f3a5",397:"312c2bc5",414:"393be207",429:"eea0bf40",472:"cf183316",514:"1be78505",597:"5e8c322a",640:"a96c96b0",652:"bcd9df7e",671:"0e384e19",703:"981f6151",712:"3dc7c79a",750:"3a2d3092",803:"9201de17",865:"e8e3d8c7",918:"17896441"}[e]||e)+"."+{5:"64b85e25",45:"60608794",53:"51b676b7",62:"1291f58b",85:"d7ab1744",127:"4131c3c4",137:"7add87c1",146:"0fb61f68",195:"be1a5759",197:"5c6d4582",226:"00e5aa3b",270:"b7490350",277:"bbd90c09",306:"06105970",322:"7b61a3f2",332:"cde4e056",363:"7d199635",397:"1f24705a",414:"387b15e8",429:"41d2f7a6",472:"deafb224",503:"668d49f6",514:"f852ff9f",597:"167ec8db",640:"a1b88b8a",652:"d5194af7",671:"63bfcf07",703:"f0f70d80",712:"65162d25",750:"174d0934",803:"13481d25",865:"67ad44d3",918:"15289f85",972:"61be9a41"}[e]+".js",n.miniCssF=e=>{},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},f="@sern/website:",n.l=(e,t,r,c)=>{if(a[e])a[e].push(t);else{var o,d;if(void 0!==r)for(var b=document.getElementsByTagName("script"),i=0;i{o.onerror=o.onload=null,clearTimeout(s);var f=a[e];if(delete a[e],o.parentNode&&o.parentNode.removeChild(o),f&&f.forEach((e=>e(r))),t)return t(r)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),d&&document.head.appendChild(o)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/fr/",n.gca=function(e){return e={17896441:"918","1ac1bfe9":"5","888566f1":"45","5bc4ccbc":"53","69369ae2":"62","1f391b9e":"85","7e205c4a":"127","1aef51bd":"137","608ca171":"146",c4f5d8e4:"195","935f2afb":"197","707baeff":"226",e4877132:"270",c4348237:"277",f6aebfbf:"306",a5467962:"322","73bd57bd":"332","26f1f3a5":"363","312c2bc5":"397","393be207":"414",eea0bf40:"429",cf183316:"472","1be78505":"514","5e8c322a":"597",a96c96b0:"640",bcd9df7e:"652","0e384e19":"671","981f6151":"703","3dc7c79a":"712","3a2d3092":"750","9201de17":"803",e8e3d8c7:"865"}[e]||e,n.p+n.u(e)},(()=>{var e={303:0,532:0};n.f.j=(t,r)=>{var a=n.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else if(/^(303|532)$/.test(t))e[t]=0;else{var f=new Promise(((r,f)=>a=e[t]=[r,f]));r.push(a[2]=f);var c=n.p+n.u(t),o=new Error;n.l(c,(r=>{if(n.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var f=r&&("load"===r.type?"missing":r.type),c=r&&r.target&&r.target.src;o.message="Loading chunk "+t+" failed.\n("+f+": "+c+")",o.name="ChunkLoadError",o.type=f,o.request=c,a[1](o)}}),"chunk-"+t,t)}},n.O.j=t=>0===e[t];var t=(t,r)=>{var a,f,c=r[0],o=r[1],d=r[2],b=0;if(c.some((t=>0!==e[t]))){for(a in o)n.o(o,a)&&(n.m[a]=o[a]);if(d)var i=d(n)}for(t&&t(r);b @sern/handler | sern - Handlers. Redefined. - +

SernHandler

NPM versionNPM downloadsMIT License

A customizable, batteries-included, powerful discord.js framework to automate and streamline your bot development.

Installation

npm install @sern/handler
yarn add @sern/handler
pnpm add @sern/handler

Basic Usage

index.js (CommonJS)

const { Client, GatewayIntentBits } = require('discord.js');
const { Sern } = require('@sern/handler');
const { defaultPrefix, token } = require('./config.json');

const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages
]
});

Sern.init({
client,
defaultPrefix,
commands : 'src/commands',
});

client.login(token);

ping.js (CommonJS)

const { Sern, CommandType, commandModule } = require('@sern/handler');

exports.default = commandModule({
description: 'A ping pong command',
type: CommandType.Slash,
execute(ctx) {
ctx.reply('pong!');
}
});

See our templates for TypeScript examples and more

CLI

It is highly encouraged to use the command line interface for your project. Don't forget to view it.

Contribute

  • Read our contribution guidelines carefully
  • Pull up on issues and report bugs
  • All kinds of contributions are welcomed.

Roadmap

You can check our roadmap to see what's going to be added or patched in the future.

- + \ No newline at end of file diff --git a/fr/docs/api/classes/Context.html b/fr/docs/api/classes/Context.html index 331b73ec6..a2984b733 100644 --- a/fr/docs/api/classes/Context.html +++ b/fr/docs/api/classes/Context.html @@ -5,7 +5,7 @@ Class: Context | sern - Handlers. Redefined. - + @@ -16,7 +16,7 @@ CommandType.Text or the event fired in a Both command was Message

Returns

ChatInputCommandInteraction<CacheType>

Defined in

src/handler/structures/context.ts:52


member

get member(): Nullish<GuildMember | APIGuildMember>

Returns

Nullish<GuildMember | APIGuildMember>

Defined in

src/handler/structures/context.ts:101


message

get message(): Message<boolean>

Getting the Message object. Crashes if module type is CommandType.Slash or the event fired in a Both command was ChatInputCommandInteraction

Returns

Message<boolean>

Defined in

src/handler/structures/context.ts:44


user

get user(): User

Returns

User

Defined in

src/handler/structures/context.ts:70

Methods

isEmpty

isEmpty(): boolean

Returns

boolean

Defined in

src/handler/structures/context.ts:129


reply

reply(content): Promise<Message<boolean>>

Parameters

NameType
contentstring | Omit<InteractionReplyOptions, "fetchReply"> | ReplyMessageOptions

Returns

Promise<Message<boolean>>

Defined in

src/handler/structures/context.ts:133


wrap

Static wrap(wrappable): Context

Parameters

NameType
wrappableMessage<boolean> | ChatInputCommandInteraction<CacheType>

Returns

Context

Defined in

src/handler/structures/context.ts:122

- + \ No newline at end of file diff --git a/fr/docs/api/classes/SernEmitter.html b/fr/docs/api/classes/SernEmitter.html index 0410b4bb0..f3ee35758 100644 --- a/fr/docs/api/classes/SernEmitter.html +++ b/fr/docs/api/classes/SernEmitter.html @@ -5,7 +5,7 @@ Class: SernEmitter | sern - Handlers. Redefined. - + @@ -49,7 +49,7 @@ given event.

This method is intentionally generic and works with the web p semantics and does not listen to the 'error' event.

const { once, EventEmitter } = require('events');

async function run() {
const ee = new EventEmitter();

process.nextTick(() => {
ee.emit('myevent', 42);
});

const [value] = await once(ee, 'myevent');
console.log(value);

const err = new Error('kaboom');
process.nextTick(() => {
ee.emit('error', err);
});

try {
await once(ee, 'myevent');
} catch (err) {
console.log('error happened', err);
}
}

run();

The special handling of the 'error' event is only used when events.once()is used to wait for another event. If events.once() is used to wait for the 'error' event itself, then it is treated as any other kind of event without special handling:

const { EventEmitter, once } = require('events');

const ee = new EventEmitter();

once(ee, 'error')
.then(([err]) => console.log('ok', err.message))
.catch((err) => console.log('error', err.message));

ee.emit('error', new Error('boom'));

// Prints: ok boom

An AbortSignal can be used to cancel waiting for the event:

const { EventEmitter, once } = require('events');

const ee = new EventEmitter();
const ac = new AbortController();

async function foo(emitter, event, signal) {
try {
await once(emitter, event, { signal });
console.log('event emitted!');
} catch (error) {
if (error.name === 'AbortError') {
console.error('Waiting for the event was canceled!');
} else {
console.error('There was an error', error.message);
}
}
}

foo(ee, 'foo', ac.signal);
ac.abort(); // Abort waiting for the event
ee.emit('foo'); // Prints: Waiting for the event was canceled!

Since

v11.13.0, v10.16.0

Parameters

NameType
emitterNodeEventTarget
eventNamestring | symbol
options?StaticEventEmitterOptions

Returns

Promise<any[]>

Inherited from

EventEmitter.once

Defined in

node_modules/@types/node/events.d.ts:157

Static once(emitter, eventName, options?): Promise<any[]>

Parameters

NameType
emitterDOMEventTarget
eventNamestring
options?StaticEventEmitterOptions

Returns

Promise<any[]>

Inherited from

EventEmitter.once

Defined in

node_modules/@types/node/events.d.ts:158

Static once<K>(eventEmitter, eventName): Promise<ClientEvents[K]>

Type parameters

NameType
Kextends keyof ClientEvents

Parameters

NameType
eventEmitterClient<boolean>
eventNameK

Returns

Promise<ClientEvents[K]>

Inherited from

EventEmitter.once

Defined in

node_modules/discord.js/typings/index.d.ts:194


setMaxListeners

Static setMaxListeners(n?, ...eventTargets): void

const {
setMaxListeners,
EventEmitter
} = require('events');

const target = new EventTarget();
const emitter = new EventEmitter();

setMaxListeners(5, target, emitter);

Since

v15.4.0

Parameters

NameTypeDescription
n?numberA non-negative number. The maximum number of listeners per EventTarget event.
...eventTargets(EventEmitter | DOMEventTarget)[]-

Returns

void

Inherited from

EventEmitter.setMaxListeners

Defined in

node_modules/@types/node/events.d.ts:280

- + \ No newline at end of file diff --git a/fr/docs/api/enums/CommandType.html b/fr/docs/api/enums/CommandType.html index 5c1f56e87..250cce9f9 100644 --- a/fr/docs/api/enums/CommandType.html +++ b/fr/docs/api/enums/CommandType.html @@ -5,13 +5,13 @@ Enumeration: CommandType | sern - Handlers. Redefined. - +

Enumeration: CommandType

Example

export default commandModule({
type : CommandType.Text,
name : 'a text command'
execute(message) {
console.log(message.content)
}
})

Enumeration Members

Both

Both = 3

The CommandType for hybrid commands, text and slash

Defined in

src/handler/structures/enums.ts:27


Button

Button = 16

The CommandType for ButtonInteraction commands

Defined in

src/handler/structures/enums.ts:39


MenuMsg = 8

The CommandType for MessageContextMenuInteraction commands

Defined in

src/handler/structures/enums.ts:35


MenuSelect = 32

The CommandType for SelectMenuInteraction commands

Defined in

src/handler/structures/enums.ts:43


MenuUser = 4

The CommandType for UserContextMenuInteraction commands

Defined in

src/handler/structures/enums.ts:31


Modal = 64

The CommandType for ModalSubmitInteraction commands

Defined in

src/handler/structures/enums.ts:47


Slash

Slash = 2

The CommandType for slash commands

Defined in

src/handler/structures/enums.ts:23


Text

Text = 1

The CommandType for text commands

Defined in

src/handler/structures/enums.ts:19

- + \ No newline at end of file diff --git a/fr/docs/api/enums/EventType.html b/fr/docs/api/enums/EventType.html index d2cfbd38a..408fb2a05 100644 --- a/fr/docs/api/enums/EventType.html +++ b/fr/docs/api/enums/EventType.html @@ -5,14 +5,14 @@ Enumeration: EventType | sern - Handlers. Redefined. - +

Enumeration: EventType

Example

export default eventModule({
type : EventType.Discord,
name : 'guildMemberAdd'
execute(member : GuildMember) {
console.log(member)
}
})

Enumeration Members

Discord

Discord = 1

The EventType for handling discord events

Defined in

src/handler/structures/enums.ts:68


External

External = 3

The EventType for handling external events. Could be for example, process events, database events

Defined in

src/handler/structures/enums.ts:77


Sern

Sern = 2

The EventType for handling sern events

Defined in

src/handler/structures/enums.ts:72

- + \ No newline at end of file diff --git a/fr/docs/api/enums/PayloadType.html b/fr/docs/api/enums/PayloadType.html index 1af93660f..018e1cdf8 100644 --- a/fr/docs/api/enums/PayloadType.html +++ b/fr/docs/api/enums/PayloadType.html @@ -5,13 +5,13 @@ Enumeration: PayloadType | sern - Handlers. Redefined. - +
- + \ No newline at end of file diff --git a/fr/docs/api/enums/PluginType.html b/fr/docs/api/enums/PluginType.html index 1368ad5f7..b021ca213 100644 --- a/fr/docs/api/enums/PluginType.html +++ b/fr/docs/api/enums/PluginType.html @@ -5,13 +5,13 @@ Enumeration: PluginType | sern - Handlers. Redefined. - +

Enumeration: PluginType

Example

export default function myPlugin() : EventPlugin<CommandType.Text> {
type : PluginType.Event,
execute([ctx, args], controller) {
return controller.next();
}
}

Enumeration Members

Command

Command = 1

The PluginType for CommandPlugins

Defined in

src/handler/structures/enums.ts:97


Event

Event = 2

The PluginType for EventPlugins

Defined in

src/handler/structures/enums.ts:101

- + \ No newline at end of file diff --git a/fr/docs/api/interfaces/Controller.html b/fr/docs/api/interfaces/Controller.html index 2ef5d4ade..a45b8cbb6 100644 --- a/fr/docs/api/interfaces/Controller.html +++ b/fr/docs/api/interfaces/Controller.html @@ -5,13 +5,13 @@ Interface: Controller | sern - Handlers. Redefined. - +
- + \ No newline at end of file diff --git a/fr/docs/api/interfaces/Wrapper.html b/fr/docs/api/interfaces/Wrapper.html index 971b151b4..87b377069 100644 --- a/fr/docs/api/interfaces/Wrapper.html +++ b/fr/docs/api/interfaces/Wrapper.html @@ -5,13 +5,13 @@ Interface: Wrapper | sern - Handlers. Redefined. - +

Interface: Wrapper

An object to be passed into Sern#init() function.

Properties

client

Readonly client: Client<boolean>

Defined in

src/handler/structures/wrapper.ts:10


commands

Readonly commands: string

Defined in

src/handler/structures/wrapper.ts:13


defaultPrefix

Optional Readonly defaultPrefix: string

Defined in

src/handler/structures/wrapper.ts:12


events

Optional Readonly events: string | { absPath: string ; mod: EventModule }[] | () => { absPath: string ; mod: EventModule }[]

Defined in

src/handler/structures/wrapper.ts:14


sernEmitter

Optional Readonly sernEmitter: SernEmitter

Defined in

src/handler/structures/wrapper.ts:11

- + \ No newline at end of file diff --git a/fr/docs/api/modules.html b/fr/docs/api/modules.html index 91daafc02..fcffa4f18 100644 --- a/fr/docs/api/modules.html +++ b/fr/docs/api/modules.html @@ -5,7 +5,7 @@ @sern/handler | sern - Handlers. Redefined. - + @@ -13,7 +13,7 @@

@sern/handler

Namespaces

Enumerations

Classes

Interfaces

Type Aliases

Args

Ƭ Args: ParseType<{ slash: SlashOptions ; text: string[] }>

Defined in

src/types/handler.ts:11


AutocompletePlugin

Ƭ AutocompletePlugin: Override<BaseModule, { execute: (autocmp: AutocompleteInteraction, controlller: Controller) => Awaitable<Result<void, void>> ; type: Event }>

Defined in

src/handler/plugins/plugin.ts:92


BaseOptions

Ƭ BaseOptions: ApplicationCommandChoicesData | ApplicationCommandNonOptionsData | ApplicationCommandChannelOptionData | ApplicationCommandNumericOptionData | ApplicationCommandAttachmentOption | SernAutocompleteData

Type that replaces autocomplete with SernAutocompleteData

Defined in

src/handler/structures/module.ts:181


BothCommand

Ƭ BothCommand: Override<BaseModule, { alias?: string[] ; execute: (ctx: Context, args: Args) => Awaitable<void | unknown> ; onEvent: EventPlugin<Both>[] ; options?: SernOptionsData[] ; plugins: CommandPlugin[] ; type: Both }>

Defined in

src/handler/structures/module.ts:55


CommandModuleNoPlugins

Ƭ CommandModuleNoPlugins: { [T in CommandType]: Omit<CommandModuleDefs[T], "plugins" | "onEvent"> }

Defined in

src/handler/plugins/plugin.ts:145


CommandModulePlugin

Ƭ CommandModulePlugin<T>: EventPlugin<T> | CommandPlugin<T>

Type parameters

NameType
Textends CommandType

Defined in

src/handler/plugins/plugin.ts:173


CommandPlugin

Ƭ CommandPlugin<T>: { [K in T]: Override<BasePlugin, Object> }[T]

Type parameters

NameType
Textends keyof CommandModuleDefs = keyof CommandModuleDefs

Defined in

src/handler/plugins/plugin.ts:40


DefinedCommandModule

Ƭ DefinedCommandModule: DefinitelyDefined<CommandModule, "name" | "description">

Defined in

src/types/handler.ts:48


DefinedEventModule

Ƭ DefinedEventModule: DefinitelyDefined<EventModule, "name" | "description">

Defined in

src/types/handler.ts:49


DefinedModule

Ƭ DefinedModule: DefinitelyDefined<Module, "name" | "description">

After modules are transformed, name and description are given default values if none are provided to Module. This type represents that transformation

Defined in

src/types/handler.ts:47


DefinitelyDefined

Ƭ DefinitelyDefined<T, K>: { [L in K]-?: T[L] extends Record<string, unknown> ? DefinitelyDefined<T[L], keyof T[L]> : Required<T>[L] } & T

Type parameters

NameType
TT
Kextends keyof T = keyof T

Defined in

src/types/handler.ts:18


DiscordEmitterPlugin

Ƭ DiscordEmitterPlugin: Override<BasePlugin, { execute: (wrapper: Client, module: DefinitelyDefined<DiscordEventCommand, "name" | "description">, controller: Controller) => Awaitable<Result<void, void>> ; type: Command }>

Defined in

src/handler/plugins/plugin.ts:57


DiscordEventPlugin

Ƭ DiscordEventPlugin<T>: Override<BasePlugin, { execute: (args: ClientEvents[T], controller: Controller) => Awaitable<Result<void, void>> ; name?: T ; type: Event }>

Type parameters

NameType
Textends keyof ClientEvents = keyof ClientEvents

Defined in

src/handler/plugins/plugin.ts:136


EventInput

Ƭ EventInput: string | { absPath: string ; mod: EventModule }[] | () => { absPath: string ; mod: EventModule }[]

Defined in

src/types/handler.ts:24


EventModuleCommandPluginDefs

Ƭ EventModuleCommandPluginDefs: Object

Event Module Command Plugins

Type declaration

NameType
1DiscordEmitterPlugin
2SernEmitterPlugin
3ExternalEmitterPlugin

Defined in

src/handler/plugins/plugin.ts:163


EventModuleEventPluginDefs

Ƭ EventModuleEventPluginDefs: Object

Event Module Event Plugins

Type declaration

NameType
1DiscordEventPlugin
2SernEventPlugin
3ExternalEventPlugin

Defined in

src/handler/plugins/plugin.ts:154


EventModulePlugin

Ƭ EventModulePlugin<T>: EventModuleEventPluginDefs[T] | EventModuleCommandPluginDefs[T]

Type parameters

NameType
Textends EventType

Defined in

src/handler/plugins/plugin.ts:169


EventModulesNoPlugins

Ƭ EventModulesNoPlugins: { [T in EventType]: Omit<EventModuleDefs[T], "plugins" | "onEvent"> }

Defined in

src/handler/plugins/plugin.ts:148


EventPlugin

Ƭ EventPlugin<T>: { [K in T]: Override<BasePlugin, Object> }[T]

Type parameters

NameType
Textends keyof CommandModuleDefs = keyof CommandModuleDefs

Defined in

src/handler/plugins/plugin.ts:103


ExternalEmitterPlugin

Ƭ ExternalEmitterPlugin<T>: Override<BasePlugin, { execute: (wrapper: T, module: DefinitelyDefined<ExternalEventCommand, "name" | "description">, controller: Controller) => Awaitable<Result<void, void>> ; type: Command }>

Type parameters

NameType
Textends EventEmitter = EventEmitter

Defined in

src/handler/plugins/plugin.ts:68


ExternalEventPlugin

Ƭ ExternalEventPlugin: Override<BasePlugin, { execute: (args: unknown[], controller: Controller) => Awaitable<Result<void, void>> ; type: Event }>

Defined in

src/handler/plugins/plugin.ts:128


InputCommandModule

Ƭ InputCommandModule: { [T in CommandType]: CommandModuleNoPlugins[T] & Object }[CommandType]

User inputs this type. Sern processes behind the scenes for better usage

Defined in

src/handler/plugins/plugin.ts:178


InputEventModule

Ƭ InputEventModule: { [T in EventType]: EventModulesNoPlugins[T] & Object }[EventType]

Defined in

src/handler/plugins/plugin.ts:182


IsOptional

Ƭ IsOptional<T>: { [K in keyof T]-?: T[K] extends Required<T>[K] ? false : true }

Type parameters

Name
T

Defined in

src/types/handler.ts:31


Module

Ƭ Module: CommandModule | EventModule

Defined in

src/handler/structures/module.ts:141


Nullish

Ƭ Nullish<T>: T | undefined | null

Type parameters

Name
T

Defined in

src/types/handler.ts:4


Override

Ƭ Override<T1, T2>: Omit<T1, keyof T2> & T2

Type parameters

Name
T1
T2

Defined in

src/types/handler.ts:16


ParseType

Ƭ ParseType<T>: { [K in keyof T]: T[K] extends unknown ? [k: K, args: T[K]] : never }[keyof T]

Type parameters

Name
T

Defined in

src/types/handler.ts:7


Payload

Ƭ Payload: { module: Module ; type: Success } | { module: Module | undefined ; reason: string | Error ; type: Failure }

Defined in

src/types/handler.ts:50


Reconstruct

Ƭ Reconstruct<T>: T extends Omit<infer O, never> ? O & Reconstruct<O> : T

Type parameters

Name
T

Defined in

src/types/handler.ts:29


SernAutocompleteData

Ƭ SernAutocompleteData: Override<BaseApplicationCommandOptionsData, { autocomplete: true ; command: AutocompleteCommand ; type: ApplicationCommandOptionType.String | ApplicationCommandOptionType.Number | ApplicationCommandOptionType.Integer }>

Defined in

src/handler/structures/module.ts:166


SernEmitterPlugin

Ƭ SernEmitterPlugin: Override<BasePlugin, { execute: (wrapper: SernEmitter, module: DefinitelyDefined<SernEventCommand, "name" | "description">, controller: Controller) => Awaitable<Result<void, void>> ; type: Command }>

Defined in

src/handler/plugins/plugin.ts:80


SernEventPlugin

Ƭ SernEventPlugin<T>: Override<BasePlugin, { execute: (args: SernEventsMapping[T], controller: Controller) => Awaitable<Result<void, void>> ; name?: T ; type: Event }>

Type parameters

NameType
Textends keyof SernEventsMapping = keyof SernEventsMapping

Defined in

src/handler/plugins/plugin.ts:116


SernEventsMapping

Ƭ SernEventsMapping: Object

Type declaration

NameType
error[Error | string]
module.activate[Payload]
module.register[Payload]
warning[string]

Defined in

src/types/handler.ts:53


SernOptionsData

Ƭ SernOptionsData<U>: U extends ApplicationCommandSubCommandData ? SernSubCommandData : U extends ApplicationCommandSubGroupData ? SernSubCommandGroupData : BaseOptions

Type parameters

NameType
Uextends ApplicationCommandOptionData = ApplicationCommandOptionData

Defined in

src/handler/structures/module.ts:205


SernSubCommandData

Ƭ SernSubCommandData: Override<Omit<BaseApplicationCommandOptionsData, "required">, { options?: BaseOptions[] ; type: ApplicationCommandOptionType.Subcommand }>

Defined in

src/handler/structures/module.ts:189


SernSubCommandGroupData

Ƭ SernSubCommandGroupData: Override<Omit<BaseApplicationCommandOptionsData, "required">, { options?: SernSubCommandData[] ; type: ApplicationCommandOptionType.SubcommandGroup }>

Defined in

src/handler/structures/module.ts:197


SlashCommand

Ƭ SlashCommand: Override<BaseModule, { execute: (ctx: Context, args: ["slash", SlashOptions]) => Awaitable<void | unknown> ; onEvent: EventPlugin<Slash>[] ; options?: SernOptionsData[] ; plugins: CommandPlugin[] ; type: Slash }>

Defined in

src/handler/structures/module.ts:44


SlashOptions

Ƭ SlashOptions: Omit<CommandInteractionOptionResolver, "getMessage" | "getFocused">

Defined in

src/types/handler.ts:13


SpreadParams

Ƭ SpreadParams<T>: (args: Parameters<T>[number]) => unknown

Type parameters

NameType
Textends (...args: never) => unknown

Type declaration

▸ (args): unknown

Turns a function with a union of array of args into a single union [ T , V , B ] | [ A ] => T | V | B | A

Parameters
NameType
argsParameters<T>[number]
Returns

unknown

Defined in

src/types/handler.ts:39


TextCommand

Ƭ TextCommand: Override<BaseModule, { alias?: string[] ; execute: (ctx: Context, args: ["text", string[]]) => Awaitable<void | unknown> ; onEvent: EventPlugin<Text>[] ; plugins: CommandPlugin[] ; type: Text }>

Defined in

src/handler/structures/module.ts:33

Functions

commandModule

commandModule(mod): CommandModule

The wrapper function to define command modules for sern

Parameters

NameType
modInputCommandModule

Returns

CommandModule

Defined in

src/handler/sern.ts:86


eventModule

eventModule(mod): EventModule

The wrapper function to define event modules for sern

Parameters

NameType
modInputEventModule

Returns

EventModule

Defined in

src/handler/sern.ts:107

- + \ No newline at end of file diff --git a/fr/docs/api/namespaces/Sern.html b/fr/docs/api/namespaces/Sern.html index 783722921..fab36d531 100644 --- a/fr/docs/api/namespaces/Sern.html +++ b/fr/docs/api/namespaces/Sern.html @@ -5,13 +5,13 @@ Namespace: Sern | sern - Handlers. Redefined. - +

Namespace: Sern

References

commandModule

Re-exports commandModule


eventModule

Re-exports eventModule

Variables

controller

Const controller: Object

The object passed into every plugin to control a command's behavior

Type declaration

NameType
next() => OkImpl<void>
stop() => ErrImpl<void>

Defined in

src/handler/sern.ts:77

Functions

addExternal

addExternal<T>(emitter): void

Example

src/index.ts
//Add this before initiating Sern!
Sern.addExternal(new Level())

Example

events/level.ts
 export default eventModule({
emitter: 'Level',
type : EventType.External,
name: 'error',
execute(args) {
console.log(args)
}
})

Type parameters

NameType
Textends __module

Parameters

NameTypeDescription
emitterTAny external event emitter. The object will be stored in a map, and then fetched by the name of the instance's class. As there are infinite possibilities to adding external event emitters, Most types aren't provided and are as narrow as possibly can.

Returns

void

Defined in

src/handler/sern.ts:67


init

init(wrapper): void

Example

src/index.ts
Sern.init({
client,
defaultPrefix: '!',
commands: 'dist/commands',
})

Parameters

NameTypeDescription
wrapperWrapperOptions to pass into sern. Function to start the handler up

Returns

void

Defined in

src/handler/sern.ts:34

- + \ No newline at end of file diff --git a/fr/docs/guide.html b/fr/docs/guide.html index 92dce99d4..ee677b0c4 100644 --- a/fr/docs/guide.html +++ b/fr/docs/guide.html @@ -5,13 +5,13 @@ Introduction | sern - Handlers. Redefined. - +

Introduction

Welcome to our official guide. This guide will go through all the core features of the framework.

  • 💖 Thank you for choosing sern to be your framework!

  • Teaching the discord.js library and / or Javascript / Typescript is out of scope of this project, so the documentation assumes you already know these elements.

  • discord.js v14 is the only supported library at the moment

You will learn

Working with plugins

Events

Good to know

- + \ No newline at end of file diff --git a/fr/docs/guide/getting-started/choose-ide.html b/fr/docs/guide/getting-started/choose-ide.html index f9afcc1b0..4add11d36 100644 --- a/fr/docs/guide/getting-started/choose-ide.html +++ b/fr/docs/guide/getting-started/choose-ide.html @@ -5,14 +5,14 @@ Choosing an IDE | sern - Handlers. Redefined. - +
- + \ No newline at end of file diff --git a/fr/docs/guide/getting-started/preparing.html b/fr/docs/guide/getting-started/preparing.html index 376ded7ba..292e37a60 100644 --- a/fr/docs/guide/getting-started/preparing.html +++ b/fr/docs/guide/getting-started/preparing.html @@ -5,13 +5,13 @@ Preparing to Code | sern - Handlers. Redefined. - +

Preparing to Code

After installing and IDE you need to install node.

You can download the LTS version of node right here

- + \ No newline at end of file diff --git a/fr/docs/guide/walkthrough/cli.html b/fr/docs/guide/walkthrough/cli.html index 43a390b84..b4bd34019 100644 --- a/fr/docs/guide/walkthrough/cli.html +++ b/fr/docs/guide/walkthrough/cli.html @@ -5,7 +5,7 @@ CLI | sern - Handlers. Redefined. - + @@ -13,7 +13,7 @@

CLI

Setting up the CLI is easy.

  • To start a brand-new project, run :
sern init (-y)
astuce

It creates a directory for you so you don't need to!

Include the -y flag if you want to set up defaults. The default langauge is Typescript

sern plugins
info

Make sure to have a correct sern.config.json

This will display a menu selection of all installable plugins.
Note: You must have a sern.config.json to use this command. If you want to view plugins, visit the repository linked above.

  • To install extra utilities into your project
sern extra
- + \ No newline at end of file diff --git a/fr/docs/guide/walkthrough/conclusion.html b/fr/docs/guide/walkthrough/conclusion.html index 80a391c8e..0d9ce8821 100644 --- a/fr/docs/guide/walkthrough/conclusion.html +++ b/fr/docs/guide/walkthrough/conclusion.html @@ -5,7 +5,7 @@ Conclusion | sern - Handlers. Redefined. - + @@ -13,7 +13,7 @@

Conclusion

If you reached this far, thank you for reading! We hope you have learned the necessities you need to create a bot with the sern framework. If you have any other questions, bugs, feature requests, concerns, please join our community server, and we'll be glad to answer your questions.

- + \ No newline at end of file diff --git a/fr/docs/guide/walkthrough/first-command.html b/fr/docs/guide/walkthrough/first-command.html index c0571671d..b9de926fe 100644 --- a/fr/docs/guide/walkthrough/first-command.html +++ b/fr/docs/guide/walkthrough/first-command.html @@ -5,7 +5,7 @@ First Command | sern - Handlers. Redefined. - + @@ -14,7 +14,7 @@ If you installed a new project via the cli, This is the ping command located in src/commands folder.

Typescript

import { commandModule, CommandType } from '@sern/handler';

export default commandModule({
type: CommandType.Both,
plugins: [],
description: 'A ping command',
//alias : [],
execute: async (ctx, args) => {
await ctx.reply({ content: 'Pong 🏓' });
},
});

Javascript

const { CommandType, commandModule } = require('@sern/handler');

exports.default = commandModule({
type: CommandType.Both,
plugins: [],
description: 'A ping command',
//alias : [],
execute: async (ctx, args) => {
await ctx.reply('Pong 🏓');
},
})

To view what each of these properties mean in depth, visit the official documentation.

Types of command modules

Every command module type is part of an enum. This field allows type inference for the rest of a module's fields.
All the command types can be found in the official documentation!

So, lets say you want to make a command module that listens to modals.

Note: Keep in mind you'll need to send a modal with a custom id dm-me. This example below is the response to a modal being sent.


Typescript:

import { commandModule, CommandType } from '@sern/handler';
export default commandModule({
name: 'dm-me',
type: CommandType.Modal,
async execute (modal) {
const value = modal.fields.getTextInputValue('message');
modal.client.users.fetch('182326315813306368').then( u =>
u.send(value + ` from ${modal.user}`)
);
modal.reply( { ephemeral:true, content: 'Sent' })
}
});

Javascript:

const { CommandType, commandModule } = require('@sern/handler');
exports.default = commandModule({
name: 'dm-me',
type: CommandType.Modal,
async execute (modal) {
const value = modal.fields.getTextInputValue('message');
modal.client.users.fetch('182326315813306368').then( u =>
u.send(value + ` from ${modal.user}`)
);
modal.reply( { ephemeral:true, content: 'Sent' })
}
});

Commands are straight forward. Keep in mind, every other property on the commandModule object is optional except the type and execute function.

Context class

The provided Context class helps with modules of CommandType.Both (A mixture of slash / legacy commands).

The Context class is passed into modules with type :

  • CommandType.Both
  • CommandType.Slash
  • CommandType.Text

This data structure helps interop between legacy commands and slash commands with ease.

remarque

View the docs

Typescript:

export default commandModule({
name: 'ping',
type: CommandType.Both,
async execute(ctx: Context) {
await ctx.reply(`pong ${ctx.user}`)
// .reply is shared between both message and interaction!
// So is an User object!
}
});

Javascript:

exports.default = commandModule({
name: 'ping',
type: CommandType.Both,
async execute(ctx) { //ctx is a Context instance
await ctx.reply(`pong ${ctx.user}`)
// .reply is shared between both message and interaction!
// So is an User object!
}
});
- + \ No newline at end of file diff --git a/fr/docs/guide/walkthrough/first-event.html b/fr/docs/guide/walkthrough/first-event.html index bb67e83b4..0bb8d8606 100644 --- a/fr/docs/guide/walkthrough/first-event.html +++ b/fr/docs/guide/walkthrough/first-event.html @@ -5,7 +5,7 @@ First Event Module | sern - Handlers. Redefined. - + @@ -13,7 +13,7 @@

First Event Module

We will dissect a basic event module.
Typescript:

export default eventModule({
type: EventType.Sern,
plugins : [], //NOT SUPPORTED YET!!
name: 'module.activate', //name of event.
execute(event) {
console.log(event);
}
})

Javascript:

exports.default = eventModule({
type: EventType.Sern,
plugins : [], //NOT SUPPORTED YET!!
name: 'module.activate',
execute(event) {
console.log(event);
}
})

Like command modules, the type property denotes what kind of event it is, which can be found here.

To view what each of these properties mean in depth, visit the official documentation.


Event modules are laid out similarly to command modules. These listen to any and all event you provide. In the current version 1.1.0-beta, plugins are not supported.

Another example of an event module

Typescript:

export default eventModule({
type: EventType.Discord,
plugins : [], //NOT SUPPORTED YET!!
name: 'guildMemberAdd', //name of event.
async execute(member: GuildMember) {
(await member.guild.channels.fetch('channel-id') as TextChannel).send(`Welcome, ${member}`);
}
})

Javascript:


exports.default = eventModule({
type: EventType.Discord,
plugins : [], //NOT SUPPORTED YET!!
name: 'guildMemberAdd', //name of event.
async execute(member) {
(await member.guild.channels.fetch('channel-id')).send(`Welcome, ${member}`);
}
})
- + \ No newline at end of file diff --git a/fr/docs/guide/walkthrough/goal.html b/fr/docs/guide/walkthrough/goal.html index c38ea1857..9b3f661d7 100644 --- a/fr/docs/guide/walkthrough/goal.html +++ b/fr/docs/guide/walkthrough/goal.html @@ -5,7 +5,7 @@ Goal | sern - Handlers. Redefined. - + @@ -13,7 +13,7 @@

Goal

sern strives to be minimalist, but with all batteries included. Meaning, this framework provides the necessary tools to start up a bot in minutes, and leaves plenty room space to customize your experience and create an amazing project. It should include all the tools for any bot at any scale.

- + \ No newline at end of file diff --git a/fr/docs/guide/walkthrough/good-to-know.html b/fr/docs/guide/walkthrough/good-to-know.html index ea62e5846..d0dd0b03e 100644 --- a/fr/docs/guide/walkthrough/good-to-know.html +++ b/fr/docs/guide/walkthrough/good-to-know.html @@ -5,7 +5,7 @@ Good to know | sern - Handlers. Redefined. - + @@ -13,7 +13,7 @@

Good to know

sern.config.json

A sern.config.json, although not necessary, allows your project to communicate with our cli.

For example, when installing typescript plugins, the language property is necessary to install from our open source repository.

Using the cli and running sern init --sync on pre-existing projects should install this json file in the root directory given. Or, if this is a brand-new project, sern init automatically installs it.

{
"language": "typescript",
"paths": {
"base": "src",
"commands": "commands"
}
}
- + \ No newline at end of file diff --git a/fr/docs/guide/walkthrough/plugins.html b/fr/docs/guide/walkthrough/plugins.html index ddfac9f6c..18f24c76a 100644 --- a/fr/docs/guide/walkthrough/plugins.html +++ b/fr/docs/guide/walkthrough/plugins.html @@ -5,7 +5,7 @@ Plugins | sern - Handlers. Redefined. - + @@ -16,7 +16,7 @@ This controls whether a module is stored into sern.
Typescript:

export function inDir(dir : string) : CommandPlugin<CommandType.Both> {
return {
type: PluginType.Command,
async execute(wrapper, { absPath, module }, controller) {
if(path.dirname(absPath) !== dir) {
console.log(+new Date(), `${module.name} is not in the correct directory!`);
return controller.stop()
}
console.log(+new Date(), `${module.name} is in the correct directory!`);
return controller.next(); //continue
}
}
}

Javascript:

export function inDir(dir : string) {
return {
type: PluginType.Command,
async execute(wrapper, { absPath, module }, controller) {
if(path.dirname(absPath) !== dir) {
console.log(+new Date(), `${module.name} is not in the correct directory!`);
return controller.stop()
}
console.log(+new Date(), `${module.name} is in the correct directory!`);
return controller.next(); //continue
}
}
}

Above, this simple plugin logs that the module has been loaded along with a timestamp.
Again, it is up to you to define plugin logic! The possibilities to customize your bots are endless.

astuce

Command Plugins are good for ensuring the shape, location, and preprocessing of your commands.

Event Plugins

event-plugins

  • An event is emitted by discord.js.
  • This event is passed to all plugins (in order!!),
  • If all are successful,

The command is executed. Calling controller.stop() notifies sern that this command should not be run, and this event is ignored.

So, what does a command module look like with plugins?

Typescript:

import { commandModule, CommandType } from '@sern/handler';

export default commandModule({
type: CommandType.Both,
plugins: [
inDir("other"),
serenOnly()
],
description: 'A ping command',
//alias : [],
execute: async (ctx, args) => {
await ctx.reply({ content: 'Pong 🏓' });
},
});

Javascript:

const { commandModule, CommandType } = require('@sern/handler');

exports.default = commandModule({
type: CommandType.Both,
plugins: [
inDir("other"),
serenOnly() //The plugins in this section applied to this module!
],
description: 'A ping command',
//alias : [],
execute: async (ctx, args) => {
await ctx.reply({ content: 'Pong 🏓' });
},
});

Can you predict the behavior of this command?

  • Before loading into sern, this command module will check if this module is in the correct directory other.
  • Before an event occurs, this command module will check if the user has the id 182326315813306368.
astuce

Event Plugins are good for filtering, preconditions, parsing.

If all plugins return controller.next(), this command replies Pong 🏓

- + \ No newline at end of file diff --git a/fr/docs/guide/walkthrough/sern-emitter.html b/fr/docs/guide/walkthrough/sern-emitter.html index e43959787..24eee682c 100644 --- a/fr/docs/guide/walkthrough/sern-emitter.html +++ b/fr/docs/guide/walkthrough/sern-emitter.html @@ -5,13 +5,13 @@ The SernEmitter class | sern - Handlers. Redefined. - +

The SernEmitter class

You're shipped with the SernEmitter. This EventEmitter listens to

  • command modules executing and its status, the module.activate event
  • command modules registered and its status, the module.register event
  • any error that occurs, the error event
  • warn events, where it is possible to throw errors

You can put these and other event listeners into event modules!


View all events
- + \ No newline at end of file diff --git a/fr/docs/intro.html b/fr/docs/intro.html index 453af0b6d..e4097f673 100644 --- a/fr/docs/intro.html +++ b/fr/docs/intro.html @@ -5,13 +5,13 @@ Welcome! | sern - Handlers. Redefined. - +

Welcome!

Content

  • /docs/api contains autogenerated documentation of our codebase using typedoc
  • /docs/guide contains a basic startup guide and details to get started with sern faster!
astuce

This site is open source! Please do contribute if you find any bugs, typos, or sections in need of improvements.

astuce

If you have problems, join the discord server here

- + \ No newline at end of file diff --git a/fr/index.html b/fr/index.html index b4ba8e953..3924e16eb 100644 --- a/fr/index.html +++ b/fr/index.html @@ -5,13 +5,13 @@ sern - Handlers. Redefined. | sern - Handlers. Redefined. - +
-

Handlers. Redefined.

With the support of the community made plugins and powerful a CLI, it's more than just a handler.

sern init
logo

Batteries included

Start or integrate a new project in minutes.

Customizable

Extend or customize with community-based plugins to provide utilities, filters, and more.

Modern

Uses modern and powerful tooling such as swc, tsup, typescript, and rxjs to future-proof and ensure project quality.

- +

Handlers. Redefined.

With the support of the community made plugins and powerful a CLI, it's more than just a handler.

sern init
logo

Batteries included

Start or integrate a new project in minutes.

Customizable

Extend or customize with community-based plugins to provide utilities, filters, and more.

Modern

Uses modern and powerful tooling such as swc, tsup, typescript, and rxjs to future-proof and ensure project quality.

+ \ No newline at end of file diff --git a/fr/markdown-page.html b/fr/markdown-page.html index a95413851..f37b2c240 100644 --- a/fr/markdown-page.html +++ b/fr/markdown-page.html @@ -5,13 +5,13 @@ Markdown page example | sern - Handlers. Redefined. - +

Markdown page example

You don't need React to write simple standalone pages.

- + \ No newline at end of file diff --git a/fr/plugins.html b/fr/plugins.html index 8429ec2e3..389eb3e74 100644 --- a/fr/plugins.html +++ b/fr/plugins.html @@ -5,13 +5,13 @@ sern - Handlers. Redefined. - +

Coming soon

- + \ No newline at end of file diff --git a/index.html b/index.html index 01010c5d1..dc0e5a661 100644 --- a/index.html +++ b/index.html @@ -5,13 +5,13 @@ sern - Handlers. Redefined. | sern - Handlers. Redefined. - +
-

Handlers. Redefined.

With the support of the community made plugins and powerful a CLI, it's more than just a handler.

sern init
logo

Batteries included

Start or integrate a new project in minutes.

Customizable

Extend or customize with community-based plugins to provide utilities, filters, and more.

Modern

Uses modern and powerful tooling such as swc, tsup, typescript, and rxjs to future-proof and ensure project quality.

- +

Handlers. Redefined.

With the support of the community made plugins and powerful a CLI, it's more than just a handler.

sern init
logo

Batteries included

Start or integrate a new project in minutes.

Customizable

Extend or customize with community-based plugins to provide utilities, filters, and more.

Modern

Uses modern and powerful tooling such as swc, tsup, typescript, and rxjs to future-proof and ensure project quality.

+ \ No newline at end of file diff --git a/markdown-page.html b/markdown-page.html index 2ec6e1677..76295c6d3 100644 --- a/markdown-page.html +++ b/markdown-page.html @@ -5,13 +5,13 @@ Markdown page example | sern - Handlers. Redefined. - +

Markdown page example

You don't need React to write simple standalone pages.

- + \ No newline at end of file diff --git a/plugins.html b/plugins.html index b6a52b5d2..0a5d4907f 100644 --- a/plugins.html +++ b/plugins.html @@ -5,13 +5,13 @@ sern - Handlers. Redefined. - +

Coming soon

- + \ No newline at end of file diff --git a/tr/404.html b/tr/404.html index 2c9f7dc95..9a49fc635 100644 --- a/tr/404.html +++ b/tr/404.html @@ -5,13 +5,13 @@ Sayfa Bulunamadı | sern - Handlers. Redefined. - +

Sayfa Bulunamadı

Aradığınız şeyi bulamadık.

Lütfen sizi orijinal URL'ye yönlendiren sitenin sahibiyle iletişime geçin ve bağlantısının bozuk olduğunu bildirin.

- + \ No newline at end of file diff --git a/fr/assets/js/c4f5d8e4.57fa0488.js b/tr/assets/js/c4f5d8e4.be1a5759.js similarity index 90% rename from fr/assets/js/c4f5d8e4.57fa0488.js rename to tr/assets/js/c4f5d8e4.be1a5759.js index 3e2aec4da..2c81795b8 100644 --- a/fr/assets/js/c4f5d8e4.57fa0488.js +++ b/tr/assets/js/c4f5d8e4.be1a5759.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_sern_website=self.webpackChunk_sern_website||[]).push([[195],{4660:(e,t,l)=>{l.d(t,{Z:()=>r});var a=l(7294);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:l,...r}=e;return a.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",style:{enableBackground:"new 0 0 512 512"},xmlSpace:"preserve","aria-labelledby":l},r),t?a.createElement("title",{id:l},t):null,a.createElement("path",{style:{fill:"#34485c"},d:"M17.655 441.379h476.69V123.586H17.655z"}),a.createElement("path",{style:{fill:"#4897f7"},d:"M70.621 88.276h52.965V35.31H70.621z"}),a.createElement("path",{style:{fill:"#576d7e"},d:"M61.793 238.345h105.931v-35.311H61.793z"}),a.createElement("path",{style:{fill:"#397abc"},d:"M150.073 123.586H44.142l17.656-35.31h70.62z"}),a.createElement("path",{style:{fill:"#c6421e"},d:"M388.414 88.276h52.965V35.31h-52.965z"}),a.createElement("path",{style:{fill:"#992c13"},d:"M467.866 123.586H361.935l17.656-35.31h70.62z"}),a.createElement("path",{style:{fill:"#576d7e"},d:"M450.211 203.034h-35.31v-35.31h-35.31v35.31H344.28v35.311h35.311v35.31h35.31v-35.31h35.31zM0 476.69h512v-35.311H0zM176.556 44.138v79.448h35.31V79.475a8.854 8.854 0 0 1 8.854-8.854h70.568a8.854 8.854 0 0 1 8.854 8.854v44.111h35.31V44.138c0-4.873-3.955-8.828-8.828-8.828h-141.24c-4.873 0-8.828 3.955-8.828 8.828"}))}},5261:(e,t,l)=>{l.d(t,{Z:()=>r});var a=l(7294);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:l,...r}=e;return a.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 58 58",style:{enableBackground:"new 0 0 58 58"},xmlSpace:"preserve","aria-labelledby":l},r),t?a.createElement("title",{id:l},t):null,a.createElement("path",{style:{fill:"#e57e25"},d:"M25 37.376c1.539 0 2.938.584 4 1.537v-7.298a3.239 3.239 0 0 0-3.239-3.239h-7.448a6 6 0 1 0-6.628 0H3.239A3.239 3.239 0 0 0 0 31.615v8.447a6 6 0 1 1 0 6.628v7.447a3.239 3.239 0 0 0 3.239 3.239h22.523a3.239 3.239 0 0 0 3.239-3.239V47.84a5.973 5.973 0 0 1-4 1.537c-3.314 0-6-2.686-6-6A6 6 0 0 1 25 37.376z"}),a.createElement("path",{style:{fill:"#f0c419"},d:"M26.832 14.761a4.985 4.985 0 0 0 4.619-.971l-.269.917-1.71 5.824a2.693 2.693 0 0 0 1.825 3.343l5.943 1.745a4.99 4.99 0 1 0 5.289 1.554l6.741 1.98a2.693 2.693 0 0 0 3.343-1.825l1.98-6.741a4.99 4.99 0 1 1 1.554-5.289l1.745-5.943a2.693 2.693 0 0 0-1.825-3.343L38.093.733a2.693 2.693 0 0 0-3.343 1.825l-1.476 5.026-.269.917a4.989 4.989 0 0 0-9.554.066 4.99 4.99 0 0 0 3.381 6.194z"}))}},2527:(e,t,l)=>{l.d(t,{Z:()=>s});var a,n,r=l(7294);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:l,...s}=e;return r.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg","aria-label":"TypeScript",viewBox:"0 0 512 512","aria-labelledby":l},s),t?r.createElement("title",{id:l},t):null,a||(a=r.createElement("rect",{width:512,height:512,rx:"15%",fill:"#3178c6"})),n||(n=r.createElement("path",{fill:"#fff",d:"M233 284h64v-41H118v41h64v183h51zm84 173c8.1 4.2 18 7.3 29 9.4s23 3.1 35 3.1 23-1.1 34-3.4 20-6.1 28-11c8.1-5.3 15-12 19-21s7.1-19 7.1-32c0-9.1-1.4-17-4.1-24s-6.6-13-12-18c-5.1-5.3-11-10-18-14s-15-8.2-24-12c-6.6-2.7-12-5.3-18-7.9-5.2-2.6-9.7-5.2-13-7.8-3.7-2.7-6.5-5.5-8.5-8.4-2-3-3-6.3-3-10 0-3.4.89-6.5 2.7-9.3s4.3-5.1 7.5-7.1 7.2-3.5 12-4.6c4.7-1.1 9.9-1.6 16-1.6 4.2 0 8.6.31 13 .94 4.6.63 9.3 1.6 14 2.9 4.7 1.3 9.3 2.9 14 4.9 4.4 2 8.5 4.3 12 6.9v-47c-7.6-2.9-16-5.1-25-6.5s-19-2.1-31-2.1-23 1.3-34 3.8-20 6.5-28 12c-8.1 5.4-14 12-19 21-4.7 8.4-7 18-7 30 0 15 4.3 28 13 38 8.6 11 22 19 39 27 6.9 2.8 13 5.6 19 8.3s11 5.5 15 8.4c4.3 2.9 7.7 6.1 10 9.5 2.5 3.4 3.8 7.4 3.8 12 0 3.2-.78 6.2-2.3 9s-3.9 5.2-7.1 7.2-7.1 3.6-12 4.8c-4.7 1.1-10 1.7-17 1.7-11 0-22-1.9-32-5.7-11-3.8-21-9.5-28.1-15.44z"})))}},2773:(e,t,l)=>{l.r(t),l.d(t,{default:()=>f});var a=l(7294),n=l(6010),r=l(9960),c=l(2263),s=l(2164),i=l(7462);const o="features_t9lD",m="featureSvg_GfXr",d=[{title:"Batteries included",Svg:l(4660).Z,description:a.createElement(a.Fragment,null,"Start or integrate a new project in minutes.")},{title:"Customizable",Svg:l(5261).Z,description:a.createElement(a.Fragment,null,"Extend or customize with community-based plugins to provide utilities, filters, and more.")},{title:"Modern",Svg:l(2527).Z,description:a.createElement(a.Fragment,null,"Uses modern and powerful tooling such as",a.createElement("a",{href:"https://swc.rs/"}," swc"),",",a.createElement("a",{href:"https://tsup.egoist.dev/"}," tsup"),",",a.createElement("a",{href:"https://www.typescriptlang.org/"}," typescript"),", and",a.createElement("a",{href:"https://rxjs.dev/"}," rxjs")," to future-proof and ensure project quality.")}];function h(e){let{Svg:t,title:l,description:r}=e;return a.createElement("div",{className:(0,n.Z)("col col--4")},a.createElement("div",{className:"text--center"},a.createElement(t,{className:m,role:"img"})),a.createElement("div",{className:"text--center padding-horiz--md"},a.createElement("h3",null,l),a.createElement("p",null,r)))}function p(){return a.createElement("section",{className:o},a.createElement("div",{className:"container"},a.createElement("div",{className:"row"},d.map(((e,t)=>a.createElement(h,(0,i.Z)({key:t},e)))))))}const u=l.p+"assets/images/sern-logo-2f73c45b583c361a057d64bbc67a51f5.png";var v=l(1207);function g(){const{siteConfig:e}=(0,c.Z)();return a.createElement("header",{className:(0,n.Z)("hero hero--primary-darker",v.Z.heroBanner)},a.createElement("div",{className:"container"},a.createElement("div",{className:"container"},a.createElement("div",{className:"row"},a.createElement("div",{className:"col col--6 "},a.createElement("h1",{className:(0,n.Z)("hero__title",v.Z["padding-vert--md"]),style:{fontSize:"450%"}},a.createElement("b",null,e.title.slice(6))),a.createElement("p",{className:"hero__subtitle"},e.tagline),a.createElement(r.Z,{className:"button button--secondary button--lg",to:"docs/guide/walkthrough/cli"},"sern init")),a.createElement("div",{className:"col col--6"},a.createElement("img",{src:u,alt:"logo",height:"100%"}))),a.createElement("div",{className:v.Z.buttons}))))}function f(){const{siteConfig:e}=(0,c.Z)();return a.createElement(s.Z,{title:"sern - Handlers. Redefined.",description:"Description will go into a meta tag in"},a.createElement(g,null),a.createElement("main",{className:"user-select-none"},a.createElement("div",{className:"hero"},a.createElement(p,null))))}},1207:(e,t,l)=>{l.d(t,{Z:()=>a});const a={heroBanner:"heroBanner_qdFl",buttons:"buttons_AeoN","padding-vert--md":"padding-vert--md_IMB4"}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_sern_website=self.webpackChunk_sern_website||[]).push([[195],{4660:(e,t,l)=>{l.d(t,{Z:()=>r});var a=l(7294);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:l,...r}=e;return a.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",style:{enableBackground:"new 0 0 512 512"},xmlSpace:"preserve","aria-labelledby":l},r),t?a.createElement("title",{id:l},t):null,a.createElement("path",{style:{fill:"#34485c"},d:"M17.655 441.379h476.69V123.586H17.655z"}),a.createElement("path",{style:{fill:"#4897f7"},d:"M70.621 88.276h52.965V35.31H70.621z"}),a.createElement("path",{style:{fill:"#576d7e"},d:"M61.793 238.345h105.931v-35.311H61.793z"}),a.createElement("path",{style:{fill:"#397abc"},d:"M150.073 123.586H44.142l17.656-35.31h70.62z"}),a.createElement("path",{style:{fill:"#c6421e"},d:"M388.414 88.276h52.965V35.31h-52.965z"}),a.createElement("path",{style:{fill:"#992c13"},d:"M467.866 123.586H361.935l17.656-35.31h70.62z"}),a.createElement("path",{style:{fill:"#576d7e"},d:"M450.211 203.034h-35.31v-35.31h-35.31v35.31H344.28v35.311h35.311v35.31h35.31v-35.31h35.31zM0 476.69h512v-35.311H0zM176.556 44.138v79.448h35.31V79.475a8.854 8.854 0 0 1 8.854-8.854h70.568a8.854 8.854 0 0 1 8.854 8.854v44.111h35.31V44.138c0-4.873-3.955-8.828-8.828-8.828h-141.24c-4.873 0-8.828 3.955-8.828 8.828"}))}},5261:(e,t,l)=>{l.d(t,{Z:()=>r});var a=l(7294);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:l,...r}=e;return a.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 58 58",style:{enableBackground:"new 0 0 58 58"},xmlSpace:"preserve","aria-labelledby":l},r),t?a.createElement("title",{id:l},t):null,a.createElement("path",{style:{fill:"#e57e25"},d:"M25 37.376c1.539 0 2.938.584 4 1.537v-7.298a3.239 3.239 0 0 0-3.239-3.239h-7.448a6 6 0 1 0-6.628 0H3.239A3.239 3.239 0 0 0 0 31.615v8.447a6 6 0 1 1 0 6.628v7.447a3.239 3.239 0 0 0 3.239 3.239h22.523a3.239 3.239 0 0 0 3.239-3.239V47.84a5.973 5.973 0 0 1-4 1.537c-3.314 0-6-2.686-6-6A6 6 0 0 1 25 37.376z"}),a.createElement("path",{style:{fill:"#f0c419"},d:"M26.832 14.761a4.985 4.985 0 0 0 4.619-.971l-.269.917-1.71 5.824a2.693 2.693 0 0 0 1.825 3.343l5.943 1.745a4.99 4.99 0 1 0 5.289 1.554l6.741 1.98a2.693 2.693 0 0 0 3.343-1.825l1.98-6.741a4.99 4.99 0 1 1 1.554-5.289l1.745-5.943a2.693 2.693 0 0 0-1.825-3.343L38.093.733a2.693 2.693 0 0 0-3.343 1.825l-1.476 5.026-.269.917a4.989 4.989 0 0 0-9.554.066 4.99 4.99 0 0 0 3.381 6.194z"}))}},2527:(e,t,l)=>{l.d(t,{Z:()=>s});var a,n,r=l(7294);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:l,...s}=e;return r.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg","aria-label":"TypeScript",viewBox:"0 0 512 512","aria-labelledby":l},s),t?r.createElement("title",{id:l},t):null,a||(a=r.createElement("rect",{width:512,height:512,rx:"15%",fill:"#3178c6"})),n||(n=r.createElement("path",{fill:"#fff",d:"M233 284h64v-41H118v41h64v183h51zm84 173c8.1 4.2 18 7.3 29 9.4s23 3.1 35 3.1 23-1.1 34-3.4 20-6.1 28-11c8.1-5.3 15-12 19-21s7.1-19 7.1-32c0-9.1-1.4-17-4.1-24s-6.6-13-12-18c-5.1-5.3-11-10-18-14s-15-8.2-24-12c-6.6-2.7-12-5.3-18-7.9-5.2-2.6-9.7-5.2-13-7.8-3.7-2.7-6.5-5.5-8.5-8.4-2-3-3-6.3-3-10 0-3.4.89-6.5 2.7-9.3s4.3-5.1 7.5-7.1 7.2-3.5 12-4.6c4.7-1.1 9.9-1.6 16-1.6 4.2 0 8.6.31 13 .94 4.6.63 9.3 1.6 14 2.9 4.7 1.3 9.3 2.9 14 4.9 4.4 2 8.5 4.3 12 6.9v-47c-7.6-2.9-16-5.1-25-6.5s-19-2.1-31-2.1-23 1.3-34 3.8-20 6.5-28 12c-8.1 5.4-14 12-19 21-4.7 8.4-7 18-7 30 0 15 4.3 28 13 38 8.6 11 22 19 39 27 6.9 2.8 13 5.6 19 8.3s11 5.5 15 8.4c4.3 2.9 7.7 6.1 10 9.5 2.5 3.4 3.8 7.4 3.8 12 0 3.2-.78 6.2-2.3 9s-3.9 5.2-7.1 7.2-7.1 3.6-12 4.8c-4.7 1.1-10 1.7-17 1.7-11 0-22-1.9-32-5.7-11-3.8-21-9.5-28.1-15.44z"})))}},2773:(e,t,l)=>{l.r(t),l.d(t,{default:()=>f});var a=l(7294),n=l(6010),r=l(9960),c=l(2263),s=l(2164),i=l(7462);const o="features_t9lD",m="featureSvg_GfXr",d=[{title:"Batteries included",Svg:l(4660).Z,description:a.createElement(a.Fragment,null,"Start or integrate a new project in minutes.")},{title:"Customizable",Svg:l(5261).Z,description:a.createElement(a.Fragment,null,"Extend or customize with community-based plugins to provide utilities, filters, and more.")},{title:"Modern",Svg:l(2527).Z,description:a.createElement(a.Fragment,null,"Uses modern and powerful tooling such as",a.createElement("a",{href:"https://swc.rs/"}," swc"),",",a.createElement("a",{href:"https://tsup.egoist.dev/"}," tsup"),",",a.createElement("a",{href:"https://www.typescriptlang.org/"}," typescript"),", and",a.createElement("a",{href:"https://rxjs.dev/"}," rxjs")," to future-proof and ensure project quality.")}];function h(e){let{Svg:t,title:l,description:r}=e;return a.createElement("div",{className:(0,n.Z)("col col--4")},a.createElement("div",{className:"text--center"},a.createElement(t,{className:m,role:"img"})),a.createElement("div",{className:"text--center padding-horiz--md"},a.createElement("h3",null,l),a.createElement("p",null,r)))}function u(){return a.createElement("section",{className:o},a.createElement("div",{className:"container"},a.createElement("div",{className:"row"},d.map(((e,t)=>a.createElement(h,(0,i.Z)({key:t},e)))))))}const p=l.p+"assets/images/sern-logo-2f73c45b583c361a057d64bbc67a51f5.png";var v=l(1207);function g(){const{siteConfig:e}=(0,c.Z)();return a.createElement("header",{className:(0,n.Z)("hero hero--primary-darker",v.Z.heroBanner)},a.createElement("div",{className:"container"},a.createElement("div",{className:"container"},a.createElement("div",{className:"row"},a.createElement("div",{className:"col col--6 "},a.createElement("h1",{className:(0,n.Z)("hero__title",v.Z["padding-vert--md"]),style:{fontSize:"450%"}},a.createElement("b",null,e.title.slice(6))),a.createElement("p",{className:"hero__subtitle"},e.tagline),a.createElement(r.Z,{className:"button button--secondary button--lg",to:"docs/guide/walkthrough/cli"},"sern init")),a.createElement("div",{className:"col col--6"},a.createElement("img",{src:p,alt:"logo",height:"auto",width:"auto"}))),a.createElement("div",{className:v.Z.buttons}))))}function f(){const{siteConfig:e}=(0,c.Z)();return a.createElement(s.Z,{title:"sern - Handlers. Redefined.",description:"Description will go into a meta tag in"},a.createElement(g,null),a.createElement("main",{className:"user-select-none"},a.createElement("div",{className:"hero"},a.createElement(u,null))))}},1207:(e,t,l)=>{l.d(t,{Z:()=>a});const a={heroBanner:"heroBanner_qdFl",buttons:"buttons_AeoN","padding-vert--md":"padding-vert--md_IMB4"}}}]); \ No newline at end of file diff --git a/tr/assets/js/runtime~main.30294f4a.js b/tr/assets/js/runtime~main.5d8ff676.js similarity index 98% rename from tr/assets/js/runtime~main.30294f4a.js rename to tr/assets/js/runtime~main.5d8ff676.js index efbc7d950..d4f135b32 100644 --- a/tr/assets/js/runtime~main.30294f4a.js +++ b/tr/assets/js/runtime~main.5d8ff676.js @@ -1 +1 @@ -(()=>{"use strict";var e,t,r,a,f,c={},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={id:e,loaded:!1,exports:{}};return c[e].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}n.m=c,n.c=o,e=[],n.O=(t,r,a,f)=>{if(!r){var c=1/0;for(i=0;i=f)&&Object.keys(n.O).every((e=>n.O[e](r[d])))?r.splice(d--,1):(o=!1,f0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[r,a,f]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,n.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var f=Object.create(null);n.r(f);var c={};t=t||[null,r({}),r([]),r(r)];for(var o=2&a&&e;"object"==typeof o&&!~t.indexOf(o);o=r(o))Object.getOwnPropertyNames(o).forEach((t=>c[t]=()=>e[t]));return c.default=()=>e,n.d(f,c),f},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>"assets/js/"+({5:"1ac1bfe9",45:"888566f1",53:"5bc4ccbc",62:"69369ae2",85:"1f391b9e",127:"7e205c4a",137:"1aef51bd",146:"608ca171",195:"c4f5d8e4",197:"935f2afb",226:"707baeff",270:"e4877132",277:"c4348237",306:"f6aebfbf",322:"a5467962",332:"73bd57bd",363:"26f1f3a5",397:"312c2bc5",414:"393be207",429:"eea0bf40",472:"cf183316",514:"1be78505",597:"5e8c322a",640:"a96c96b0",652:"bcd9df7e",671:"0e384e19",703:"981f6151",712:"3dc7c79a",750:"3a2d3092",803:"9201de17",865:"e8e3d8c7",918:"17896441"}[e]||e)+"."+{5:"c00978fb",45:"f45e88cc",53:"543d4652",62:"1291f58b",85:"d7ab1744",127:"5580539a",137:"1d246191",146:"3ff7ee97",195:"57fa0488",197:"d705dc58",226:"ec3c22a7",270:"b1ecf932",277:"bbd90c09",306:"5ba63757",322:"4d983a8a",332:"91bccb31",363:"f89eebba",397:"1f24705a",414:"d0baab28",429:"1da99ada",472:"957e8d21",503:"668d49f6",514:"f852ff9f",597:"b8ec8c7c",640:"3ae993a6",652:"0ecd6450",671:"c17b3a93",703:"20818673",712:"2ac6a2eb",750:"95e55099",803:"70f58db8",865:"484315fb",918:"15289f85",972:"61be9a41"}[e]+".js",n.miniCssF=e=>{},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},f="@sern/website:",n.l=(e,t,r,c)=>{if(a[e])a[e].push(t);else{var o,d;if(void 0!==r)for(var b=document.getElementsByTagName("script"),i=0;i{o.onerror=o.onload=null,clearTimeout(s);var f=a[e];if(delete a[e],o.parentNode&&o.parentNode.removeChild(o),f&&f.forEach((e=>e(r))),t)return t(r)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),d&&document.head.appendChild(o)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/tr/",n.gca=function(e){return e={17896441:"918","1ac1bfe9":"5","888566f1":"45","5bc4ccbc":"53","69369ae2":"62","1f391b9e":"85","7e205c4a":"127","1aef51bd":"137","608ca171":"146",c4f5d8e4:"195","935f2afb":"197","707baeff":"226",e4877132:"270",c4348237:"277",f6aebfbf:"306",a5467962:"322","73bd57bd":"332","26f1f3a5":"363","312c2bc5":"397","393be207":"414",eea0bf40:"429",cf183316:"472","1be78505":"514","5e8c322a":"597",a96c96b0:"640",bcd9df7e:"652","0e384e19":"671","981f6151":"703","3dc7c79a":"712","3a2d3092":"750","9201de17":"803",e8e3d8c7:"865"}[e]||e,n.p+n.u(e)},(()=>{var e={303:0,532:0};n.f.j=(t,r)=>{var a=n.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else if(/^(303|532)$/.test(t))e[t]=0;else{var f=new Promise(((r,f)=>a=e[t]=[r,f]));r.push(a[2]=f);var c=n.p+n.u(t),o=new Error;n.l(c,(r=>{if(n.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var f=r&&("load"===r.type?"missing":r.type),c=r&&r.target&&r.target.src;o.message="Loading chunk "+t+" failed.\n("+f+": "+c+")",o.name="ChunkLoadError",o.type=f,o.request=c,a[1](o)}}),"chunk-"+t,t)}},n.O.j=t=>0===e[t];var t=(t,r)=>{var a,f,c=r[0],o=r[1],d=r[2],b=0;if(c.some((t=>0!==e[t]))){for(a in o)n.o(o,a)&&(n.m[a]=o[a]);if(d)var i=d(n)}for(t&&t(r);b{"use strict";var e,t,r,a,f,c={},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={id:e,loaded:!1,exports:{}};return c[e].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}n.m=c,n.c=o,e=[],n.O=(t,r,a,f)=>{if(!r){var c=1/0;for(i=0;i=f)&&Object.keys(n.O).every((e=>n.O[e](r[d])))?r.splice(d--,1):(o=!1,f0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[r,a,f]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,n.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var f=Object.create(null);n.r(f);var c={};t=t||[null,r({}),r([]),r(r)];for(var o=2&a&&e;"object"==typeof o&&!~t.indexOf(o);o=r(o))Object.getOwnPropertyNames(o).forEach((t=>c[t]=()=>e[t]));return c.default=()=>e,n.d(f,c),f},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>"assets/js/"+({5:"1ac1bfe9",45:"888566f1",53:"5bc4ccbc",62:"69369ae2",85:"1f391b9e",127:"7e205c4a",137:"1aef51bd",146:"608ca171",195:"c4f5d8e4",197:"935f2afb",226:"707baeff",270:"e4877132",277:"c4348237",306:"f6aebfbf",322:"a5467962",332:"73bd57bd",363:"26f1f3a5",397:"312c2bc5",414:"393be207",429:"eea0bf40",472:"cf183316",514:"1be78505",597:"5e8c322a",640:"a96c96b0",652:"bcd9df7e",671:"0e384e19",703:"981f6151",712:"3dc7c79a",750:"3a2d3092",803:"9201de17",865:"e8e3d8c7",918:"17896441"}[e]||e)+"."+{5:"c00978fb",45:"f45e88cc",53:"543d4652",62:"1291f58b",85:"d7ab1744",127:"5580539a",137:"1d246191",146:"3ff7ee97",195:"be1a5759",197:"d705dc58",226:"ec3c22a7",270:"b1ecf932",277:"bbd90c09",306:"5ba63757",322:"4d983a8a",332:"91bccb31",363:"f89eebba",397:"1f24705a",414:"d0baab28",429:"1da99ada",472:"957e8d21",503:"668d49f6",514:"f852ff9f",597:"b8ec8c7c",640:"3ae993a6",652:"0ecd6450",671:"c17b3a93",703:"20818673",712:"2ac6a2eb",750:"95e55099",803:"70f58db8",865:"484315fb",918:"15289f85",972:"61be9a41"}[e]+".js",n.miniCssF=e=>{},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},f="@sern/website:",n.l=(e,t,r,c)=>{if(a[e])a[e].push(t);else{var o,d;if(void 0!==r)for(var b=document.getElementsByTagName("script"),i=0;i{o.onerror=o.onload=null,clearTimeout(s);var f=a[e];if(delete a[e],o.parentNode&&o.parentNode.removeChild(o),f&&f.forEach((e=>e(r))),t)return t(r)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),d&&document.head.appendChild(o)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/tr/",n.gca=function(e){return e={17896441:"918","1ac1bfe9":"5","888566f1":"45","5bc4ccbc":"53","69369ae2":"62","1f391b9e":"85","7e205c4a":"127","1aef51bd":"137","608ca171":"146",c4f5d8e4:"195","935f2afb":"197","707baeff":"226",e4877132:"270",c4348237:"277",f6aebfbf:"306",a5467962:"322","73bd57bd":"332","26f1f3a5":"363","312c2bc5":"397","393be207":"414",eea0bf40:"429",cf183316:"472","1be78505":"514","5e8c322a":"597",a96c96b0:"640",bcd9df7e:"652","0e384e19":"671","981f6151":"703","3dc7c79a":"712","3a2d3092":"750","9201de17":"803",e8e3d8c7:"865"}[e]||e,n.p+n.u(e)},(()=>{var e={303:0,532:0};n.f.j=(t,r)=>{var a=n.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else if(/^(303|532)$/.test(t))e[t]=0;else{var f=new Promise(((r,f)=>a=e[t]=[r,f]));r.push(a[2]=f);var c=n.p+n.u(t),o=new Error;n.l(c,(r=>{if(n.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var f=r&&("load"===r.type?"missing":r.type),c=r&&r.target&&r.target.src;o.message="Loading chunk "+t+" failed.\n("+f+": "+c+")",o.name="ChunkLoadError",o.type=f,o.request=c,a[1](o)}}),"chunk-"+t,t)}},n.O.j=t=>0===e[t];var t=(t,r)=>{var a,f,c=r[0],o=r[1],d=r[2],b=0;if(c.some((t=>0!==e[t]))){for(a in o)n.o(o,a)&&(n.m[a]=o[a]);if(d)var i=d(n)}for(t&&t(r);b @sern/handler | sern - Handlers. Redefined. - +

SernHandler

NPM versionNPM downloadsMIT License

A customizable, batteries-included, powerful discord.js framework to automate and streamline your bot development.

Installation

npm install @sern/handler
yarn add @sern/handler
pnpm add @sern/handler

Basic Usage

index.js (CommonJS)

const { Client, GatewayIntentBits } = require('discord.js');
const { Sern } = require('@sern/handler');
const { defaultPrefix, token } = require('./config.json');

const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages
]
});

Sern.init({
client,
defaultPrefix,
commands : 'src/commands',
});

client.login(token);

ping.js (CommonJS)

const { Sern, CommandType, commandModule } = require('@sern/handler');

exports.default = commandModule({
description: 'A ping pong command',
type: CommandType.Slash,
execute(ctx) {
ctx.reply('pong!');
}
});

See our templates for TypeScript examples and more

CLI

It is highly encouraged to use the command line interface for your project. Don't forget to view it.

Contribute

  • Read our contribution guidelines carefully
  • Pull up on issues and report bugs
  • All kinds of contributions are welcomed.

Roadmap

You can check our roadmap to see what's going to be added or patched in the future.

- + \ No newline at end of file diff --git a/tr/docs/api/classes/Context.html b/tr/docs/api/classes/Context.html index 6048ee6f8..1e2bdf020 100644 --- a/tr/docs/api/classes/Context.html +++ b/tr/docs/api/classes/Context.html @@ -5,7 +5,7 @@ Class: Context | sern - Handlers. Redefined. - + @@ -16,7 +16,7 @@ CommandType.Text or the event fired in a Both command was Message

Returns

ChatInputCommandInteraction<CacheType>

Defined in

src/handler/structures/context.ts:52


member

get member(): Nullish<GuildMember | APIGuildMember>

Returns

Nullish<GuildMember | APIGuildMember>

Defined in

src/handler/structures/context.ts:101


message

get message(): Message<boolean>

Getting the Message object. Crashes if module type is CommandType.Slash or the event fired in a Both command was ChatInputCommandInteraction

Returns

Message<boolean>

Defined in

src/handler/structures/context.ts:44


user

get user(): User

Returns

User

Defined in

src/handler/structures/context.ts:70

Methods

isEmpty

isEmpty(): boolean

Returns

boolean

Defined in

src/handler/structures/context.ts:129


reply

reply(content): Promise<Message<boolean>>

Parameters

NameType
contentstring | Omit<InteractionReplyOptions, "fetchReply"> | ReplyMessageOptions

Returns

Promise<Message<boolean>>

Defined in

src/handler/structures/context.ts:133


wrap

Static wrap(wrappable): Context

Parameters

NameType
wrappableMessage<boolean> | ChatInputCommandInteraction<CacheType>

Returns

Context

Defined in

src/handler/structures/context.ts:122

- + \ No newline at end of file diff --git a/tr/docs/api/classes/SernEmitter.html b/tr/docs/api/classes/SernEmitter.html index baec61e90..8f36bd44d 100644 --- a/tr/docs/api/classes/SernEmitter.html +++ b/tr/docs/api/classes/SernEmitter.html @@ -5,7 +5,7 @@ Class: SernEmitter | sern - Handlers. Redefined. - + @@ -49,7 +49,7 @@ given event.

This method is intentionally generic and works with the web p semantics and does not listen to the 'error' event.

const { once, EventEmitter } = require('events');

async function run() {
const ee = new EventEmitter();

process.nextTick(() => {
ee.emit('myevent', 42);
});

const [value] = await once(ee, 'myevent');
console.log(value);

const err = new Error('kaboom');
process.nextTick(() => {
ee.emit('error', err);
});

try {
await once(ee, 'myevent');
} catch (err) {
console.log('error happened', err);
}
}

run();

The special handling of the 'error' event is only used when events.once()is used to wait for another event. If events.once() is used to wait for the 'error' event itself, then it is treated as any other kind of event without special handling:

const { EventEmitter, once } = require('events');

const ee = new EventEmitter();

once(ee, 'error')
.then(([err]) => console.log('ok', err.message))
.catch((err) => console.log('error', err.message));

ee.emit('error', new Error('boom'));

// Prints: ok boom

An AbortSignal can be used to cancel waiting for the event:

const { EventEmitter, once } = require('events');

const ee = new EventEmitter();
const ac = new AbortController();

async function foo(emitter, event, signal) {
try {
await once(emitter, event, { signal });
console.log('event emitted!');
} catch (error) {
if (error.name === 'AbortError') {
console.error('Waiting for the event was canceled!');
} else {
console.error('There was an error', error.message);
}
}
}

foo(ee, 'foo', ac.signal);
ac.abort(); // Abort waiting for the event
ee.emit('foo'); // Prints: Waiting for the event was canceled!

Since

v11.13.0, v10.16.0

Parameters

NameType
emitterNodeEventTarget
eventNamestring | symbol
options?StaticEventEmitterOptions

Returns

Promise<any[]>

Inherited from

EventEmitter.once

Defined in

node_modules/@types/node/events.d.ts:157

Static once(emitter, eventName, options?): Promise<any[]>

Parameters

NameType
emitterDOMEventTarget
eventNamestring
options?StaticEventEmitterOptions

Returns

Promise<any[]>

Inherited from

EventEmitter.once

Defined in

node_modules/@types/node/events.d.ts:158

Static once<K>(eventEmitter, eventName): Promise<ClientEvents[K]>

Type parameters

NameType
Kextends keyof ClientEvents

Parameters

NameType
eventEmitterClient<boolean>
eventNameK

Returns

Promise<ClientEvents[K]>

Inherited from

EventEmitter.once

Defined in

node_modules/discord.js/typings/index.d.ts:194


setMaxListeners

Static setMaxListeners(n?, ...eventTargets): void

const {
setMaxListeners,
EventEmitter
} = require('events');

const target = new EventTarget();
const emitter = new EventEmitter();

setMaxListeners(5, target, emitter);

Since

v15.4.0

Parameters

NameTypeDescription
n?numberA non-negative number. The maximum number of listeners per EventTarget event.
...eventTargets(EventEmitter | DOMEventTarget)[]-

Returns

void

Inherited from

EventEmitter.setMaxListeners

Defined in

node_modules/@types/node/events.d.ts:280

- + \ No newline at end of file diff --git a/tr/docs/api/enums/CommandType.html b/tr/docs/api/enums/CommandType.html index 8313a2485..96a060717 100644 --- a/tr/docs/api/enums/CommandType.html +++ b/tr/docs/api/enums/CommandType.html @@ -5,13 +5,13 @@ Enumeration: CommandType | sern - Handlers. Redefined. - +

Enumeration: CommandType

Example

export default commandModule({
type : CommandType.Text,
name : 'a text command'
execute(message) {
console.log(message.content)
}
})

Enumeration Members

Both

Both = 3

The CommandType for hybrid commands, text and slash

Defined in

src/handler/structures/enums.ts:27


Button

Button = 16

The CommandType for ButtonInteraction commands

Defined in

src/handler/structures/enums.ts:39


MenuMsg = 8

The CommandType for MessageContextMenuInteraction commands

Defined in

src/handler/structures/enums.ts:35


MenuSelect = 32

The CommandType for SelectMenuInteraction commands

Defined in

src/handler/structures/enums.ts:43


MenuUser = 4

The CommandType for UserContextMenuInteraction commands

Defined in

src/handler/structures/enums.ts:31


Modal = 64

The CommandType for ModalSubmitInteraction commands

Defined in

src/handler/structures/enums.ts:47


Slash

Slash = 2

The CommandType for slash commands

Defined in

src/handler/structures/enums.ts:23


Text

Text = 1

The CommandType for text commands

Defined in

src/handler/structures/enums.ts:19

- + \ No newline at end of file diff --git a/tr/docs/api/enums/EventType.html b/tr/docs/api/enums/EventType.html index 54f51379d..3e4ee062f 100644 --- a/tr/docs/api/enums/EventType.html +++ b/tr/docs/api/enums/EventType.html @@ -5,14 +5,14 @@ Enumeration: EventType | sern - Handlers. Redefined. - +

Enumeration: EventType

Example

export default eventModule({
type : EventType.Discord,
name : 'guildMemberAdd'
execute(member : GuildMember) {
console.log(member)
}
})

Enumeration Members

Discord

Discord = 1

The EventType for handling discord events

Defined in

src/handler/structures/enums.ts:68


External

External = 3

The EventType for handling external events. Could be for example, process events, database events

Defined in

src/handler/structures/enums.ts:77


Sern

Sern = 2

The EventType for handling sern events

Defined in

src/handler/structures/enums.ts:72

- + \ No newline at end of file diff --git a/tr/docs/api/enums/PayloadType.html b/tr/docs/api/enums/PayloadType.html index 2ef18c031..f1de097e2 100644 --- a/tr/docs/api/enums/PayloadType.html +++ b/tr/docs/api/enums/PayloadType.html @@ -5,13 +5,13 @@ Enumeration: PayloadType | sern - Handlers. Redefined. - +
- + \ No newline at end of file diff --git a/tr/docs/api/enums/PluginType.html b/tr/docs/api/enums/PluginType.html index c4aa85783..70b3fae5a 100644 --- a/tr/docs/api/enums/PluginType.html +++ b/tr/docs/api/enums/PluginType.html @@ -5,13 +5,13 @@ Enumeration: PluginType | sern - Handlers. Redefined. - +

Enumeration: PluginType

Example

export default function myPlugin() : EventPlugin<CommandType.Text> {
type : PluginType.Event,
execute([ctx, args], controller) {
return controller.next();
}
}

Enumeration Members

Command

Command = 1

The PluginType for CommandPlugins

Defined in

src/handler/structures/enums.ts:97


Event

Event = 2

The PluginType for EventPlugins

Defined in

src/handler/structures/enums.ts:101

- + \ No newline at end of file diff --git a/tr/docs/api/interfaces/Controller.html b/tr/docs/api/interfaces/Controller.html index 12613e97c..0b05e1f13 100644 --- a/tr/docs/api/interfaces/Controller.html +++ b/tr/docs/api/interfaces/Controller.html @@ -5,13 +5,13 @@ Interface: Controller | sern - Handlers. Redefined. - +
- + \ No newline at end of file diff --git a/tr/docs/api/interfaces/Wrapper.html b/tr/docs/api/interfaces/Wrapper.html index fbe5ebd9d..176ae4adb 100644 --- a/tr/docs/api/interfaces/Wrapper.html +++ b/tr/docs/api/interfaces/Wrapper.html @@ -5,13 +5,13 @@ Interface: Wrapper | sern - Handlers. Redefined. - +

Interface: Wrapper

An object to be passed into Sern#init() function.

Properties

client

Readonly client: Client<boolean>

Defined in

src/handler/structures/wrapper.ts:10


commands

Readonly commands: string

Defined in

src/handler/structures/wrapper.ts:13


defaultPrefix

Optional Readonly defaultPrefix: string

Defined in

src/handler/structures/wrapper.ts:12


events

Optional Readonly events: string | { absPath: string ; mod: EventModule }[] | () => { absPath: string ; mod: EventModule }[]

Defined in

src/handler/structures/wrapper.ts:14


sernEmitter

Optional Readonly sernEmitter: SernEmitter

Defined in

src/handler/structures/wrapper.ts:11

- + \ No newline at end of file diff --git a/tr/docs/api/modules.html b/tr/docs/api/modules.html index 98099327f..c470ae667 100644 --- a/tr/docs/api/modules.html +++ b/tr/docs/api/modules.html @@ -5,7 +5,7 @@ @sern/handler | sern - Handlers. Redefined. - + @@ -13,7 +13,7 @@

@sern/handler

Namespaces

Enumerations

Classes

Interfaces

Type Aliases

Args

Ƭ Args: ParseType<{ slash: SlashOptions ; text: string[] }>

Defined in

src/types/handler.ts:11


AutocompletePlugin

Ƭ AutocompletePlugin: Override<BaseModule, { execute: (autocmp: AutocompleteInteraction, controlller: Controller) => Awaitable<Result<void, void>> ; type: Event }>

Defined in

src/handler/plugins/plugin.ts:92


BaseOptions

Ƭ BaseOptions: ApplicationCommandChoicesData | ApplicationCommandNonOptionsData | ApplicationCommandChannelOptionData | ApplicationCommandNumericOptionData | ApplicationCommandAttachmentOption | SernAutocompleteData

Type that replaces autocomplete with SernAutocompleteData

Defined in

src/handler/structures/module.ts:181


BothCommand

Ƭ BothCommand: Override<BaseModule, { alias?: string[] ; execute: (ctx: Context, args: Args) => Awaitable<void | unknown> ; onEvent: EventPlugin<Both>[] ; options?: SernOptionsData[] ; plugins: CommandPlugin[] ; type: Both }>

Defined in

src/handler/structures/module.ts:55


CommandModuleNoPlugins

Ƭ CommandModuleNoPlugins: { [T in CommandType]: Omit<CommandModuleDefs[T], "plugins" | "onEvent"> }

Defined in

src/handler/plugins/plugin.ts:145


CommandModulePlugin

Ƭ CommandModulePlugin<T>: EventPlugin<T> | CommandPlugin<T>

Type parameters

NameType
Textends CommandType

Defined in

src/handler/plugins/plugin.ts:173


CommandPlugin

Ƭ CommandPlugin<T>: { [K in T]: Override<BasePlugin, Object> }[T]

Type parameters

NameType
Textends keyof CommandModuleDefs = keyof CommandModuleDefs

Defined in

src/handler/plugins/plugin.ts:40


DefinedCommandModule

Ƭ DefinedCommandModule: DefinitelyDefined<CommandModule, "name" | "description">

Defined in

src/types/handler.ts:48


DefinedEventModule

Ƭ DefinedEventModule: DefinitelyDefined<EventModule, "name" | "description">

Defined in

src/types/handler.ts:49


DefinedModule

Ƭ DefinedModule: DefinitelyDefined<Module, "name" | "description">

After modules are transformed, name and description are given default values if none are provided to Module. This type represents that transformation

Defined in

src/types/handler.ts:47


DefinitelyDefined

Ƭ DefinitelyDefined<T, K>: { [L in K]-?: T[L] extends Record<string, unknown> ? DefinitelyDefined<T[L], keyof T[L]> : Required<T>[L] } & T

Type parameters

NameType
TT
Kextends keyof T = keyof T

Defined in

src/types/handler.ts:18


DiscordEmitterPlugin

Ƭ DiscordEmitterPlugin: Override<BasePlugin, { execute: (wrapper: Client, module: DefinitelyDefined<DiscordEventCommand, "name" | "description">, controller: Controller) => Awaitable<Result<void, void>> ; type: Command }>

Defined in

src/handler/plugins/plugin.ts:57


DiscordEventPlugin

Ƭ DiscordEventPlugin<T>: Override<BasePlugin, { execute: (args: ClientEvents[T], controller: Controller) => Awaitable<Result<void, void>> ; name?: T ; type: Event }>

Type parameters

NameType
Textends keyof ClientEvents = keyof ClientEvents

Defined in

src/handler/plugins/plugin.ts:136


EventInput

Ƭ EventInput: string | { absPath: string ; mod: EventModule }[] | () => { absPath: string ; mod: EventModule }[]

Defined in

src/types/handler.ts:24


EventModuleCommandPluginDefs

Ƭ EventModuleCommandPluginDefs: Object

Event Module Command Plugins

Type declaration

NameType
1DiscordEmitterPlugin
2SernEmitterPlugin
3ExternalEmitterPlugin

Defined in

src/handler/plugins/plugin.ts:163


EventModuleEventPluginDefs

Ƭ EventModuleEventPluginDefs: Object

Event Module Event Plugins

Type declaration

NameType
1DiscordEventPlugin
2SernEventPlugin
3ExternalEventPlugin

Defined in

src/handler/plugins/plugin.ts:154


EventModulePlugin

Ƭ EventModulePlugin<T>: EventModuleEventPluginDefs[T] | EventModuleCommandPluginDefs[T]

Type parameters

NameType
Textends EventType

Defined in

src/handler/plugins/plugin.ts:169


EventModulesNoPlugins

Ƭ EventModulesNoPlugins: { [T in EventType]: Omit<EventModuleDefs[T], "plugins" | "onEvent"> }

Defined in

src/handler/plugins/plugin.ts:148


EventPlugin

Ƭ EventPlugin<T>: { [K in T]: Override<BasePlugin, Object> }[T]

Type parameters

NameType
Textends keyof CommandModuleDefs = keyof CommandModuleDefs

Defined in

src/handler/plugins/plugin.ts:103


ExternalEmitterPlugin

Ƭ ExternalEmitterPlugin<T>: Override<BasePlugin, { execute: (wrapper: T, module: DefinitelyDefined<ExternalEventCommand, "name" | "description">, controller: Controller) => Awaitable<Result<void, void>> ; type: Command }>

Type parameters

NameType
Textends EventEmitter = EventEmitter

Defined in

src/handler/plugins/plugin.ts:68


ExternalEventPlugin

Ƭ ExternalEventPlugin: Override<BasePlugin, { execute: (args: unknown[], controller: Controller) => Awaitable<Result<void, void>> ; type: Event }>

Defined in

src/handler/plugins/plugin.ts:128


InputCommandModule

Ƭ InputCommandModule: { [T in CommandType]: CommandModuleNoPlugins[T] & Object }[CommandType]

User inputs this type. Sern processes behind the scenes for better usage

Defined in

src/handler/plugins/plugin.ts:178


InputEventModule

Ƭ InputEventModule: { [T in EventType]: EventModulesNoPlugins[T] & Object }[EventType]

Defined in

src/handler/plugins/plugin.ts:182


IsOptional

Ƭ IsOptional<T>: { [K in keyof T]-?: T[K] extends Required<T>[K] ? false : true }

Type parameters

Name
T

Defined in

src/types/handler.ts:31


Module

Ƭ Module: CommandModule | EventModule

Defined in

src/handler/structures/module.ts:141


Nullish

Ƭ Nullish<T>: T | undefined | null

Type parameters

Name
T

Defined in

src/types/handler.ts:4


Override

Ƭ Override<T1, T2>: Omit<T1, keyof T2> & T2

Type parameters

Name
T1
T2

Defined in

src/types/handler.ts:16


ParseType

Ƭ ParseType<T>: { [K in keyof T]: T[K] extends unknown ? [k: K, args: T[K]] : never }[keyof T]

Type parameters

Name
T

Defined in

src/types/handler.ts:7


Payload

Ƭ Payload: { module: Module ; type: Success } | { module: Module | undefined ; reason: string | Error ; type: Failure }

Defined in

src/types/handler.ts:50


Reconstruct

Ƭ Reconstruct<T>: T extends Omit<infer O, never> ? O & Reconstruct<O> : T

Type parameters

Name
T

Defined in

src/types/handler.ts:29


SernAutocompleteData

Ƭ SernAutocompleteData: Override<BaseApplicationCommandOptionsData, { autocomplete: true ; command: AutocompleteCommand ; type: ApplicationCommandOptionType.String | ApplicationCommandOptionType.Number | ApplicationCommandOptionType.Integer }>

Defined in

src/handler/structures/module.ts:166


SernEmitterPlugin

Ƭ SernEmitterPlugin: Override<BasePlugin, { execute: (wrapper: SernEmitter, module: DefinitelyDefined<SernEventCommand, "name" | "description">, controller: Controller) => Awaitable<Result<void, void>> ; type: Command }>

Defined in

src/handler/plugins/plugin.ts:80


SernEventPlugin

Ƭ SernEventPlugin<T>: Override<BasePlugin, { execute: (args: SernEventsMapping[T], controller: Controller) => Awaitable<Result<void, void>> ; name?: T ; type: Event }>

Type parameters

NameType
Textends keyof SernEventsMapping = keyof SernEventsMapping

Defined in

src/handler/plugins/plugin.ts:116


SernEventsMapping

Ƭ SernEventsMapping: Object

Type declaration

NameType
error[Error | string]
module.activate[Payload]
module.register[Payload]
warning[string]

Defined in

src/types/handler.ts:53


SernOptionsData

Ƭ SernOptionsData<U>: U extends ApplicationCommandSubCommandData ? SernSubCommandData : U extends ApplicationCommandSubGroupData ? SernSubCommandGroupData : BaseOptions

Type parameters

NameType
Uextends ApplicationCommandOptionData = ApplicationCommandOptionData

Defined in

src/handler/structures/module.ts:205


SernSubCommandData

Ƭ SernSubCommandData: Override<Omit<BaseApplicationCommandOptionsData, "required">, { options?: BaseOptions[] ; type: ApplicationCommandOptionType.Subcommand }>

Defined in

src/handler/structures/module.ts:189


SernSubCommandGroupData

Ƭ SernSubCommandGroupData: Override<Omit<BaseApplicationCommandOptionsData, "required">, { options?: SernSubCommandData[] ; type: ApplicationCommandOptionType.SubcommandGroup }>

Defined in

src/handler/structures/module.ts:197


SlashCommand

Ƭ SlashCommand: Override<BaseModule, { execute: (ctx: Context, args: ["slash", SlashOptions]) => Awaitable<void | unknown> ; onEvent: EventPlugin<Slash>[] ; options?: SernOptionsData[] ; plugins: CommandPlugin[] ; type: Slash }>

Defined in

src/handler/structures/module.ts:44


SlashOptions

Ƭ SlashOptions: Omit<CommandInteractionOptionResolver, "getMessage" | "getFocused">

Defined in

src/types/handler.ts:13


SpreadParams

Ƭ SpreadParams<T>: (args: Parameters<T>[number]) => unknown

Type parameters

NameType
Textends (...args: never) => unknown

Type declaration

▸ (args): unknown

Turns a function with a union of array of args into a single union [ T , V , B ] | [ A ] => T | V | B | A

Parameters
NameType
argsParameters<T>[number]
Returns

unknown

Defined in

src/types/handler.ts:39


TextCommand

Ƭ TextCommand: Override<BaseModule, { alias?: string[] ; execute: (ctx: Context, args: ["text", string[]]) => Awaitable<void | unknown> ; onEvent: EventPlugin<Text>[] ; plugins: CommandPlugin[] ; type: Text }>

Defined in

src/handler/structures/module.ts:33

Functions

commandModule

commandModule(mod): CommandModule

The wrapper function to define command modules for sern

Parameters

NameType
modInputCommandModule

Returns

CommandModule

Defined in

src/handler/sern.ts:86


eventModule

eventModule(mod): EventModule

The wrapper function to define event modules for sern

Parameters

NameType
modInputEventModule

Returns

EventModule

Defined in

src/handler/sern.ts:107

- + \ No newline at end of file diff --git a/tr/docs/api/namespaces/Sern.html b/tr/docs/api/namespaces/Sern.html index 899dd3434..f89511946 100644 --- a/tr/docs/api/namespaces/Sern.html +++ b/tr/docs/api/namespaces/Sern.html @@ -5,13 +5,13 @@ Namespace: Sern | sern - Handlers. Redefined. - +

Namespace: Sern

References

commandModule

Re-exports commandModule


eventModule

Re-exports eventModule

Variables

controller

Const controller: Object

The object passed into every plugin to control a command's behavior

Type declaration

NameType
next() => OkImpl<void>
stop() => ErrImpl<void>

Defined in

src/handler/sern.ts:77

Functions

addExternal

addExternal<T>(emitter): void

Example

src/index.ts
//Add this before initiating Sern!
Sern.addExternal(new Level())

Example

events/level.ts
 export default eventModule({
emitter: 'Level',
type : EventType.External,
name: 'error',
execute(args) {
console.log(args)
}
})

Type parameters

NameType
Textends __module

Parameters

NameTypeDescription
emitterTAny external event emitter. The object will be stored in a map, and then fetched by the name of the instance's class. As there are infinite possibilities to adding external event emitters, Most types aren't provided and are as narrow as possibly can.

Returns

void

Defined in

src/handler/sern.ts:67


init

init(wrapper): void

Example

src/index.ts
Sern.init({
client,
defaultPrefix: '!',
commands: 'dist/commands',
})

Parameters

NameTypeDescription
wrapperWrapperOptions to pass into sern. Function to start the handler up

Returns

void

Defined in

src/handler/sern.ts:34

- + \ No newline at end of file diff --git a/tr/docs/guide.html b/tr/docs/guide.html index 8db9154a5..12ee5f17f 100644 --- a/tr/docs/guide.html +++ b/tr/docs/guide.html @@ -5,13 +5,13 @@ Introduction | sern - Handlers. Redefined. - +

Introduction

Welcome to our official guide. This guide will go through all the core features of the framework.

  • 💖 Thank you for choosing sern to be your framework!

  • Teaching the discord.js library and / or Javascript / Typescript is out of scope of this project, so the documentation assumes you already know these elements.

  • discord.js v14 is the only supported library at the moment

You will learn

Working with plugins

Events

Good to know

- + \ No newline at end of file diff --git a/tr/docs/guide/getting-started/choose-ide.html b/tr/docs/guide/getting-started/choose-ide.html index a56e857f0..42a38d332 100644 --- a/tr/docs/guide/getting-started/choose-ide.html +++ b/tr/docs/guide/getting-started/choose-ide.html @@ -5,14 +5,14 @@ Choosing an IDE | sern - Handlers. Redefined. - +
- + \ No newline at end of file diff --git a/tr/docs/guide/getting-started/preparing.html b/tr/docs/guide/getting-started/preparing.html index febf09000..ac6538bbe 100644 --- a/tr/docs/guide/getting-started/preparing.html +++ b/tr/docs/guide/getting-started/preparing.html @@ -5,13 +5,13 @@ Preparing to Code | sern - Handlers. Redefined. - +

Preparing to Code

After installing and IDE you need to install node.

You can download the LTS version of node right here

- + \ No newline at end of file diff --git a/tr/docs/guide/walkthrough/cli.html b/tr/docs/guide/walkthrough/cli.html index 876e77175..158f97a81 100644 --- a/tr/docs/guide/walkthrough/cli.html +++ b/tr/docs/guide/walkthrough/cli.html @@ -5,7 +5,7 @@ CLI | sern - Handlers. Redefined. - + @@ -13,7 +13,7 @@

CLI

Setting up the CLI is easy.

  • To start a brand-new project, run :
sern init (-y)
tip

It creates a directory for you so you don't need to!

Include the -y flag if you want to set up defaults. The default langauge is Typescript

sern plugins
info

Make sure to have a correct sern.config.json

This will display a menu selection of all installable plugins.
Note: You must have a sern.config.json to use this command. If you want to view plugins, visit the repository linked above.

  • To install extra utilities into your project
sern extra
- + \ No newline at end of file diff --git a/tr/docs/guide/walkthrough/conclusion.html b/tr/docs/guide/walkthrough/conclusion.html index 5d97a50e8..3af1106e4 100644 --- a/tr/docs/guide/walkthrough/conclusion.html +++ b/tr/docs/guide/walkthrough/conclusion.html @@ -5,7 +5,7 @@ Conclusion | sern - Handlers. Redefined. - + @@ -13,7 +13,7 @@

Conclusion

If you reached this far, thank you for reading! We hope you have learned the necessities you need to create a bot with the sern framework. If you have any other questions, bugs, feature requests, concerns, please join our community server, and we'll be glad to answer your questions.

- + \ No newline at end of file diff --git a/tr/docs/guide/walkthrough/first-command.html b/tr/docs/guide/walkthrough/first-command.html index 623872b19..80c0eef76 100644 --- a/tr/docs/guide/walkthrough/first-command.html +++ b/tr/docs/guide/walkthrough/first-command.html @@ -5,7 +5,7 @@ First Command | sern - Handlers. Redefined. - + @@ -14,7 +14,7 @@ If you installed a new project via the cli, This is the ping command located in src/commands folder.

Typescript

import { commandModule, CommandType } from '@sern/handler';

export default commandModule({
type: CommandType.Both,
plugins: [],
description: 'A ping command',
//alias : [],
execute: async (ctx, args) => {
await ctx.reply({ content: 'Pong 🏓' });
},
});

Javascript

const { CommandType, commandModule } = require('@sern/handler');

exports.default = commandModule({
type: CommandType.Both,
plugins: [],
description: 'A ping command',
//alias : [],
execute: async (ctx, args) => {
await ctx.reply('Pong 🏓');
},
})

To view what each of these properties mean in depth, visit the official documentation.

Types of command modules

Every command module type is part of an enum. This field allows type inference for the rest of a module's fields.
All the command types can be found in the official documentation!

So, lets say you want to make a command module that listens to modals.

Note: Keep in mind you'll need to send a modal with a custom id dm-me. This example below is the response to a modal being sent.


Typescript:

import { commandModule, CommandType } from '@sern/handler';
export default commandModule({
name: 'dm-me',
type: CommandType.Modal,
async execute (modal) {
const value = modal.fields.getTextInputValue('message');
modal.client.users.fetch('182326315813306368').then( u =>
u.send(value + ` from ${modal.user}`)
);
modal.reply( { ephemeral:true, content: 'Sent' })
}
});

Javascript:

const { CommandType, commandModule } = require('@sern/handler');
exports.default = commandModule({
name: 'dm-me',
type: CommandType.Modal,
async execute (modal) {
const value = modal.fields.getTextInputValue('message');
modal.client.users.fetch('182326315813306368').then( u =>
u.send(value + ` from ${modal.user}`)
);
modal.reply( { ephemeral:true, content: 'Sent' })
}
});

Commands are straight forward. Keep in mind, every other property on the commandModule object is optional except the type and execute function.

Context class

The provided Context class helps with modules of CommandType.Both (A mixture of slash / legacy commands).

The Context class is passed into modules with type :

  • CommandType.Both
  • CommandType.Slash
  • CommandType.Text

This data structure helps interop between legacy commands and slash commands with ease.

note

View the docs

Typescript:

export default commandModule({
name: 'ping',
type: CommandType.Both,
async execute(ctx: Context) {
await ctx.reply(`pong ${ctx.user}`)
// .reply is shared between both message and interaction!
// So is an User object!
}
});

Javascript:

exports.default = commandModule({
name: 'ping',
type: CommandType.Both,
async execute(ctx) { //ctx is a Context instance
await ctx.reply(`pong ${ctx.user}`)
// .reply is shared between both message and interaction!
// So is an User object!
}
});
- + \ No newline at end of file diff --git a/tr/docs/guide/walkthrough/first-event.html b/tr/docs/guide/walkthrough/first-event.html index d2bb21467..41bc5a499 100644 --- a/tr/docs/guide/walkthrough/first-event.html +++ b/tr/docs/guide/walkthrough/first-event.html @@ -5,7 +5,7 @@ First Event Module | sern - Handlers. Redefined. - + @@ -13,7 +13,7 @@

First Event Module

We will dissect a basic event module.
Typescript:

export default eventModule({
type: EventType.Sern,
plugins : [], //NOT SUPPORTED YET!!
name: 'module.activate', //name of event.
execute(event) {
console.log(event);
}
})

Javascript:

exports.default = eventModule({
type: EventType.Sern,
plugins : [], //NOT SUPPORTED YET!!
name: 'module.activate',
execute(event) {
console.log(event);
}
})

Like command modules, the type property denotes what kind of event it is, which can be found here.

To view what each of these properties mean in depth, visit the official documentation.


Event modules are laid out similarly to command modules. These listen to any and all event you provide. In the current version 1.1.0-beta, plugins are not supported.

Another example of an event module

Typescript:

export default eventModule({
type: EventType.Discord,
plugins : [], //NOT SUPPORTED YET!!
name: 'guildMemberAdd', //name of event.
async execute(member: GuildMember) {
(await member.guild.channels.fetch('channel-id') as TextChannel).send(`Welcome, ${member}`);
}
})

Javascript:


exports.default = eventModule({
type: EventType.Discord,
plugins : [], //NOT SUPPORTED YET!!
name: 'guildMemberAdd', //name of event.
async execute(member) {
(await member.guild.channels.fetch('channel-id')).send(`Welcome, ${member}`);
}
})
- + \ No newline at end of file diff --git a/tr/docs/guide/walkthrough/goal.html b/tr/docs/guide/walkthrough/goal.html index f2ea81430..a0d08f585 100644 --- a/tr/docs/guide/walkthrough/goal.html +++ b/tr/docs/guide/walkthrough/goal.html @@ -5,7 +5,7 @@ Goal | sern - Handlers. Redefined. - + @@ -13,7 +13,7 @@

Goal

sern strives to be minimalist, but with all batteries included. Meaning, this framework provides the necessary tools to start up a bot in minutes, and leaves plenty room space to customize your experience and create an amazing project. It should include all the tools for any bot at any scale.

- + \ No newline at end of file diff --git a/tr/docs/guide/walkthrough/good-to-know.html b/tr/docs/guide/walkthrough/good-to-know.html index 88a097771..d8e6537dd 100644 --- a/tr/docs/guide/walkthrough/good-to-know.html +++ b/tr/docs/guide/walkthrough/good-to-know.html @@ -5,7 +5,7 @@ Good to know | sern - Handlers. Redefined. - + @@ -13,7 +13,7 @@

Good to know

sern.config.json

A sern.config.json, although not necessary, allows your project to communicate with our cli.

For example, when installing typescript plugins, the language property is necessary to install from our open source repository.

Using the cli and running sern init --sync on pre-existing projects should install this json file in the root directory given. Or, if this is a brand-new project, sern init automatically installs it.

{
"language": "typescript",
"paths": {
"base": "src",
"commands": "commands"
}
}
- + \ No newline at end of file diff --git a/tr/docs/guide/walkthrough/plugins.html b/tr/docs/guide/walkthrough/plugins.html index 252deee8c..ba00ecc6b 100644 --- a/tr/docs/guide/walkthrough/plugins.html +++ b/tr/docs/guide/walkthrough/plugins.html @@ -5,7 +5,7 @@ Plugins | sern - Handlers. Redefined. - + @@ -16,7 +16,7 @@ This controls whether a module is stored into sern.
Typescript:

export function inDir(dir : string) : CommandPlugin<CommandType.Both> {
return {
type: PluginType.Command,
async execute(wrapper, { absPath, module }, controller) {
if(path.dirname(absPath) !== dir) {
console.log(+new Date(), `${module.name} is not in the correct directory!`);
return controller.stop()
}
console.log(+new Date(), `${module.name} is in the correct directory!`);
return controller.next(); //continue
}
}
}

Javascript:

export function inDir(dir : string) {
return {
type: PluginType.Command,
async execute(wrapper, { absPath, module }, controller) {
if(path.dirname(absPath) !== dir) {
console.log(+new Date(), `${module.name} is not in the correct directory!`);
return controller.stop()
}
console.log(+new Date(), `${module.name} is in the correct directory!`);
return controller.next(); //continue
}
}
}

Above, this simple plugin logs that the module has been loaded along with a timestamp.
Again, it is up to you to define plugin logic! The possibilities to customize your bots are endless.

tip

Command Plugins are good for ensuring the shape, location, and preprocessing of your commands.

Event Plugins

event-plugins

  • An event is emitted by discord.js.
  • This event is passed to all plugins (in order!!),
  • If all are successful,

The command is executed. Calling controller.stop() notifies sern that this command should not be run, and this event is ignored.

So, what does a command module look like with plugins?

Typescript:

import { commandModule, CommandType } from '@sern/handler';

export default commandModule({
type: CommandType.Both,
plugins: [
inDir("other"),
serenOnly()
],
description: 'A ping command',
//alias : [],
execute: async (ctx, args) => {
await ctx.reply({ content: 'Pong 🏓' });
},
});

Javascript:

const { commandModule, CommandType } = require('@sern/handler');

exports.default = commandModule({
type: CommandType.Both,
plugins: [
inDir("other"),
serenOnly() //The plugins in this section applied to this module!
],
description: 'A ping command',
//alias : [],
execute: async (ctx, args) => {
await ctx.reply({ content: 'Pong 🏓' });
},
});

Can you predict the behavior of this command?

  • Before loading into sern, this command module will check if this module is in the correct directory other.
  • Before an event occurs, this command module will check if the user has the id 182326315813306368.
tip

Event Plugins are good for filtering, preconditions, parsing.

If all plugins return controller.next(), this command replies Pong 🏓

- + \ No newline at end of file diff --git a/tr/docs/guide/walkthrough/sern-emitter.html b/tr/docs/guide/walkthrough/sern-emitter.html index 03f5c0d37..01fe3e8b4 100644 --- a/tr/docs/guide/walkthrough/sern-emitter.html +++ b/tr/docs/guide/walkthrough/sern-emitter.html @@ -5,13 +5,13 @@ The SernEmitter class | sern - Handlers. Redefined. - +

The SernEmitter class

You're shipped with the SernEmitter. This EventEmitter listens to

  • command modules executing and its status, the module.activate event
  • command modules registered and its status, the module.register event
  • any error that occurs, the error event
  • warn events, where it is possible to throw errors

You can put these and other event listeners into event modules!


View all events
- + \ No newline at end of file diff --git a/tr/docs/intro.html b/tr/docs/intro.html index 327bdd2db..ec436d8fd 100644 --- a/tr/docs/intro.html +++ b/tr/docs/intro.html @@ -5,13 +5,13 @@ Welcome! | sern - Handlers. Redefined. - +

Welcome!

Content

  • /docs/api contains autogenerated documentation of our codebase using typedoc
  • /docs/guide contains a basic startup guide and details to get started with sern faster!
tip

This site is open source! Please do contribute if you find any bugs, typos, or sections in need of improvements.

tip

If you have problems, join the discord server here

- + \ No newline at end of file diff --git a/tr/index.html b/tr/index.html index 7aa1b5999..d7429d790 100644 --- a/tr/index.html +++ b/tr/index.html @@ -5,13 +5,13 @@ sern - Handlers. Redefined. | sern - Handlers. Redefined. - +
-

Handlers. Redefined.

With the support of the community made plugins and powerful a CLI, it's more than just a handler.

sern init
logo

Batteries included

Start or integrate a new project in minutes.

Customizable

Extend or customize with community-based plugins to provide utilities, filters, and more.

Modern

Uses modern and powerful tooling such as swc, tsup, typescript, and rxjs to future-proof and ensure project quality.

- +

Handlers. Redefined.

With the support of the community made plugins and powerful a CLI, it's more than just a handler.

sern init
logo

Batteries included

Start or integrate a new project in minutes.

Customizable

Extend or customize with community-based plugins to provide utilities, filters, and more.

Modern

Uses modern and powerful tooling such as swc, tsup, typescript, and rxjs to future-proof and ensure project quality.

+ \ No newline at end of file diff --git a/tr/markdown-page.html b/tr/markdown-page.html index 6d5e8b4bb..b10205b19 100644 --- a/tr/markdown-page.html +++ b/tr/markdown-page.html @@ -5,13 +5,13 @@ Markdown page example | sern - Handlers. Redefined. - +

Markdown page example

You don't need React to write simple standalone pages.

- + \ No newline at end of file diff --git a/tr/plugins.html b/tr/plugins.html index 02123ef9b..095ae4842 100644 --- a/tr/plugins.html +++ b/tr/plugins.html @@ -5,13 +5,13 @@ sern - Handlers. Redefined. - +

Coming soon

- + \ No newline at end of file