diff --git a/404.html b/404.html index 5cb97ad7e..d48b18fcf 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/5e8c322a.42a28d05.js b/assets/js/5e8c322a.42a28d05.js deleted file mode 100644 index ed1b1503a..000000000 --- a/assets/js/5e8c322a.42a28d05.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_sern_website=self.webpackChunk_sern_website||[]).push([[597],{3905:(e,n,t)=>{t.d(n,{Zo:()=>c,kt:()=>m});var r=t(7294);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function l(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var s=r.createContext({}),p=function(e){var n=r.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):l(l({},n),e)),t},c=function(e){var n=p(e.components);return r.createElement(s.Provider,{value:n},e.children)},d={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},u=r.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,c=o(e,["components","mdxType","originalType","parentName"]),u=p(t),m=a,h=u["".concat(s,".").concat(m)]||u[m]||d[m]||i;return t?r.createElement(h,l(l({ref:n},c),{},{components:t})):r.createElement(h,l({ref:n},c))}));function m(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,l=new Array(i);l[0]=u;var o={};for(var s in n)hasOwnProperty.call(n,s)&&(o[s]=n[s]);o.originalType=e,o.mdxType="string"==typeof e?e:a,l[1]=o;for(var p=2;p{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>l,default:()=>d,frontMatter:()=>i,metadata:()=>o,toc:()=>p});var r=t(7462),a=(t(7294),t(3905));const i={id:"index",title:"@sern/handler",sidebar_label:"Readme",sidebar_position:0,custom_edit_url:null},l="SernHandler",o={unversionedId:"api/index",id:"api/index",title:"@sern/handler",description:"License: MIT",source:"@site/docs/api/index.md",sourceDirName:"api",slug:"/api/",permalink:"/docs/api/",draft:!1,editUrl:null,tags:[],version:"current",sidebarPosition:0,frontMatter:{id:"index",title:"@sern/handler",sidebar_label:"Readme",sidebar_position:0,custom_edit_url:null},sidebar:"tutorialSidebar",next:{title:"Exports",permalink:"/docs/api/modules"}},s={},p=[{value:"Installation",id:"installation",level:2},{value:"Basic Usage",id:"basic-usage",level:2},{value:" index.js (CommonJS)",id:"-indexjs-commonjs",level:4},{value:" ping.js (CommonJS)",id:"-pingjs-commonjs",level:4},{value:"CLI",id:"cli",level:2},{value:"Links",id:"links",level:2},{value:"Contribute",id:"contribute",level:2},{value:"Roadmap",id:"roadmap",level:2}],c={toc:p};function d(e){let{components:n,...t}=e;return(0,a.kt)("wrapper",(0,r.Z)({},c,t,{components:n,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"sernhandler"},"SernHandler"),(0,a.kt)("a",{href:"https://www.npmjs.com/package/@sern/handler"},(0,a.kt)("img",{src:"https://img.shields.io/npm/v/@sern/handler?maxAge=3600",alt:"NPM version"})),(0,a.kt)("a",{href:"https://www.npmjs.com/package/@sern/handler"},(0,a.kt)("img",{src:"https://img.shields.io/npm/dt/@sern/handler?maxAge=3600",alt:"NPM downloads"})),"[![License: MIT](https://img.shields.io/badge/License-MIT-blavk.svg)](https://opensource.org/licenses/MIT)",(0,a.kt)("p",null,"A customizable, batteries-included, powerful discord.js framework to automate and streamline your bot development."),(0,a.kt)("h2",{id:"installation"},"Installation"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"npm install @sern/handler\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"yarn add @sern/handler\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"pnpm add @sern/handler\n")),(0,a.kt)("h2",{id:"basic-usage"},"Basic Usage"),(0,a.kt)("h4",{id:"-indexjs-commonjs"},(0,a.kt)("inlineCode",{parentName:"h4"}," index.js (CommonJS)")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-js"},"const { Client, GatewayIntentBits } = require('discord.js');\nconst { Sern } = require('@sern/handler');\nconst { defaultPrefix, token } = require('./config.json');\n\nconst client = new Client({\n intents: [\n GatewayIntentBits.Guilds,\n GatewayIntentBits.GuildMembers,\n GatewayIntentBits.GuildMessages\n ]\n});\n\nSern.init({\n client, \n defaultPrefix, \n commands : 'src/commands',\n});\n\nclient.login(token);\n")),(0,a.kt)("h4",{id:"-pingjs-commonjs"},(0,a.kt)("inlineCode",{parentName:"h4"}," ping.js (CommonJS)")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-js"},"const { Sern, CommandType } = require('@sern/handler');\n\nexports.default = {\n description: 'A ping pong command',\n type: CommandType.Slash,\n execute(ctx) {\n ctx.reply('pong!');\n }\n };\n")),(0,a.kt)("p",null,"See our ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/sern-handler/templates"},"templates")," for TypeScript examples and more"),(0,a.kt)("h2",{id:"cli"},"CLI"),(0,a.kt)("p",null,"It is ",(0,a.kt)("strong",{parentName:"p"},"highly encouraged")," to use the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/sern-handler/cli"},"command line interface")," for your project. Don't forget to view it."),(0,a.kt)("h2",{id:"links"},"Links"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://sern-handler.js.org"},"Official Documentation")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://discord.com/invite/mmyCTnYtbF"},"Support Server"))),(0,a.kt)("h2",{id:"contribute"},"Contribute"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Read our contribution ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/sern-handler/handler"},"guidelines")," carefully"),(0,a.kt)("li",{parentName:"ul"},"Pull up on ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/sern-handler/handler/issues"},"issues")," and report bugs"),(0,a.kt)("li",{parentName:"ul"},"All kinds of contributions are welcomed.")),(0,a.kt)("h2",{id:"roadmap"},"Roadmap"),(0,a.kt)("p",null,"You can check our ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/sern-handler/roadmap"},"roadmap")," to see what's going to be added or patched in the future."))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/5e8c322a.9b66306d.js b/assets/js/5e8c322a.9b66306d.js new file mode 100644 index 000000000..b713c996c --- /dev/null +++ b/assets/js/5e8c322a.9b66306d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_sern_website=self.webpackChunk_sern_website||[]).push([[597],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>m});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),p=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},d=function(e){var t=p(e.components);return r.createElement(s.Provider,{value:t},e.children)},c={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},u=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,d=o(e,["components","mdxType","originalType","parentName"]),u=p(n),m=a,h=u["".concat(s,".").concat(m)]||u[m]||c[m]||i;return n?r.createElement(h,l(l({ref:t},d),{},{components:n})):r.createElement(h,l({ref:t},d))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,l=new Array(i);l[0]=u;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o.mdxType="string"==typeof e?e:a,l[1]=o;for(var p=2;p{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>c,frontMatter:()=>i,metadata:()=>o,toc:()=>p});var r=n(7462),a=(n(7294),n(3905));const i={id:"index",title:"@sern/handler",sidebar_label:"Readme",sidebar_position:0,custom_edit_url:null},l="SernHandler",o={unversionedId:"api/index",id:"api/index",title:"@sern/handler",description:"A customizable, batteries-included, powerful discord.js framework to automate and streamline your bot development.",source:"@site/docs/api/index.md",sourceDirName:"api",slug:"/api/",permalink:"/docs/api/",draft:!1,editUrl:null,tags:[],version:"current",sidebarPosition:0,frontMatter:{id:"index",title:"@sern/handler",sidebar_label:"Readme",sidebar_position:0,custom_edit_url:null},sidebar:"tutorialSidebar",next:{title:"Exports",permalink:"/docs/api/modules"}},s={},p=[{value:"Installation",id:"installation",level:2},{value:"Basic Usage",id:"basic-usage",level:2},{value:" index.js (CommonJS)",id:"-indexjs-commonjs",level:4},{value:" ping.js (CommonJS)",id:"-pingjs-commonjs",level:4},{value:"CLI",id:"cli",level:2},{value:"Links",id:"links",level:2},{value:"Contribute",id:"contribute",level:2},{value:"Roadmap",id:"roadmap",level:2}],d={toc:p};function c(e){let{components:t,...n}=e;return(0,a.kt)("wrapper",(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"sernhandler"},"SernHandler"),(0,a.kt)("a",{href:"https://www.npmjs.com/package/@sern/handler"},(0,a.kt)("img",{src:"https://img.shields.io/npm/v/@sern/handler?maxAge=3600",alt:"NPM version"})),(0,a.kt)("a",{href:"https://www.npmjs.com/package/@sern/handler"},(0,a.kt)("img",{src:"https://img.shields.io/npm/dt/@sern/handler?maxAge=3600",alt:"NPM downloads"})),(0,a.kt)("a",{href:"https://opensource.org/licenses/MIT"},(0,a.kt)("img",{src:"https://img.shields.io/badge/License-MIT-blavk.svg",alt:"MIT License"})),(0,a.kt)("p",null,"A customizable, batteries-included, powerful discord.js framework to automate and streamline your bot development."),(0,a.kt)("h2",{id:"installation"},"Installation"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"npm install @sern/handler\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"yarn add @sern/handler\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"pnpm add @sern/handler\n")),(0,a.kt)("h2",{id:"basic-usage"},"Basic Usage"),(0,a.kt)("h4",{id:"-indexjs-commonjs"},(0,a.kt)("inlineCode",{parentName:"h4"}," index.js (CommonJS)")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-js"},"const { Client, GatewayIntentBits } = require('discord.js');\nconst { Sern } = require('@sern/handler');\nconst { defaultPrefix, token } = require('./config.json');\n\nconst client = new Client({\n intents: [\n GatewayIntentBits.Guilds,\n GatewayIntentBits.GuildMembers,\n GatewayIntentBits.GuildMessages\n ]\n});\n\nSern.init({\n client, \n defaultPrefix, \n commands : 'src/commands',\n});\n\nclient.login(token);\n")),(0,a.kt)("h4",{id:"-pingjs-commonjs"},(0,a.kt)("inlineCode",{parentName:"h4"}," ping.js (CommonJS)")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-js"},"const { Sern, CommandType } = require('@sern/handler');\n\nexports.default = {\n description: 'A ping pong command',\n type: CommandType.Slash,\n execute(ctx) {\n ctx.reply('pong!');\n }\n };\n")),(0,a.kt)("p",null,"See our ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/sern-handler/templates"},"templates")," for TypeScript examples and more"),(0,a.kt)("h2",{id:"cli"},"CLI"),(0,a.kt)("p",null,"It is ",(0,a.kt)("strong",{parentName:"p"},"highly encouraged")," to use the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/sern-handler/cli"},"command line interface")," for your project. Don't forget to view it."),(0,a.kt)("h2",{id:"links"},"Links"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://sern-handler.js.org"},"Official Documentation")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://discord.com/invite/mmyCTnYtbF"},"Support Server"))),(0,a.kt)("h2",{id:"contribute"},"Contribute"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Read our contribution ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/sern-handler/handler"},"guidelines")," carefully"),(0,a.kt)("li",{parentName:"ul"},"Pull up on ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/sern-handler/handler/issues"},"issues")," and report bugs"),(0,a.kt)("li",{parentName:"ul"},"All kinds of contributions are welcomed.")),(0,a.kt)("h2",{id:"roadmap"},"Roadmap"),(0,a.kt)("p",null,"You can check our ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/sern-handler/roadmap"},"roadmap")," to see what's going to be added or patched in the future."))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/935f2afb.723ea298.js b/assets/js/935f2afb.6efe90b2.js similarity index 58% rename from assets/js/935f2afb.723ea298.js rename to assets/js/935f2afb.6efe90b2.js index fe0bab0e8..3160b6083 100644 --- a/assets/js/935f2afb.723ea298.js +++ b/assets/js/935f2afb.6efe90b2.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_sern_website=self.webpackChunk_sern_website||[]).push([[197],{1109:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"category","label":"API","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Exports","href":"/docs/api/modules","docId":"api/modules"},{"type":"category","label":"Namespaces","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Sern","href":"/docs/api/namespaces/Sern","docId":"api/namespaces/Sern"}]},{"type":"category","label":"Enumerations","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"CommandType","href":"/docs/api/enums/CommandType","docId":"api/enums/CommandType"},{"type":"link","label":"EventType","href":"/docs/api/enums/EventType","docId":"api/enums/EventType"},{"type":"link","label":"PayloadType","href":"/docs/api/enums/PayloadType","docId":"api/enums/PayloadType"},{"type":"link","label":"PluginType","href":"/docs/api/enums/PluginType","docId":"api/enums/PluginType"}]},{"type":"category","label":"Classes","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Context","href":"/docs/api/classes/Context","docId":"api/classes/Context"},{"type":"link","label":"SernEmitter","href":"/docs/api/classes/SernEmitter","docId":"api/classes/SernEmitter"}]},{"type":"category","label":"Interfaces","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Controller","href":"/docs/api/interfaces/Controller","docId":"api/interfaces/Controller"},{"type":"link","label":"Wrapper","href":"/docs/api/interfaces/Wrapper","docId":"api/interfaces/Wrapper"}]}],"href":"/docs/api/"},{"type":"link","label":"Welcome!","href":"/docs/intro","docId":"intro"},{"type":"category","label":"Introduction","collapsible":true,"collapsed":true,"items":[{"type":"category","label":"getting-started","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Choosing an IDE","href":"/docs/guide/getting-started/choose-ide","docId":"guide/getting-started/choose-ide"},{"type":"link","label":"Preparing to Code","href":"/docs/guide/getting-started/preparing","docId":"guide/getting-started/preparing"}]},{"type":"category","label":"walkthrough","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Goal","href":"/docs/guide/walkthrough/goal","docId":"guide/walkthrough/goal"},{"type":"link","label":"CLI","href":"/docs/guide/walkthrough/cli","docId":"guide/walkthrough/cli"},{"type":"link","label":"First Command","href":"/docs/guide/walkthrough/first-command","docId":"guide/walkthrough/first-command"},{"type":"link","label":"First Event Module","href":"/docs/guide/walkthrough/first-event","docId":"guide/walkthrough/first-event"},{"type":"link","label":"Plugins","href":"/docs/guide/walkthrough/plugins","docId":"guide/walkthrough/plugins"},{"type":"link","label":"The SernEmitter class","href":"/docs/guide/walkthrough/sern-emitter","docId":"guide/walkthrough/sern-emitter"},{"type":"link","label":"Good to know","href":"/docs/guide/walkthrough/good-to-know","docId":"guide/walkthrough/good-to-know"},{"type":"link","label":"Conclusion","href":"/docs/guide/walkthrough/conclusion","docId":"guide/walkthrough/conclusion"}]}],"href":"/docs/guide/"}]},"docs":{"api/classes/Context":{"id":"api/classes/Context","title":"Class: Context","description":"Provides values shared between","sidebar":"tutorialSidebar"},"api/classes/SernEmitter":{"id":"api/classes/SernEmitter","title":"Class: SernEmitter","description":"Hierarchy","sidebar":"tutorialSidebar"},"api/enums/CommandType":{"id":"api/enums/CommandType","title":"Enumeration: CommandType","description":"Example","sidebar":"tutorialSidebar"},"api/enums/EventType":{"id":"api/enums/EventType","title":"Enumeration: EventType","description":"Example","sidebar":"tutorialSidebar"},"api/enums/PayloadType":{"id":"api/enums/PayloadType","title":"Enumeration: PayloadType","description":"Enumeration Members","sidebar":"tutorialSidebar"},"api/enums/PluginType":{"id":"api/enums/PluginType","title":"Enumeration: PluginType","description":"Example","sidebar":"tutorialSidebar"},"api/index":{"id":"api/index","title":"@sern/handler","description":"License: MIT","sidebar":"tutorialSidebar"},"api/interfaces/Controller":{"id":"api/interfaces/Controller","title":"Interface: Controller","description":"Properties","sidebar":"tutorialSidebar"},"api/interfaces/Wrapper":{"id":"api/interfaces/Wrapper","title":"Interface: Wrapper","description":"An object to be passed into Sern#init() function.","sidebar":"tutorialSidebar"},"api/modules":{"id":"api/modules","title":"@sern/handler","description":"Namespaces","sidebar":"tutorialSidebar"},"api/namespaces/Sern":{"id":"api/namespaces/Sern","title":"Namespace: Sern","description":"References","sidebar":"tutorialSidebar"},"guide/getting-started/choose-ide":{"id":"guide/getting-started/choose-ide","title":"Choosing an IDE","description":"Choosing an IDE is a matter of personal preference. The following are some","sidebar":"tutorialSidebar"},"guide/getting-started/preparing":{"id":"guide/getting-started/preparing","title":"Preparing to Code","description":"After installing and IDE you need to install node.","sidebar":"tutorialSidebar"},"guide/README":{"id":"guide/README","title":"Introduction","description":"Welcome to our official guide. This guide will go through all the core features of the framework.","sidebar":"tutorialSidebar"},"guide/walkthrough/cli":{"id":"guide/walkthrough/cli","title":"CLI","description":"Setting up the CLI is easy.","sidebar":"tutorialSidebar"},"guide/walkthrough/conclusion":{"id":"guide/walkthrough/conclusion","title":"Conclusion","description":"If you reached this far, thank you for reading! We hope you have learned the necessities you need","sidebar":"tutorialSidebar"},"guide/walkthrough/first-command":{"id":"guide/walkthrough/first-command","title":"First Command","description":"We will dissect a basic command.","sidebar":"tutorialSidebar"},"guide/walkthrough/first-event":{"id":"guide/walkthrough/first-event","title":"First Event Module","description":"We will dissect a basic event module.","sidebar":"tutorialSidebar"},"guide/walkthrough/goal":{"id":"guide/walkthrough/goal","title":"Goal","description":"sern strives to be minimalist, but with all batteries included. Meaning, this framework provides the necessary tools","sidebar":"tutorialSidebar"},"guide/walkthrough/good-to-know":{"id":"guide/walkthrough/good-to-know","title":"Good to know","description":"sern.config.json","sidebar":"tutorialSidebar"},"guide/walkthrough/plugins":{"id":"guide/walkthrough/plugins","title":"Plugins","description":"As of now, modules seem a little underwhelming. It appears that sern doesn\'t have all the features of a standard handler,","sidebar":"tutorialSidebar"},"guide/walkthrough/sern-emitter":{"id":"guide/walkthrough/sern-emitter","title":"The SernEmitter class","description":"You\'re shipped with the SernEmitter. This EventEmitter listens to","sidebar":"tutorialSidebar"},"intro":{"id":"intro","title":"Welcome!","description":"Content","sidebar":"tutorialSidebar"}}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunk_sern_website=self.webpackChunk_sern_website||[]).push([[197],{1109:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"category","label":"API","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Exports","href":"/docs/api/modules","docId":"api/modules"},{"type":"category","label":"Namespaces","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Sern","href":"/docs/api/namespaces/Sern","docId":"api/namespaces/Sern"}]},{"type":"category","label":"Enumerations","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"CommandType","href":"/docs/api/enums/CommandType","docId":"api/enums/CommandType"},{"type":"link","label":"EventType","href":"/docs/api/enums/EventType","docId":"api/enums/EventType"},{"type":"link","label":"PayloadType","href":"/docs/api/enums/PayloadType","docId":"api/enums/PayloadType"},{"type":"link","label":"PluginType","href":"/docs/api/enums/PluginType","docId":"api/enums/PluginType"}]},{"type":"category","label":"Classes","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Context","href":"/docs/api/classes/Context","docId":"api/classes/Context"},{"type":"link","label":"SernEmitter","href":"/docs/api/classes/SernEmitter","docId":"api/classes/SernEmitter"}]},{"type":"category","label":"Interfaces","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Controller","href":"/docs/api/interfaces/Controller","docId":"api/interfaces/Controller"},{"type":"link","label":"Wrapper","href":"/docs/api/interfaces/Wrapper","docId":"api/interfaces/Wrapper"}]}],"href":"/docs/api/"},{"type":"link","label":"Welcome!","href":"/docs/intro","docId":"intro"},{"type":"category","label":"Introduction","collapsible":true,"collapsed":true,"items":[{"type":"category","label":"getting-started","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Choosing an IDE","href":"/docs/guide/getting-started/choose-ide","docId":"guide/getting-started/choose-ide"},{"type":"link","label":"Preparing to Code","href":"/docs/guide/getting-started/preparing","docId":"guide/getting-started/preparing"}]},{"type":"category","label":"walkthrough","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Goal","href":"/docs/guide/walkthrough/goal","docId":"guide/walkthrough/goal"},{"type":"link","label":"CLI","href":"/docs/guide/walkthrough/cli","docId":"guide/walkthrough/cli"},{"type":"link","label":"First Command","href":"/docs/guide/walkthrough/first-command","docId":"guide/walkthrough/first-command"},{"type":"link","label":"First Event Module","href":"/docs/guide/walkthrough/first-event","docId":"guide/walkthrough/first-event"},{"type":"link","label":"Plugins","href":"/docs/guide/walkthrough/plugins","docId":"guide/walkthrough/plugins"},{"type":"link","label":"The SernEmitter class","href":"/docs/guide/walkthrough/sern-emitter","docId":"guide/walkthrough/sern-emitter"},{"type":"link","label":"Good to know","href":"/docs/guide/walkthrough/good-to-know","docId":"guide/walkthrough/good-to-know"},{"type":"link","label":"Conclusion","href":"/docs/guide/walkthrough/conclusion","docId":"guide/walkthrough/conclusion"}]}],"href":"/docs/guide/"}]},"docs":{"api/classes/Context":{"id":"api/classes/Context","title":"Class: Context","description":"Provides values shared between","sidebar":"tutorialSidebar"},"api/classes/SernEmitter":{"id":"api/classes/SernEmitter","title":"Class: SernEmitter","description":"Hierarchy","sidebar":"tutorialSidebar"},"api/enums/CommandType":{"id":"api/enums/CommandType","title":"Enumeration: CommandType","description":"Example","sidebar":"tutorialSidebar"},"api/enums/EventType":{"id":"api/enums/EventType","title":"Enumeration: EventType","description":"Example","sidebar":"tutorialSidebar"},"api/enums/PayloadType":{"id":"api/enums/PayloadType","title":"Enumeration: PayloadType","description":"Enumeration Members","sidebar":"tutorialSidebar"},"api/enums/PluginType":{"id":"api/enums/PluginType","title":"Enumeration: PluginType","description":"Example","sidebar":"tutorialSidebar"},"api/index":{"id":"api/index","title":"@sern/handler","description":"A customizable, batteries-included, powerful discord.js framework to automate and streamline your bot development.","sidebar":"tutorialSidebar"},"api/interfaces/Controller":{"id":"api/interfaces/Controller","title":"Interface: Controller","description":"Properties","sidebar":"tutorialSidebar"},"api/interfaces/Wrapper":{"id":"api/interfaces/Wrapper","title":"Interface: Wrapper","description":"An object to be passed into Sern#init() function.","sidebar":"tutorialSidebar"},"api/modules":{"id":"api/modules","title":"@sern/handler","description":"Namespaces","sidebar":"tutorialSidebar"},"api/namespaces/Sern":{"id":"api/namespaces/Sern","title":"Namespace: Sern","description":"References","sidebar":"tutorialSidebar"},"guide/getting-started/choose-ide":{"id":"guide/getting-started/choose-ide","title":"Choosing an IDE","description":"Choosing an IDE is a matter of personal preference. The following are some","sidebar":"tutorialSidebar"},"guide/getting-started/preparing":{"id":"guide/getting-started/preparing","title":"Preparing to Code","description":"After installing and IDE you need to install node.","sidebar":"tutorialSidebar"},"guide/README":{"id":"guide/README","title":"Introduction","description":"Welcome to our official guide. This guide will go through all the core features of the framework.","sidebar":"tutorialSidebar"},"guide/walkthrough/cli":{"id":"guide/walkthrough/cli","title":"CLI","description":"Setting up the CLI is easy.","sidebar":"tutorialSidebar"},"guide/walkthrough/conclusion":{"id":"guide/walkthrough/conclusion","title":"Conclusion","description":"If you reached this far, thank you for reading! We hope you have learned the necessities you need","sidebar":"tutorialSidebar"},"guide/walkthrough/first-command":{"id":"guide/walkthrough/first-command","title":"First Command","description":"We will dissect a basic command.","sidebar":"tutorialSidebar"},"guide/walkthrough/first-event":{"id":"guide/walkthrough/first-event","title":"First Event Module","description":"We will dissect a basic event module.","sidebar":"tutorialSidebar"},"guide/walkthrough/goal":{"id":"guide/walkthrough/goal","title":"Goal","description":"sern strives to be minimalist, but with all batteries included. Meaning, this framework provides the necessary tools","sidebar":"tutorialSidebar"},"guide/walkthrough/good-to-know":{"id":"guide/walkthrough/good-to-know","title":"Good to know","description":"sern.config.json","sidebar":"tutorialSidebar"},"guide/walkthrough/plugins":{"id":"guide/walkthrough/plugins","title":"Plugins","description":"As of now, modules seem a little underwhelming. It appears that sern doesn\'t have all the features of a standard handler,","sidebar":"tutorialSidebar"},"guide/walkthrough/sern-emitter":{"id":"guide/walkthrough/sern-emitter","title":"The SernEmitter class","description":"You\'re shipped with the SernEmitter. This EventEmitter listens to","sidebar":"tutorialSidebar"},"intro":{"id":"intro","title":"Welcome!","description":"Content","sidebar":"tutorialSidebar"}}}')}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.ec733bf3.js b/assets/js/runtime~main.2dd83211.js similarity index 58% rename from assets/js/runtime~main.ec733bf3.js rename to assets/js/runtime~main.2dd83211.js index a6504d61d..e950f3292 100644 --- a/assets/js/runtime~main.ec733bf3.js +++ b/assets/js/runtime~main.2dd83211.js @@ -1 +1 @@ -(()=>{"use strict";var e,t,r,a,f,o={},c={};function n(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={id:e,loaded:!1,exports:{}};return o[e].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}n.m=o,n.c=c,e=[],n.O=(t,r,a,f)=>{if(!r){var o=1/0;for(i=0;i=f)&&Object.keys(n.O).every((e=>n.O[e](r[d])))?r.splice(d--,1):(c=!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 o={};t=t||[null,r({}),r([]),r(r)];for(var c=2&a&&e;"object"==typeof c&&!~t.indexOf(c);c=r(c))Object.getOwnPropertyNames(c).forEach((t=>o[t]=()=>e[t]));return o.default=()=>e,n.d(f,o),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:"29450634",45:"efdd0a6d",53:"9cf1ed02",62:"1291f58b",85:"d7ab1744",127:"2da4208c",137:"87f8be34",146:"2189cf8e",195:"43845cd9",197:"723ea298",226:"528132fe",270:"e0f6e50e",277:"bbd90c09",306:"98ec2cc1",322:"ad0a4733",332:"261b9526",363:"642e76b9",397:"1f24705a",414:"48b8d064",429:"7176d7bf",472:"bdf11e93",503:"668d49f6",514:"f852ff9f",597:"42a28d05",640:"fea8d1f1",652:"892cfb09",671:"10a24cbf",703:"229dbd75",712:"b1834d5d",750:"e85498fd",803:"5098ec91",865:"bdc4fc2a",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,o)=>{if(a[e])a[e].push(t);else{var c,d;if(void 0!==r)for(var b=document.getElementsByTagName("script"),i=0;i{c.onerror=c.onload=null,clearTimeout(s);var f=a[e];if(delete a[e],c.parentNode&&c.parentNode.removeChild(c),f&&f.forEach((e=>e(r))),t)return t(r)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=l.bind(null,c.onerror),c.onload=l.bind(null,c.onload),d&&document.head.appendChild(c)}},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 o=n.p+n.u(t),c=new Error;n.l(o,(r=>{if(n.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var f=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;c.message="Loading chunk "+t+" failed.\n("+f+": "+o+")",c.name="ChunkLoadError",c.type=f,c.request=o,a[1](c)}}),"chunk-"+t,t)}},n.O.j=t=>0===e[t];var t=(t,r)=>{var a,f,o=r[0],c=r[1],d=r[2],b=0;if(o.some((t=>0!==e[t]))){for(a in c)n.o(c,a)&&(n.m[a]=c[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:"29450634",45:"efdd0a6d",53:"9cf1ed02",62:"1291f58b",85:"d7ab1744",127:"2da4208c",137:"87f8be34",146:"2189cf8e",195:"43845cd9",197:"6efe90b2",226:"528132fe",270:"e0f6e50e",277:"bbd90c09",306:"98ec2cc1",322:"ad0a4733",332:"261b9526",363:"642e76b9",397:"1f24705a",414:"48b8d064",429:"7176d7bf",472:"bdf11e93",503:"668d49f6",514:"f852ff9f",597:"9b66306d",640:"fea8d1f1",652:"892cfb09",671:"10a24cbf",703:"229dbd75",712:"b1834d5d",750:"e85498fd",803:"5098ec91",865:"bdc4fc2a",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. - +@sern/handler | sern - Handlers. Redefined. +
-

SernHandler

NPM versionNPM downloads[![License: MIT](https://img.shields.io/badge/License-MIT-blavk.svg)](https://opensource.org/licenses/MIT)

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 } = require('@sern/handler');

exports.default = {
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.

- +

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 } = require('@sern/handler');

exports.default = {
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 241f4d6a4..de9888914 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 5870edbd8..4140daabf 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 6f2967d96..9f68be0e9 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 3e2baf3e1..02fbbce7e 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 c02ca7121..23af9034e 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 b669bf626..a4012be28 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 4b7b7d18d..fa056ae21 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 186023206..64c257a09 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 50a19917a..42fb4c01c 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 1943ee4a4..89312c36c 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 2e0833b41..11dd357d2 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 2305cf67f..46d56cc4a 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 339af015d..0f7d7017e 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 25a4179be..cb58fe854 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 d6a25647b..dc0517547 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 94bcb7048..cc0358538 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 c41b474d2..06c7e774a 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 1ea8edf78..64af6dbf1 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 f8cca59ea..cfdca3de9 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 da1fe8954..f3f0d1166 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 9cca4e809..f651b62ad 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 0e8d3c044..c6236e99e 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.

- + \ No newline at end of file diff --git a/fr/404.html b/fr/404.html index 7f5f1f515..fbf247423 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/fr/assets/js/5e8c322a.0af6705c.js b/fr/assets/js/5e8c322a.0af6705c.js new file mode 100644 index 000000000..627c50cdf --- /dev/null +++ b/fr/assets/js/5e8c322a.0af6705c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_sern_website=self.webpackChunk_sern_website||[]).push([[597],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>m});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),p=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},d=function(e){var t=p(e.components);return r.createElement(s.Provider,{value:t},e.children)},c={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},u=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,d=o(e,["components","mdxType","originalType","parentName"]),u=p(n),m=a,h=u["".concat(s,".").concat(m)]||u[m]||c[m]||i;return n?r.createElement(h,l(l({ref:t},d),{},{components:n})):r.createElement(h,l({ref:t},d))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,l=new Array(i);l[0]=u;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o.mdxType="string"==typeof e?e:a,l[1]=o;for(var p=2;p{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>c,frontMatter:()=>i,metadata:()=>o,toc:()=>p});var r=n(7462),a=(n(7294),n(3905));const i={id:"index",title:"@sern/handler",sidebar_label:"Readme",sidebar_position:0,custom_edit_url:null},l="SernHandler",o={unversionedId:"api/index",id:"api/index",title:"@sern/handler",description:"A customizable, batteries-included, powerful discord.js framework to automate and streamline your bot development.",source:"@site/docs/api/index.md",sourceDirName:"api",slug:"/api/",permalink:"/fr/docs/api/",draft:!1,editUrl:null,tags:[],version:"current",sidebarPosition:0,frontMatter:{id:"index",title:"@sern/handler",sidebar_label:"Readme",sidebar_position:0,custom_edit_url:null},sidebar:"tutorialSidebar",next:{title:"Exports",permalink:"/fr/docs/api/modules"}},s={},p=[{value:"Installation",id:"installation",level:2},{value:"Basic Usage",id:"basic-usage",level:2},{value:" index.js (CommonJS)",id:"-indexjs-commonjs",level:4},{value:" ping.js (CommonJS)",id:"-pingjs-commonjs",level:4},{value:"CLI",id:"cli",level:2},{value:"Links",id:"links",level:2},{value:"Contribute",id:"contribute",level:2},{value:"Roadmap",id:"roadmap",level:2}],d={toc:p};function c(e){let{components:t,...n}=e;return(0,a.kt)("wrapper",(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"sernhandler"},"SernHandler"),(0,a.kt)("a",{href:"https://www.npmjs.com/package/@sern/handler"},(0,a.kt)("img",{src:"https://img.shields.io/npm/v/@sern/handler?maxAge=3600",alt:"NPM version"})),(0,a.kt)("a",{href:"https://www.npmjs.com/package/@sern/handler"},(0,a.kt)("img",{src:"https://img.shields.io/npm/dt/@sern/handler?maxAge=3600",alt:"NPM downloads"})),(0,a.kt)("a",{href:"https://opensource.org/licenses/MIT"},(0,a.kt)("img",{src:"https://img.shields.io/badge/License-MIT-blavk.svg",alt:"MIT License"})),(0,a.kt)("p",null,"A customizable, batteries-included, powerful discord.js framework to automate and streamline your bot development."),(0,a.kt)("h2",{id:"installation"},"Installation"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"npm install @sern/handler\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"yarn add @sern/handler\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"pnpm add @sern/handler\n")),(0,a.kt)("h2",{id:"basic-usage"},"Basic Usage"),(0,a.kt)("h4",{id:"-indexjs-commonjs"},(0,a.kt)("inlineCode",{parentName:"h4"}," index.js (CommonJS)")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-js"},"const { Client, GatewayIntentBits } = require('discord.js');\nconst { Sern } = require('@sern/handler');\nconst { defaultPrefix, token } = require('./config.json');\n\nconst client = new Client({\n intents: [\n GatewayIntentBits.Guilds,\n GatewayIntentBits.GuildMembers,\n GatewayIntentBits.GuildMessages\n ]\n});\n\nSern.init({\n client, \n defaultPrefix, \n commands : 'src/commands',\n});\n\nclient.login(token);\n")),(0,a.kt)("h4",{id:"-pingjs-commonjs"},(0,a.kt)("inlineCode",{parentName:"h4"}," ping.js (CommonJS)")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-js"},"const { Sern, CommandType } = require('@sern/handler');\n\nexports.default = {\n description: 'A ping pong command',\n type: CommandType.Slash,\n execute(ctx) {\n ctx.reply('pong!');\n }\n };\n")),(0,a.kt)("p",null,"See our ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/sern-handler/templates"},"templates")," for TypeScript examples and more"),(0,a.kt)("h2",{id:"cli"},"CLI"),(0,a.kt)("p",null,"It is ",(0,a.kt)("strong",{parentName:"p"},"highly encouraged")," to use the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/sern-handler/cli"},"command line interface")," for your project. Don't forget to view it."),(0,a.kt)("h2",{id:"links"},"Links"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://sern-handler.js.org"},"Official Documentation")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://discord.com/invite/mmyCTnYtbF"},"Support Server"))),(0,a.kt)("h2",{id:"contribute"},"Contribute"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Read our contribution ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/sern-handler/handler"},"guidelines")," carefully"),(0,a.kt)("li",{parentName:"ul"},"Pull up on ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/sern-handler/handler/issues"},"issues")," and report bugs"),(0,a.kt)("li",{parentName:"ul"},"All kinds of contributions are welcomed.")),(0,a.kt)("h2",{id:"roadmap"},"Roadmap"),(0,a.kt)("p",null,"You can check our ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/sern-handler/roadmap"},"roadmap")," to see what's going to be added or patched in the future."))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/fr/assets/js/5e8c322a.47df5c24.js b/fr/assets/js/5e8c322a.47df5c24.js deleted file mode 100644 index 7097053a9..000000000 --- a/fr/assets/js/5e8c322a.47df5c24.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_sern_website=self.webpackChunk_sern_website||[]).push([[597],{3905:(e,n,t)=>{t.d(n,{Zo:()=>c,kt:()=>m});var r=t(7294);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function l(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var s=r.createContext({}),p=function(e){var n=r.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):l(l({},n),e)),t},c=function(e){var n=p(e.components);return r.createElement(s.Provider,{value:n},e.children)},d={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},u=r.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,c=o(e,["components","mdxType","originalType","parentName"]),u=p(t),m=a,h=u["".concat(s,".").concat(m)]||u[m]||d[m]||i;return t?r.createElement(h,l(l({ref:n},c),{},{components:t})):r.createElement(h,l({ref:n},c))}));function m(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,l=new Array(i);l[0]=u;var o={};for(var s in n)hasOwnProperty.call(n,s)&&(o[s]=n[s]);o.originalType=e,o.mdxType="string"==typeof e?e:a,l[1]=o;for(var p=2;p{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>l,default:()=>d,frontMatter:()=>i,metadata:()=>o,toc:()=>p});var r=t(7462),a=(t(7294),t(3905));const i={id:"index",title:"@sern/handler",sidebar_label:"Readme",sidebar_position:0,custom_edit_url:null},l="SernHandler",o={unversionedId:"api/index",id:"api/index",title:"@sern/handler",description:"License: MIT",source:"@site/docs/api/index.md",sourceDirName:"api",slug:"/api/",permalink:"/fr/docs/api/",draft:!1,editUrl:null,tags:[],version:"current",sidebarPosition:0,frontMatter:{id:"index",title:"@sern/handler",sidebar_label:"Readme",sidebar_position:0,custom_edit_url:null},sidebar:"tutorialSidebar",next:{title:"Exports",permalink:"/fr/docs/api/modules"}},s={},p=[{value:"Installation",id:"installation",level:2},{value:"Basic Usage",id:"basic-usage",level:2},{value:" index.js (CommonJS)",id:"-indexjs-commonjs",level:4},{value:" ping.js (CommonJS)",id:"-pingjs-commonjs",level:4},{value:"CLI",id:"cli",level:2},{value:"Links",id:"links",level:2},{value:"Contribute",id:"contribute",level:2},{value:"Roadmap",id:"roadmap",level:2}],c={toc:p};function d(e){let{components:n,...t}=e;return(0,a.kt)("wrapper",(0,r.Z)({},c,t,{components:n,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"sernhandler"},"SernHandler"),(0,a.kt)("a",{href:"https://www.npmjs.com/package/@sern/handler"},(0,a.kt)("img",{src:"https://img.shields.io/npm/v/@sern/handler?maxAge=3600",alt:"NPM version"})),(0,a.kt)("a",{href:"https://www.npmjs.com/package/@sern/handler"},(0,a.kt)("img",{src:"https://img.shields.io/npm/dt/@sern/handler?maxAge=3600",alt:"NPM downloads"})),"[![License: MIT](https://img.shields.io/badge/License-MIT-blavk.svg)](https://opensource.org/licenses/MIT)",(0,a.kt)("p",null,"A customizable, batteries-included, powerful discord.js framework to automate and streamline your bot development."),(0,a.kt)("h2",{id:"installation"},"Installation"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"npm install @sern/handler\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"yarn add @sern/handler\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"pnpm add @sern/handler\n")),(0,a.kt)("h2",{id:"basic-usage"},"Basic Usage"),(0,a.kt)("h4",{id:"-indexjs-commonjs"},(0,a.kt)("inlineCode",{parentName:"h4"}," index.js (CommonJS)")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-js"},"const { Client, GatewayIntentBits } = require('discord.js');\nconst { Sern } = require('@sern/handler');\nconst { defaultPrefix, token } = require('./config.json');\n\nconst client = new Client({\n intents: [\n GatewayIntentBits.Guilds,\n GatewayIntentBits.GuildMembers,\n GatewayIntentBits.GuildMessages\n ]\n});\n\nSern.init({\n client, \n defaultPrefix, \n commands : 'src/commands',\n});\n\nclient.login(token);\n")),(0,a.kt)("h4",{id:"-pingjs-commonjs"},(0,a.kt)("inlineCode",{parentName:"h4"}," ping.js (CommonJS)")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-js"},"const { Sern, CommandType } = require('@sern/handler');\n\nexports.default = {\n description: 'A ping pong command',\n type: CommandType.Slash,\n execute(ctx) {\n ctx.reply('pong!');\n }\n };\n")),(0,a.kt)("p",null,"See our ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/sern-handler/templates"},"templates")," for TypeScript examples and more"),(0,a.kt)("h2",{id:"cli"},"CLI"),(0,a.kt)("p",null,"It is ",(0,a.kt)("strong",{parentName:"p"},"highly encouraged")," to use the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/sern-handler/cli"},"command line interface")," for your project. Don't forget to view it."),(0,a.kt)("h2",{id:"links"},"Links"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://sern-handler.js.org"},"Official Documentation")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://discord.com/invite/mmyCTnYtbF"},"Support Server"))),(0,a.kt)("h2",{id:"contribute"},"Contribute"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Read our contribution ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/sern-handler/handler"},"guidelines")," carefully"),(0,a.kt)("li",{parentName:"ul"},"Pull up on ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/sern-handler/handler/issues"},"issues")," and report bugs"),(0,a.kt)("li",{parentName:"ul"},"All kinds of contributions are welcomed.")),(0,a.kt)("h2",{id:"roadmap"},"Roadmap"),(0,a.kt)("p",null,"You can check our ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/sern-handler/roadmap"},"roadmap")," to see what's going to be added or patched in the future."))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/fr/assets/js/935f2afb.3b551e23.js b/fr/assets/js/935f2afb.5c6d4582.js similarity index 58% rename from fr/assets/js/935f2afb.3b551e23.js rename to fr/assets/js/935f2afb.5c6d4582.js index 5db587ca0..e3e6acd55 100644 --- a/fr/assets/js/935f2afb.3b551e23.js +++ b/fr/assets/js/935f2afb.5c6d4582.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_sern_website=self.webpackChunk_sern_website||[]).push([[197],{1109:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"category","label":"API","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Exports","href":"/fr/docs/api/modules","docId":"api/modules"},{"type":"category","label":"Namespaces","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Sern","href":"/fr/docs/api/namespaces/Sern","docId":"api/namespaces/Sern"}]},{"type":"category","label":"Enumerations","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"CommandType","href":"/fr/docs/api/enums/CommandType","docId":"api/enums/CommandType"},{"type":"link","label":"EventType","href":"/fr/docs/api/enums/EventType","docId":"api/enums/EventType"},{"type":"link","label":"PayloadType","href":"/fr/docs/api/enums/PayloadType","docId":"api/enums/PayloadType"},{"type":"link","label":"PluginType","href":"/fr/docs/api/enums/PluginType","docId":"api/enums/PluginType"}]},{"type":"category","label":"Classes","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Context","href":"/fr/docs/api/classes/Context","docId":"api/classes/Context"},{"type":"link","label":"SernEmitter","href":"/fr/docs/api/classes/SernEmitter","docId":"api/classes/SernEmitter"}]},{"type":"category","label":"Interfaces","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Controller","href":"/fr/docs/api/interfaces/Controller","docId":"api/interfaces/Controller"},{"type":"link","label":"Wrapper","href":"/fr/docs/api/interfaces/Wrapper","docId":"api/interfaces/Wrapper"}]}],"href":"/fr/docs/api/"},{"type":"link","label":"Welcome!","href":"/fr/docs/intro","docId":"intro"},{"type":"category","label":"Introduction","collapsible":true,"collapsed":true,"items":[{"type":"category","label":"getting-started","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Choosing an IDE","href":"/fr/docs/guide/getting-started/choose-ide","docId":"guide/getting-started/choose-ide"},{"type":"link","label":"Preparing to Code","href":"/fr/docs/guide/getting-started/preparing","docId":"guide/getting-started/preparing"}]},{"type":"category","label":"walkthrough","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Goal","href":"/fr/docs/guide/walkthrough/goal","docId":"guide/walkthrough/goal"},{"type":"link","label":"CLI","href":"/fr/docs/guide/walkthrough/cli","docId":"guide/walkthrough/cli"},{"type":"link","label":"First Command","href":"/fr/docs/guide/walkthrough/first-command","docId":"guide/walkthrough/first-command"},{"type":"link","label":"First Event Module","href":"/fr/docs/guide/walkthrough/first-event","docId":"guide/walkthrough/first-event"},{"type":"link","label":"Plugins","href":"/fr/docs/guide/walkthrough/plugins","docId":"guide/walkthrough/plugins"},{"type":"link","label":"The SernEmitter class","href":"/fr/docs/guide/walkthrough/sern-emitter","docId":"guide/walkthrough/sern-emitter"},{"type":"link","label":"Good to know","href":"/fr/docs/guide/walkthrough/good-to-know","docId":"guide/walkthrough/good-to-know"},{"type":"link","label":"Conclusion","href":"/fr/docs/guide/walkthrough/conclusion","docId":"guide/walkthrough/conclusion"}]}],"href":"/fr/docs/guide/"}]},"docs":{"api/classes/Context":{"id":"api/classes/Context","title":"Class: Context","description":"Provides values shared between","sidebar":"tutorialSidebar"},"api/classes/SernEmitter":{"id":"api/classes/SernEmitter","title":"Class: SernEmitter","description":"Hierarchy","sidebar":"tutorialSidebar"},"api/enums/CommandType":{"id":"api/enums/CommandType","title":"Enumeration: CommandType","description":"Example","sidebar":"tutorialSidebar"},"api/enums/EventType":{"id":"api/enums/EventType","title":"Enumeration: EventType","description":"Example","sidebar":"tutorialSidebar"},"api/enums/PayloadType":{"id":"api/enums/PayloadType","title":"Enumeration: PayloadType","description":"Enumeration Members","sidebar":"tutorialSidebar"},"api/enums/PluginType":{"id":"api/enums/PluginType","title":"Enumeration: PluginType","description":"Example","sidebar":"tutorialSidebar"},"api/index":{"id":"api/index","title":"@sern/handler","description":"License: MIT","sidebar":"tutorialSidebar"},"api/interfaces/Controller":{"id":"api/interfaces/Controller","title":"Interface: Controller","description":"Properties","sidebar":"tutorialSidebar"},"api/interfaces/Wrapper":{"id":"api/interfaces/Wrapper","title":"Interface: Wrapper","description":"An object to be passed into Sern#init() function.","sidebar":"tutorialSidebar"},"api/modules":{"id":"api/modules","title":"@sern/handler","description":"Namespaces","sidebar":"tutorialSidebar"},"api/namespaces/Sern":{"id":"api/namespaces/Sern","title":"Namespace: Sern","description":"References","sidebar":"tutorialSidebar"},"guide/getting-started/choose-ide":{"id":"guide/getting-started/choose-ide","title":"Choosing an IDE","description":"Choosing an IDE is a matter of personal preference. The following are some","sidebar":"tutorialSidebar"},"guide/getting-started/preparing":{"id":"guide/getting-started/preparing","title":"Preparing to Code","description":"After installing and IDE you need to install node.","sidebar":"tutorialSidebar"},"guide/README":{"id":"guide/README","title":"Introduction","description":"Welcome to our official guide. This guide will go through all the core features of the framework.","sidebar":"tutorialSidebar"},"guide/walkthrough/cli":{"id":"guide/walkthrough/cli","title":"CLI","description":"Setting up the CLI is easy.","sidebar":"tutorialSidebar"},"guide/walkthrough/conclusion":{"id":"guide/walkthrough/conclusion","title":"Conclusion","description":"If you reached this far, thank you for reading! We hope you have learned the necessities you need","sidebar":"tutorialSidebar"},"guide/walkthrough/first-command":{"id":"guide/walkthrough/first-command","title":"First Command","description":"We will dissect a basic command.","sidebar":"tutorialSidebar"},"guide/walkthrough/first-event":{"id":"guide/walkthrough/first-event","title":"First Event Module","description":"We will dissect a basic event module.","sidebar":"tutorialSidebar"},"guide/walkthrough/goal":{"id":"guide/walkthrough/goal","title":"Goal","description":"sern strives to be minimalist, but with all batteries included. Meaning, this framework provides the necessary tools","sidebar":"tutorialSidebar"},"guide/walkthrough/good-to-know":{"id":"guide/walkthrough/good-to-know","title":"Good to know","description":"sern.config.json","sidebar":"tutorialSidebar"},"guide/walkthrough/plugins":{"id":"guide/walkthrough/plugins","title":"Plugins","description":"As of now, modules seem a little underwhelming. It appears that sern doesn\'t have all the features of a standard handler,","sidebar":"tutorialSidebar"},"guide/walkthrough/sern-emitter":{"id":"guide/walkthrough/sern-emitter","title":"The SernEmitter class","description":"You\'re shipped with the SernEmitter. This EventEmitter listens to","sidebar":"tutorialSidebar"},"intro":{"id":"intro","title":"Welcome!","description":"Content","sidebar":"tutorialSidebar"}}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunk_sern_website=self.webpackChunk_sern_website||[]).push([[197],{1109:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"category","label":"API","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Exports","href":"/fr/docs/api/modules","docId":"api/modules"},{"type":"category","label":"Namespaces","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Sern","href":"/fr/docs/api/namespaces/Sern","docId":"api/namespaces/Sern"}]},{"type":"category","label":"Enumerations","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"CommandType","href":"/fr/docs/api/enums/CommandType","docId":"api/enums/CommandType"},{"type":"link","label":"EventType","href":"/fr/docs/api/enums/EventType","docId":"api/enums/EventType"},{"type":"link","label":"PayloadType","href":"/fr/docs/api/enums/PayloadType","docId":"api/enums/PayloadType"},{"type":"link","label":"PluginType","href":"/fr/docs/api/enums/PluginType","docId":"api/enums/PluginType"}]},{"type":"category","label":"Classes","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Context","href":"/fr/docs/api/classes/Context","docId":"api/classes/Context"},{"type":"link","label":"SernEmitter","href":"/fr/docs/api/classes/SernEmitter","docId":"api/classes/SernEmitter"}]},{"type":"category","label":"Interfaces","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Controller","href":"/fr/docs/api/interfaces/Controller","docId":"api/interfaces/Controller"},{"type":"link","label":"Wrapper","href":"/fr/docs/api/interfaces/Wrapper","docId":"api/interfaces/Wrapper"}]}],"href":"/fr/docs/api/"},{"type":"link","label":"Welcome!","href":"/fr/docs/intro","docId":"intro"},{"type":"category","label":"Introduction","collapsible":true,"collapsed":true,"items":[{"type":"category","label":"getting-started","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Choosing an IDE","href":"/fr/docs/guide/getting-started/choose-ide","docId":"guide/getting-started/choose-ide"},{"type":"link","label":"Preparing to Code","href":"/fr/docs/guide/getting-started/preparing","docId":"guide/getting-started/preparing"}]},{"type":"category","label":"walkthrough","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Goal","href":"/fr/docs/guide/walkthrough/goal","docId":"guide/walkthrough/goal"},{"type":"link","label":"CLI","href":"/fr/docs/guide/walkthrough/cli","docId":"guide/walkthrough/cli"},{"type":"link","label":"First Command","href":"/fr/docs/guide/walkthrough/first-command","docId":"guide/walkthrough/first-command"},{"type":"link","label":"First Event Module","href":"/fr/docs/guide/walkthrough/first-event","docId":"guide/walkthrough/first-event"},{"type":"link","label":"Plugins","href":"/fr/docs/guide/walkthrough/plugins","docId":"guide/walkthrough/plugins"},{"type":"link","label":"The SernEmitter class","href":"/fr/docs/guide/walkthrough/sern-emitter","docId":"guide/walkthrough/sern-emitter"},{"type":"link","label":"Good to know","href":"/fr/docs/guide/walkthrough/good-to-know","docId":"guide/walkthrough/good-to-know"},{"type":"link","label":"Conclusion","href":"/fr/docs/guide/walkthrough/conclusion","docId":"guide/walkthrough/conclusion"}]}],"href":"/fr/docs/guide/"}]},"docs":{"api/classes/Context":{"id":"api/classes/Context","title":"Class: Context","description":"Provides values shared between","sidebar":"tutorialSidebar"},"api/classes/SernEmitter":{"id":"api/classes/SernEmitter","title":"Class: SernEmitter","description":"Hierarchy","sidebar":"tutorialSidebar"},"api/enums/CommandType":{"id":"api/enums/CommandType","title":"Enumeration: CommandType","description":"Example","sidebar":"tutorialSidebar"},"api/enums/EventType":{"id":"api/enums/EventType","title":"Enumeration: EventType","description":"Example","sidebar":"tutorialSidebar"},"api/enums/PayloadType":{"id":"api/enums/PayloadType","title":"Enumeration: PayloadType","description":"Enumeration Members","sidebar":"tutorialSidebar"},"api/enums/PluginType":{"id":"api/enums/PluginType","title":"Enumeration: PluginType","description":"Example","sidebar":"tutorialSidebar"},"api/index":{"id":"api/index","title":"@sern/handler","description":"A customizable, batteries-included, powerful discord.js framework to automate and streamline your bot development.","sidebar":"tutorialSidebar"},"api/interfaces/Controller":{"id":"api/interfaces/Controller","title":"Interface: Controller","description":"Properties","sidebar":"tutorialSidebar"},"api/interfaces/Wrapper":{"id":"api/interfaces/Wrapper","title":"Interface: Wrapper","description":"An object to be passed into Sern#init() function.","sidebar":"tutorialSidebar"},"api/modules":{"id":"api/modules","title":"@sern/handler","description":"Namespaces","sidebar":"tutorialSidebar"},"api/namespaces/Sern":{"id":"api/namespaces/Sern","title":"Namespace: Sern","description":"References","sidebar":"tutorialSidebar"},"guide/getting-started/choose-ide":{"id":"guide/getting-started/choose-ide","title":"Choosing an IDE","description":"Choosing an IDE is a matter of personal preference. The following are some","sidebar":"tutorialSidebar"},"guide/getting-started/preparing":{"id":"guide/getting-started/preparing","title":"Preparing to Code","description":"After installing and IDE you need to install node.","sidebar":"tutorialSidebar"},"guide/README":{"id":"guide/README","title":"Introduction","description":"Welcome to our official guide. This guide will go through all the core features of the framework.","sidebar":"tutorialSidebar"},"guide/walkthrough/cli":{"id":"guide/walkthrough/cli","title":"CLI","description":"Setting up the CLI is easy.","sidebar":"tutorialSidebar"},"guide/walkthrough/conclusion":{"id":"guide/walkthrough/conclusion","title":"Conclusion","description":"If you reached this far, thank you for reading! We hope you have learned the necessities you need","sidebar":"tutorialSidebar"},"guide/walkthrough/first-command":{"id":"guide/walkthrough/first-command","title":"First Command","description":"We will dissect a basic command.","sidebar":"tutorialSidebar"},"guide/walkthrough/first-event":{"id":"guide/walkthrough/first-event","title":"First Event Module","description":"We will dissect a basic event module.","sidebar":"tutorialSidebar"},"guide/walkthrough/goal":{"id":"guide/walkthrough/goal","title":"Goal","description":"sern strives to be minimalist, but with all batteries included. Meaning, this framework provides the necessary tools","sidebar":"tutorialSidebar"},"guide/walkthrough/good-to-know":{"id":"guide/walkthrough/good-to-know","title":"Good to know","description":"sern.config.json","sidebar":"tutorialSidebar"},"guide/walkthrough/plugins":{"id":"guide/walkthrough/plugins","title":"Plugins","description":"As of now, modules seem a little underwhelming. It appears that sern doesn\'t have all the features of a standard handler,","sidebar":"tutorialSidebar"},"guide/walkthrough/sern-emitter":{"id":"guide/walkthrough/sern-emitter","title":"The SernEmitter class","description":"You\'re shipped with the SernEmitter. This EventEmitter listens to","sidebar":"tutorialSidebar"},"intro":{"id":"intro","title":"Welcome!","description":"Content","sidebar":"tutorialSidebar"}}}')}}]); \ No newline at end of file diff --git a/fr/assets/js/runtime~main.cd4dc54d.js b/fr/assets/js/runtime~main.26f6835a.js similarity index 54% rename from fr/assets/js/runtime~main.cd4dc54d.js rename to fr/assets/js/runtime~main.26f6835a.js index bffb67d50..b0f0c5aa0 100644 --- a/fr/assets/js/runtime~main.cd4dc54d.js +++ b/fr/assets/js/runtime~main.26f6835a.js @@ -1 +1 @@ -(()=>{"use strict";var e,t,r,a,f,c={},o={};function d(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,d),r.loaded=!0,r.exports}d.m=c,d.c=o,e=[],d.O=(t,r,a,f)=>{if(!r){var c=1/0;for(i=0;i=f)&&Object.keys(d.O).every((e=>d.O[e](r[n])))?r.splice(n--,1):(o=!1,f0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[r,a,f]},d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.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);d.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,d.d(f,c),f},d.d=(e,t)=>{for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce(((t,r)=>(d.f[r](e,t),t)),[])),d.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:"b0c567c5",45:"6e075084",53:"51b676b7",62:"1291f58b",85:"d7ab1744",127:"4131c3c4",137:"19a812fc",146:"0d01d94f",195:"43845cd9",197:"3b551e23",226:"00e5aa3b",270:"b7490350",277:"bbd90c09",306:"06105970",322:"7b61a3f2",332:"cde4e056",363:"7d199635",397:"1f24705a",414:"387b15e8",429:"41d2f7a6",472:"eeb9cd73",503:"668d49f6",514:"f852ff9f",597:"47df5c24",640:"42a6d824",652:"d5194af7",671:"3335ebfb",703:"8d323aab",712:"16650433",750:"966c746d",803:"b6d7200c",865:"1a0af996",918:"15289f85",972:"61be9a41"}[e]+".js",d.miniCssF=e=>{},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},f="@sern/website:",d.l=(e,t,r,c)=>{if(a[e])a[e].push(t);else{var o,n;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),n&&document.head.appendChild(o)}},d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.p="/fr/",d.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,d.p+d.u(e)},(()=>{var e={303:0,532:0};d.f.j=(t,r)=>{var a=d.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=d.p+d.u(t),o=new Error;d.l(c,(r=>{if(d.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)}},d.O.j=t=>0===e[t];var t=(t,r)=>{var a,f,c=r[0],o=r[1],n=r[2],b=0;if(c.some((t=>0!==e[t]))){for(a in o)d.o(o,a)&&(d.m[a]=o[a]);if(n)var i=n(d)}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:"b0c567c5",45:"6e075084",53:"51b676b7",62:"1291f58b",85:"d7ab1744",127:"4131c3c4",137:"19a812fc",146:"0d01d94f",195:"43845cd9",197:"5c6d4582",226:"00e5aa3b",270:"b7490350",277:"bbd90c09",306:"06105970",322:"7b61a3f2",332:"cde4e056",363:"7d199635",397:"1f24705a",414:"387b15e8",429:"41d2f7a6",472:"eeb9cd73",503:"668d49f6",514:"f852ff9f",597:"0af6705c",640:"42a6d824",652:"d5194af7",671:"3335ebfb",703:"8d323aab",712:"16650433",750:"966c746d",803:"b6d7200c",865:"1a0af996",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. - +@sern/handler | sern - Handlers. Redefined. +
-

SernHandler

NPM versionNPM downloads[![License: MIT](https://img.shields.io/badge/License-MIT-blavk.svg)](https://opensource.org/licenses/MIT)

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 } = require('@sern/handler');

exports.default = {
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.

- +

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 } = require('@sern/handler');

exports.default = {
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 2238b072a..c29642a00 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 1039f4ec5..07fd302ab 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 50fa22ea3..8dac81fac 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 de4d9c735..a73519632 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 b1b6c48de..9ac6264a9 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 f5ac2e94f..abea9669e 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 9d7600800..b2144b2d3 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 042383d06..fca51730b 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 fe2671801..89c6caf5e 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 cbb53adc8..fbb558bb6 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 90a170527..37c2fbb50 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 c0636d524..65eed8305 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 492b17158..8aa038edf 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 048a6e718..ccc200331 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 bd57c2d88..ca3d68a6a 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 f7c1be606..13a585f74 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 567a6005f..4e5bae0a4 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 92a9facb7..3e340f13c 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 d532cc727..e3ede36b7 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 8238d4225..f109c999a 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 e29301d69..26ab64152 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 7d3c70398..b9ad82b5b 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.

- + \ No newline at end of file diff --git a/fr/index.html b/fr/index.html index 30cb16650..265d05f8e 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.

- + \ No newline at end of file diff --git a/fr/markdown-page.html b/fr/markdown-page.html index 4c7ff4a37..e7acd68b7 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 efc15eae5..f0789bee9 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 d72195c05..4a23e0bbb 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.

- + \ No newline at end of file diff --git a/markdown-page.html b/markdown-page.html index a7496baf9..9f17a04f7 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 c8b32bda5..54acb9355 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 c90a7b5b3..ff6cfaa52 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/tr/assets/js/5e8c322a.1768faa6.js b/tr/assets/js/5e8c322a.1768faa6.js deleted file mode 100644 index 1c65ee73d..000000000 --- a/tr/assets/js/5e8c322a.1768faa6.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_sern_website=self.webpackChunk_sern_website||[]).push([[597],{3905:(e,n,t)=>{t.d(n,{Zo:()=>c,kt:()=>m});var r=t(7294);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function l(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var s=r.createContext({}),p=function(e){var n=r.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):l(l({},n),e)),t},c=function(e){var n=p(e.components);return r.createElement(s.Provider,{value:n},e.children)},d={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},u=r.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,c=o(e,["components","mdxType","originalType","parentName"]),u=p(t),m=a,h=u["".concat(s,".").concat(m)]||u[m]||d[m]||i;return t?r.createElement(h,l(l({ref:n},c),{},{components:t})):r.createElement(h,l({ref:n},c))}));function m(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,l=new Array(i);l[0]=u;var o={};for(var s in n)hasOwnProperty.call(n,s)&&(o[s]=n[s]);o.originalType=e,o.mdxType="string"==typeof e?e:a,l[1]=o;for(var p=2;p{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>l,default:()=>d,frontMatter:()=>i,metadata:()=>o,toc:()=>p});var r=t(7462),a=(t(7294),t(3905));const i={id:"index",title:"@sern/handler",sidebar_label:"Readme",sidebar_position:0,custom_edit_url:null},l="SernHandler",o={unversionedId:"api/index",id:"api/index",title:"@sern/handler",description:"License: MIT",source:"@site/docs/api/index.md",sourceDirName:"api",slug:"/api/",permalink:"/tr/docs/api/",draft:!1,editUrl:null,tags:[],version:"current",sidebarPosition:0,frontMatter:{id:"index",title:"@sern/handler",sidebar_label:"Readme",sidebar_position:0,custom_edit_url:null},sidebar:"tutorialSidebar",next:{title:"Exports",permalink:"/tr/docs/api/modules"}},s={},p=[{value:"Installation",id:"installation",level:2},{value:"Basic Usage",id:"basic-usage",level:2},{value:" index.js (CommonJS)",id:"-indexjs-commonjs",level:4},{value:" ping.js (CommonJS)",id:"-pingjs-commonjs",level:4},{value:"CLI",id:"cli",level:2},{value:"Links",id:"links",level:2},{value:"Contribute",id:"contribute",level:2},{value:"Roadmap",id:"roadmap",level:2}],c={toc:p};function d(e){let{components:n,...t}=e;return(0,a.kt)("wrapper",(0,r.Z)({},c,t,{components:n,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"sernhandler"},"SernHandler"),(0,a.kt)("a",{href:"https://www.npmjs.com/package/@sern/handler"},(0,a.kt)("img",{src:"https://img.shields.io/npm/v/@sern/handler?maxAge=3600",alt:"NPM version"})),(0,a.kt)("a",{href:"https://www.npmjs.com/package/@sern/handler"},(0,a.kt)("img",{src:"https://img.shields.io/npm/dt/@sern/handler?maxAge=3600",alt:"NPM downloads"})),"[![License: MIT](https://img.shields.io/badge/License-MIT-blavk.svg)](https://opensource.org/licenses/MIT)",(0,a.kt)("p",null,"A customizable, batteries-included, powerful discord.js framework to automate and streamline your bot development."),(0,a.kt)("h2",{id:"installation"},"Installation"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"npm install @sern/handler\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"yarn add @sern/handler\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"pnpm add @sern/handler\n")),(0,a.kt)("h2",{id:"basic-usage"},"Basic Usage"),(0,a.kt)("h4",{id:"-indexjs-commonjs"},(0,a.kt)("inlineCode",{parentName:"h4"}," index.js (CommonJS)")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-js"},"const { Client, GatewayIntentBits } = require('discord.js');\nconst { Sern } = require('@sern/handler');\nconst { defaultPrefix, token } = require('./config.json');\n\nconst client = new Client({\n intents: [\n GatewayIntentBits.Guilds,\n GatewayIntentBits.GuildMembers,\n GatewayIntentBits.GuildMessages\n ]\n});\n\nSern.init({\n client, \n defaultPrefix, \n commands : 'src/commands',\n});\n\nclient.login(token);\n")),(0,a.kt)("h4",{id:"-pingjs-commonjs"},(0,a.kt)("inlineCode",{parentName:"h4"}," ping.js (CommonJS)")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-js"},"const { Sern, CommandType } = require('@sern/handler');\n\nexports.default = {\n description: 'A ping pong command',\n type: CommandType.Slash,\n execute(ctx) {\n ctx.reply('pong!');\n }\n };\n")),(0,a.kt)("p",null,"See our ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/sern-handler/templates"},"templates")," for TypeScript examples and more"),(0,a.kt)("h2",{id:"cli"},"CLI"),(0,a.kt)("p",null,"It is ",(0,a.kt)("strong",{parentName:"p"},"highly encouraged")," to use the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/sern-handler/cli"},"command line interface")," for your project. Don't forget to view it."),(0,a.kt)("h2",{id:"links"},"Links"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://sern-handler.js.org"},"Official Documentation")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://discord.com/invite/mmyCTnYtbF"},"Support Server"))),(0,a.kt)("h2",{id:"contribute"},"Contribute"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Read our contribution ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/sern-handler/handler"},"guidelines")," carefully"),(0,a.kt)("li",{parentName:"ul"},"Pull up on ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/sern-handler/handler/issues"},"issues")," and report bugs"),(0,a.kt)("li",{parentName:"ul"},"All kinds of contributions are welcomed.")),(0,a.kt)("h2",{id:"roadmap"},"Roadmap"),(0,a.kt)("p",null,"You can check our ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/sern-handler/roadmap"},"roadmap")," to see what's going to be added or patched in the future."))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/tr/assets/js/5e8c322a.5ca4f7de.js b/tr/assets/js/5e8c322a.5ca4f7de.js new file mode 100644 index 000000000..cc9215f82 --- /dev/null +++ b/tr/assets/js/5e8c322a.5ca4f7de.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_sern_website=self.webpackChunk_sern_website||[]).push([[597],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>m});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),p=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},d=function(e){var t=p(e.components);return r.createElement(s.Provider,{value:t},e.children)},c={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},u=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,d=o(e,["components","mdxType","originalType","parentName"]),u=p(n),m=a,h=u["".concat(s,".").concat(m)]||u[m]||c[m]||i;return n?r.createElement(h,l(l({ref:t},d),{},{components:n})):r.createElement(h,l({ref:t},d))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,l=new Array(i);l[0]=u;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o.mdxType="string"==typeof e?e:a,l[1]=o;for(var p=2;p{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>c,frontMatter:()=>i,metadata:()=>o,toc:()=>p});var r=n(7462),a=(n(7294),n(3905));const i={id:"index",title:"@sern/handler",sidebar_label:"Readme",sidebar_position:0,custom_edit_url:null},l="SernHandler",o={unversionedId:"api/index",id:"api/index",title:"@sern/handler",description:"A customizable, batteries-included, powerful discord.js framework to automate and streamline your bot development.",source:"@site/docs/api/index.md",sourceDirName:"api",slug:"/api/",permalink:"/tr/docs/api/",draft:!1,editUrl:null,tags:[],version:"current",sidebarPosition:0,frontMatter:{id:"index",title:"@sern/handler",sidebar_label:"Readme",sidebar_position:0,custom_edit_url:null},sidebar:"tutorialSidebar",next:{title:"Exports",permalink:"/tr/docs/api/modules"}},s={},p=[{value:"Installation",id:"installation",level:2},{value:"Basic Usage",id:"basic-usage",level:2},{value:" index.js (CommonJS)",id:"-indexjs-commonjs",level:4},{value:" ping.js (CommonJS)",id:"-pingjs-commonjs",level:4},{value:"CLI",id:"cli",level:2},{value:"Links",id:"links",level:2},{value:"Contribute",id:"contribute",level:2},{value:"Roadmap",id:"roadmap",level:2}],d={toc:p};function c(e){let{components:t,...n}=e;return(0,a.kt)("wrapper",(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"sernhandler"},"SernHandler"),(0,a.kt)("a",{href:"https://www.npmjs.com/package/@sern/handler"},(0,a.kt)("img",{src:"https://img.shields.io/npm/v/@sern/handler?maxAge=3600",alt:"NPM version"})),(0,a.kt)("a",{href:"https://www.npmjs.com/package/@sern/handler"},(0,a.kt)("img",{src:"https://img.shields.io/npm/dt/@sern/handler?maxAge=3600",alt:"NPM downloads"})),(0,a.kt)("a",{href:"https://opensource.org/licenses/MIT"},(0,a.kt)("img",{src:"https://img.shields.io/badge/License-MIT-blavk.svg",alt:"MIT License"})),(0,a.kt)("p",null,"A customizable, batteries-included, powerful discord.js framework to automate and streamline your bot development."),(0,a.kt)("h2",{id:"installation"},"Installation"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"npm install @sern/handler\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"yarn add @sern/handler\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"pnpm add @sern/handler\n")),(0,a.kt)("h2",{id:"basic-usage"},"Basic Usage"),(0,a.kt)("h4",{id:"-indexjs-commonjs"},(0,a.kt)("inlineCode",{parentName:"h4"}," index.js (CommonJS)")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-js"},"const { Client, GatewayIntentBits } = require('discord.js');\nconst { Sern } = require('@sern/handler');\nconst { defaultPrefix, token } = require('./config.json');\n\nconst client = new Client({\n intents: [\n GatewayIntentBits.Guilds,\n GatewayIntentBits.GuildMembers,\n GatewayIntentBits.GuildMessages\n ]\n});\n\nSern.init({\n client, \n defaultPrefix, \n commands : 'src/commands',\n});\n\nclient.login(token);\n")),(0,a.kt)("h4",{id:"-pingjs-commonjs"},(0,a.kt)("inlineCode",{parentName:"h4"}," ping.js (CommonJS)")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-js"},"const { Sern, CommandType } = require('@sern/handler');\n\nexports.default = {\n description: 'A ping pong command',\n type: CommandType.Slash,\n execute(ctx) {\n ctx.reply('pong!');\n }\n };\n")),(0,a.kt)("p",null,"See our ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/sern-handler/templates"},"templates")," for TypeScript examples and more"),(0,a.kt)("h2",{id:"cli"},"CLI"),(0,a.kt)("p",null,"It is ",(0,a.kt)("strong",{parentName:"p"},"highly encouraged")," to use the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/sern-handler/cli"},"command line interface")," for your project. Don't forget to view it."),(0,a.kt)("h2",{id:"links"},"Links"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://sern-handler.js.org"},"Official Documentation")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://discord.com/invite/mmyCTnYtbF"},"Support Server"))),(0,a.kt)("h2",{id:"contribute"},"Contribute"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Read our contribution ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/sern-handler/handler"},"guidelines")," carefully"),(0,a.kt)("li",{parentName:"ul"},"Pull up on ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/sern-handler/handler/issues"},"issues")," and report bugs"),(0,a.kt)("li",{parentName:"ul"},"All kinds of contributions are welcomed.")),(0,a.kt)("h2",{id:"roadmap"},"Roadmap"),(0,a.kt)("p",null,"You can check our ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/sern-handler/roadmap"},"roadmap")," to see what's going to be added or patched in the future."))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/tr/assets/js/935f2afb.21602fd8.js b/tr/assets/js/935f2afb.d705dc58.js similarity index 58% rename from tr/assets/js/935f2afb.21602fd8.js rename to tr/assets/js/935f2afb.d705dc58.js index 31c39b7f6..bbc314bc7 100644 --- a/tr/assets/js/935f2afb.21602fd8.js +++ b/tr/assets/js/935f2afb.d705dc58.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_sern_website=self.webpackChunk_sern_website||[]).push([[197],{1109:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"category","label":"API","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Exports","href":"/tr/docs/api/modules","docId":"api/modules"},{"type":"category","label":"Namespaces","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Sern","href":"/tr/docs/api/namespaces/Sern","docId":"api/namespaces/Sern"}]},{"type":"category","label":"Enumerations","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"CommandType","href":"/tr/docs/api/enums/CommandType","docId":"api/enums/CommandType"},{"type":"link","label":"EventType","href":"/tr/docs/api/enums/EventType","docId":"api/enums/EventType"},{"type":"link","label":"PayloadType","href":"/tr/docs/api/enums/PayloadType","docId":"api/enums/PayloadType"},{"type":"link","label":"PluginType","href":"/tr/docs/api/enums/PluginType","docId":"api/enums/PluginType"}]},{"type":"category","label":"Classes","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Context","href":"/tr/docs/api/classes/Context","docId":"api/classes/Context"},{"type":"link","label":"SernEmitter","href":"/tr/docs/api/classes/SernEmitter","docId":"api/classes/SernEmitter"}]},{"type":"category","label":"Interfaces","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Controller","href":"/tr/docs/api/interfaces/Controller","docId":"api/interfaces/Controller"},{"type":"link","label":"Wrapper","href":"/tr/docs/api/interfaces/Wrapper","docId":"api/interfaces/Wrapper"}]}],"href":"/tr/docs/api/"},{"type":"link","label":"Welcome!","href":"/tr/docs/intro","docId":"intro"},{"type":"category","label":"Introduction","collapsible":true,"collapsed":true,"items":[{"type":"category","label":"getting-started","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Choosing an IDE","href":"/tr/docs/guide/getting-started/choose-ide","docId":"guide/getting-started/choose-ide"},{"type":"link","label":"Preparing to Code","href":"/tr/docs/guide/getting-started/preparing","docId":"guide/getting-started/preparing"}]},{"type":"category","label":"walkthrough","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Goal","href":"/tr/docs/guide/walkthrough/goal","docId":"guide/walkthrough/goal"},{"type":"link","label":"CLI","href":"/tr/docs/guide/walkthrough/cli","docId":"guide/walkthrough/cli"},{"type":"link","label":"First Command","href":"/tr/docs/guide/walkthrough/first-command","docId":"guide/walkthrough/first-command"},{"type":"link","label":"First Event Module","href":"/tr/docs/guide/walkthrough/first-event","docId":"guide/walkthrough/first-event"},{"type":"link","label":"Plugins","href":"/tr/docs/guide/walkthrough/plugins","docId":"guide/walkthrough/plugins"},{"type":"link","label":"The SernEmitter class","href":"/tr/docs/guide/walkthrough/sern-emitter","docId":"guide/walkthrough/sern-emitter"},{"type":"link","label":"Good to know","href":"/tr/docs/guide/walkthrough/good-to-know","docId":"guide/walkthrough/good-to-know"},{"type":"link","label":"Conclusion","href":"/tr/docs/guide/walkthrough/conclusion","docId":"guide/walkthrough/conclusion"}]}],"href":"/tr/docs/guide/"}]},"docs":{"api/classes/Context":{"id":"api/classes/Context","title":"Class: Context","description":"Provides values shared between","sidebar":"tutorialSidebar"},"api/classes/SernEmitter":{"id":"api/classes/SernEmitter","title":"Class: SernEmitter","description":"Hierarchy","sidebar":"tutorialSidebar"},"api/enums/CommandType":{"id":"api/enums/CommandType","title":"Enumeration: CommandType","description":"Example","sidebar":"tutorialSidebar"},"api/enums/EventType":{"id":"api/enums/EventType","title":"Enumeration: EventType","description":"Example","sidebar":"tutorialSidebar"},"api/enums/PayloadType":{"id":"api/enums/PayloadType","title":"Enumeration: PayloadType","description":"Enumeration Members","sidebar":"tutorialSidebar"},"api/enums/PluginType":{"id":"api/enums/PluginType","title":"Enumeration: PluginType","description":"Example","sidebar":"tutorialSidebar"},"api/index":{"id":"api/index","title":"@sern/handler","description":"License: MIT","sidebar":"tutorialSidebar"},"api/interfaces/Controller":{"id":"api/interfaces/Controller","title":"Interface: Controller","description":"Properties","sidebar":"tutorialSidebar"},"api/interfaces/Wrapper":{"id":"api/interfaces/Wrapper","title":"Interface: Wrapper","description":"An object to be passed into Sern#init() function.","sidebar":"tutorialSidebar"},"api/modules":{"id":"api/modules","title":"@sern/handler","description":"Namespaces","sidebar":"tutorialSidebar"},"api/namespaces/Sern":{"id":"api/namespaces/Sern","title":"Namespace: Sern","description":"References","sidebar":"tutorialSidebar"},"guide/getting-started/choose-ide":{"id":"guide/getting-started/choose-ide","title":"Choosing an IDE","description":"Choosing an IDE is a matter of personal preference. The following are some","sidebar":"tutorialSidebar"},"guide/getting-started/preparing":{"id":"guide/getting-started/preparing","title":"Preparing to Code","description":"After installing and IDE you need to install node.","sidebar":"tutorialSidebar"},"guide/README":{"id":"guide/README","title":"Introduction","description":"Welcome to our official guide. This guide will go through all the core features of the framework.","sidebar":"tutorialSidebar"},"guide/walkthrough/cli":{"id":"guide/walkthrough/cli","title":"CLI","description":"Setting up the CLI is easy.","sidebar":"tutorialSidebar"},"guide/walkthrough/conclusion":{"id":"guide/walkthrough/conclusion","title":"Conclusion","description":"If you reached this far, thank you for reading! We hope you have learned the necessities you need","sidebar":"tutorialSidebar"},"guide/walkthrough/first-command":{"id":"guide/walkthrough/first-command","title":"First Command","description":"We will dissect a basic command.","sidebar":"tutorialSidebar"},"guide/walkthrough/first-event":{"id":"guide/walkthrough/first-event","title":"First Event Module","description":"We will dissect a basic event module.","sidebar":"tutorialSidebar"},"guide/walkthrough/goal":{"id":"guide/walkthrough/goal","title":"Goal","description":"sern strives to be minimalist, but with all batteries included. Meaning, this framework provides the necessary tools","sidebar":"tutorialSidebar"},"guide/walkthrough/good-to-know":{"id":"guide/walkthrough/good-to-know","title":"Good to know","description":"sern.config.json","sidebar":"tutorialSidebar"},"guide/walkthrough/plugins":{"id":"guide/walkthrough/plugins","title":"Plugins","description":"As of now, modules seem a little underwhelming. It appears that sern doesn\'t have all the features of a standard handler,","sidebar":"tutorialSidebar"},"guide/walkthrough/sern-emitter":{"id":"guide/walkthrough/sern-emitter","title":"The SernEmitter class","description":"You\'re shipped with the SernEmitter. This EventEmitter listens to","sidebar":"tutorialSidebar"},"intro":{"id":"intro","title":"Welcome!","description":"Content","sidebar":"tutorialSidebar"}}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunk_sern_website=self.webpackChunk_sern_website||[]).push([[197],{1109:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"category","label":"API","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Exports","href":"/tr/docs/api/modules","docId":"api/modules"},{"type":"category","label":"Namespaces","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Sern","href":"/tr/docs/api/namespaces/Sern","docId":"api/namespaces/Sern"}]},{"type":"category","label":"Enumerations","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"CommandType","href":"/tr/docs/api/enums/CommandType","docId":"api/enums/CommandType"},{"type":"link","label":"EventType","href":"/tr/docs/api/enums/EventType","docId":"api/enums/EventType"},{"type":"link","label":"PayloadType","href":"/tr/docs/api/enums/PayloadType","docId":"api/enums/PayloadType"},{"type":"link","label":"PluginType","href":"/tr/docs/api/enums/PluginType","docId":"api/enums/PluginType"}]},{"type":"category","label":"Classes","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Context","href":"/tr/docs/api/classes/Context","docId":"api/classes/Context"},{"type":"link","label":"SernEmitter","href":"/tr/docs/api/classes/SernEmitter","docId":"api/classes/SernEmitter"}]},{"type":"category","label":"Interfaces","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Controller","href":"/tr/docs/api/interfaces/Controller","docId":"api/interfaces/Controller"},{"type":"link","label":"Wrapper","href":"/tr/docs/api/interfaces/Wrapper","docId":"api/interfaces/Wrapper"}]}],"href":"/tr/docs/api/"},{"type":"link","label":"Welcome!","href":"/tr/docs/intro","docId":"intro"},{"type":"category","label":"Introduction","collapsible":true,"collapsed":true,"items":[{"type":"category","label":"getting-started","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Choosing an IDE","href":"/tr/docs/guide/getting-started/choose-ide","docId":"guide/getting-started/choose-ide"},{"type":"link","label":"Preparing to Code","href":"/tr/docs/guide/getting-started/preparing","docId":"guide/getting-started/preparing"}]},{"type":"category","label":"walkthrough","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Goal","href":"/tr/docs/guide/walkthrough/goal","docId":"guide/walkthrough/goal"},{"type":"link","label":"CLI","href":"/tr/docs/guide/walkthrough/cli","docId":"guide/walkthrough/cli"},{"type":"link","label":"First Command","href":"/tr/docs/guide/walkthrough/first-command","docId":"guide/walkthrough/first-command"},{"type":"link","label":"First Event Module","href":"/tr/docs/guide/walkthrough/first-event","docId":"guide/walkthrough/first-event"},{"type":"link","label":"Plugins","href":"/tr/docs/guide/walkthrough/plugins","docId":"guide/walkthrough/plugins"},{"type":"link","label":"The SernEmitter class","href":"/tr/docs/guide/walkthrough/sern-emitter","docId":"guide/walkthrough/sern-emitter"},{"type":"link","label":"Good to know","href":"/tr/docs/guide/walkthrough/good-to-know","docId":"guide/walkthrough/good-to-know"},{"type":"link","label":"Conclusion","href":"/tr/docs/guide/walkthrough/conclusion","docId":"guide/walkthrough/conclusion"}]}],"href":"/tr/docs/guide/"}]},"docs":{"api/classes/Context":{"id":"api/classes/Context","title":"Class: Context","description":"Provides values shared between","sidebar":"tutorialSidebar"},"api/classes/SernEmitter":{"id":"api/classes/SernEmitter","title":"Class: SernEmitter","description":"Hierarchy","sidebar":"tutorialSidebar"},"api/enums/CommandType":{"id":"api/enums/CommandType","title":"Enumeration: CommandType","description":"Example","sidebar":"tutorialSidebar"},"api/enums/EventType":{"id":"api/enums/EventType","title":"Enumeration: EventType","description":"Example","sidebar":"tutorialSidebar"},"api/enums/PayloadType":{"id":"api/enums/PayloadType","title":"Enumeration: PayloadType","description":"Enumeration Members","sidebar":"tutorialSidebar"},"api/enums/PluginType":{"id":"api/enums/PluginType","title":"Enumeration: PluginType","description":"Example","sidebar":"tutorialSidebar"},"api/index":{"id":"api/index","title":"@sern/handler","description":"A customizable, batteries-included, powerful discord.js framework to automate and streamline your bot development.","sidebar":"tutorialSidebar"},"api/interfaces/Controller":{"id":"api/interfaces/Controller","title":"Interface: Controller","description":"Properties","sidebar":"tutorialSidebar"},"api/interfaces/Wrapper":{"id":"api/interfaces/Wrapper","title":"Interface: Wrapper","description":"An object to be passed into Sern#init() function.","sidebar":"tutorialSidebar"},"api/modules":{"id":"api/modules","title":"@sern/handler","description":"Namespaces","sidebar":"tutorialSidebar"},"api/namespaces/Sern":{"id":"api/namespaces/Sern","title":"Namespace: Sern","description":"References","sidebar":"tutorialSidebar"},"guide/getting-started/choose-ide":{"id":"guide/getting-started/choose-ide","title":"Choosing an IDE","description":"Choosing an IDE is a matter of personal preference. The following are some","sidebar":"tutorialSidebar"},"guide/getting-started/preparing":{"id":"guide/getting-started/preparing","title":"Preparing to Code","description":"After installing and IDE you need to install node.","sidebar":"tutorialSidebar"},"guide/README":{"id":"guide/README","title":"Introduction","description":"Welcome to our official guide. This guide will go through all the core features of the framework.","sidebar":"tutorialSidebar"},"guide/walkthrough/cli":{"id":"guide/walkthrough/cli","title":"CLI","description":"Setting up the CLI is easy.","sidebar":"tutorialSidebar"},"guide/walkthrough/conclusion":{"id":"guide/walkthrough/conclusion","title":"Conclusion","description":"If you reached this far, thank you for reading! We hope you have learned the necessities you need","sidebar":"tutorialSidebar"},"guide/walkthrough/first-command":{"id":"guide/walkthrough/first-command","title":"First Command","description":"We will dissect a basic command.","sidebar":"tutorialSidebar"},"guide/walkthrough/first-event":{"id":"guide/walkthrough/first-event","title":"First Event Module","description":"We will dissect a basic event module.","sidebar":"tutorialSidebar"},"guide/walkthrough/goal":{"id":"guide/walkthrough/goal","title":"Goal","description":"sern strives to be minimalist, but with all batteries included. Meaning, this framework provides the necessary tools","sidebar":"tutorialSidebar"},"guide/walkthrough/good-to-know":{"id":"guide/walkthrough/good-to-know","title":"Good to know","description":"sern.config.json","sidebar":"tutorialSidebar"},"guide/walkthrough/plugins":{"id":"guide/walkthrough/plugins","title":"Plugins","description":"As of now, modules seem a little underwhelming. It appears that sern doesn\'t have all the features of a standard handler,","sidebar":"tutorialSidebar"},"guide/walkthrough/sern-emitter":{"id":"guide/walkthrough/sern-emitter","title":"The SernEmitter class","description":"You\'re shipped with the SernEmitter. This EventEmitter listens to","sidebar":"tutorialSidebar"},"intro":{"id":"intro","title":"Welcome!","description":"Content","sidebar":"tutorialSidebar"}}}')}}]); \ No newline at end of file diff --git a/tr/assets/js/runtime~main.860bd821.js b/tr/assets/js/runtime~main.485ce732.js similarity index 58% rename from tr/assets/js/runtime~main.860bd821.js rename to tr/assets/js/runtime~main.485ce732.js index 37aa3df20..16f04a25b 100644 --- a/tr/assets/js/runtime~main.860bd821.js +++ b/tr/assets/js/runtime~main.485ce732.js @@ -1 +1 @@ -(()=>{"use strict";var e,t,r,a,f,o={},c={};function n(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={id:e,loaded:!1,exports:{}};return o[e].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}n.m=o,n.c=c,e=[],n.O=(t,r,a,f)=>{if(!r){var o=1/0;for(i=0;i=f)&&Object.keys(n.O).every((e=>n.O[e](r[d])))?r.splice(d--,1):(c=!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 o={};t=t||[null,r({}),r([]),r(r)];for(var c=2&a&&e;"object"==typeof c&&!~t.indexOf(c);c=r(c))Object.getOwnPropertyNames(c).forEach((t=>o[t]=()=>e[t]));return o.default=()=>e,n.d(f,o),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:"685616df",45:"f5f1dc29",53:"543d4652",62:"1291f58b",85:"d7ab1744",127:"5580539a",137:"375e49c6",146:"34dcba19",195:"43845cd9",197:"21602fd8",226:"ec3c22a7",270:"b1ecf932",277:"bbd90c09",306:"5ba63757",322:"4d983a8a",332:"91bccb31",363:"f89eebba",397:"1f24705a",414:"d0baab28",429:"1da99ada",472:"156f4214",503:"668d49f6",514:"f852ff9f",597:"1768faa6",640:"a0d55f12",652:"0ecd6450",671:"eab1cd86",703:"d14fc527",712:"7e7409ec",750:"dd1d79d2",803:"9ddf3be0",865:"066b8d48",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,o)=>{if(a[e])a[e].push(t);else{var c,d;if(void 0!==r)for(var b=document.getElementsByTagName("script"),i=0;i{c.onerror=c.onload=null,clearTimeout(s);var f=a[e];if(delete a[e],c.parentNode&&c.parentNode.removeChild(c),f&&f.forEach((e=>e(r))),t)return t(r)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=l.bind(null,c.onerror),c.onload=l.bind(null,c.onload),d&&document.head.appendChild(c)}},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 o=n.p+n.u(t),c=new Error;n.l(o,(r=>{if(n.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var f=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;c.message="Loading chunk "+t+" failed.\n("+f+": "+o+")",c.name="ChunkLoadError",c.type=f,c.request=o,a[1](c)}}),"chunk-"+t,t)}},n.O.j=t=>0===e[t];var t=(t,r)=>{var a,f,o=r[0],c=r[1],d=r[2],b=0;if(o.some((t=>0!==e[t]))){for(a in c)n.o(c,a)&&(n.m[a]=c[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:"685616df",45:"f5f1dc29",53:"543d4652",62:"1291f58b",85:"d7ab1744",127:"5580539a",137:"375e49c6",146:"34dcba19",195:"43845cd9",197:"d705dc58",226:"ec3c22a7",270:"b1ecf932",277:"bbd90c09",306:"5ba63757",322:"4d983a8a",332:"91bccb31",363:"f89eebba",397:"1f24705a",414:"d0baab28",429:"1da99ada",472:"156f4214",503:"668d49f6",514:"f852ff9f",597:"5ca4f7de",640:"a0d55f12",652:"0ecd6450",671:"eab1cd86",703:"d14fc527",712:"7e7409ec",750:"dd1d79d2",803:"9ddf3be0",865:"066b8d48",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. - +@sern/handler | sern - Handlers. Redefined. +
-

SernHandler

NPM versionNPM downloads[![License: MIT](https://img.shields.io/badge/License-MIT-blavk.svg)](https://opensource.org/licenses/MIT)

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 } = require('@sern/handler');

exports.default = {
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.

- +

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 } = require('@sern/handler');

exports.default = {
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 c76244ef2..3a8e1dd73 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 3118a92a3..68787dada 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 08d91a4e3..998bc754f 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 f18f53255..a93a72e76 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 3d8960a46..265af9e5a 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 914bb0d41..2197c809b 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 d22b46069..0d886e298 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 fca6dabcf..a22546799 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 bf2794f21..f4361850d 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 720d19078..5440b1d17 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 dda68c397..c53f6b94a 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 d4d193767..6f215afe6 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 e3bae1424..7b12ed19b 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 832bc137b..e7625263f 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 f8285d03a..be131582f 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 dc89ba055..b9626d38e 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 3fcbe76ff..98abb0f32 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 7dfe3c44d..8bbf305a3 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 39f2ad89f..4f846ccc3 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 64a3223bb..ce6044725 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 4168e7642..1ce4f523c 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 74ecffae9..fbccdaba5 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.

- + \ No newline at end of file diff --git a/tr/index.html b/tr/index.html index dff5f74ad..5c1787a64 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.

- + \ No newline at end of file diff --git a/tr/markdown-page.html b/tr/markdown-page.html index 2364350a3..65aa1765f 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 86cabd67e..dcdb29881 100644 --- a/tr/plugins.html +++ b/tr/plugins.html @@ -5,13 +5,13 @@ sern - Handlers. Redefined. - +

Coming soon

- + \ No newline at end of file