This commit is contained in:
sieadev
2025-04-21 14:23:15 +00:00
parent 06303b9fc5
commit 6d8f5b7fac
61 changed files with 632 additions and 21 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 658 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 638 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 674 KiB

After

Width:  |  Height:  |  Size: 663 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 KiB

+1
View File
@@ -0,0 +1 @@
import{V as i}from"./chunks/theme.B0m-fXrT.js";import{c as r,j as t,a as n,G as s,k as o,o as l}from"./chunks/framework.p2VkXzrt.js";const b=JSON.parse('{"title":"Our Team","description":"","frontmatter":{"banner_title":"Pixel Services Documentation","banner_description":"Explore the documentation for all public Pixel Services projects","layout":"home","hero":{"name":"Pixel Services Documentation","text":"","tagline":"Explore the documentation for all public Pixel Services projects","actions":[{"theme":"brand","text":"Support Us","link":"https://buymeacoffee.com/pixelservices"},{"theme":"alt","text":"Check out our Github","link":"https://github.com/Pixel-Services"}]},"features":[{"title":"Flash","details":"Simple, modern and fast expressive web framework written in Java.","link":"/flash"},{"title":"ServerLibraries","details":"A Library made to ease server-side Fabric mod development.","link":"/serverlibraries"},{"title":"MoBot","details":"A modular Discord bot written in Java, with a feature-rich API.","link":"/mobot"}],"head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/index.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/index.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"index.md","filePath":"index.md"}'),m={name:"index.md"},h=Object.assign(m,{setup(c){const a=[{avatar:"https://avatars.githubusercontent.com/u/83401018?v=4",name:"Relism",title:"Backend Developer",links:[{icon:"github",link:"https://github.com/Relism"}]},{avatar:"https://avatars.githubusercontent.com/u/69807609?v=4",name:"Sieadev",title:"Developer",links:[{icon:"github",link:"https://github.com/sieadev"}]}];return(u,e)=>(l(),r("div",null,[e[0]||(e[0]=t("br",null,null,-1)),e[1]||(e[1]=t("hr",null,null,-1)),e[2]||(e[2]=t("br",null,null,-1)),e[3]||(e[3]=t("h1",{id:"our-team",tabindex:"-1"},[n("Our Team "),t("a",{class:"header-anchor",href:"#our-team","aria-label":'Permalink to "Our Team"'},"")],-1)),e[4]||(e[4]=t("p",null,"Say hello to the Pixel Services team !",-1)),s(o(i),{size:"small",members:a})]))}});export{b as __pageData,h as default};
+1
View File
@@ -0,0 +1 @@
import{V as i}from"./chunks/theme.B0m-fXrT.js";import{c as r,j as t,a as n,G as s,k as o,o as l}from"./chunks/framework.p2VkXzrt.js";const b=JSON.parse('{"title":"Our Team","description":"","frontmatter":{"banner_title":"Pixel Services Documentation","banner_description":"Explore the documentation for all public Pixel Services projects","layout":"home","hero":{"name":"Pixel Services Documentation","text":"","tagline":"Explore the documentation for all public Pixel Services projects","actions":[{"theme":"brand","text":"Support Us","link":"https://buymeacoffee.com/pixelservices"},{"theme":"alt","text":"Check out our Github","link":"https://github.com/Pixel-Services"}]},"features":[{"title":"Flash","details":"Simple, modern and fast expressive web framework written in Java.","link":"/flash"},{"title":"ServerLibraries","details":"A Library made to ease server-side Fabric mod development.","link":"/serverlibraries"},{"title":"MoBot","details":"A modular Discord bot written in Java, with a feature-rich API.","link":"/mobot"}],"head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/index.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/index.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"index.md","filePath":"index.md"}'),m={name:"index.md"},h=Object.assign(m,{setup(c){const a=[{avatar:"https://avatars.githubusercontent.com/u/83401018?v=4",name:"Relism",title:"Backend Developer",links:[{icon:"github",link:"https://github.com/Relism"}]},{avatar:"https://avatars.githubusercontent.com/u/69807609?v=4",name:"Sieadev",title:"Developer",links:[{icon:"github",link:"https://github.com/sieadev"}]}];return(u,e)=>(l(),r("div",null,[e[0]||(e[0]=t("br",null,null,-1)),e[1]||(e[1]=t("hr",null,null,-1)),e[2]||(e[2]=t("br",null,null,-1)),e[3]||(e[3]=t("h1",{id:"our-team",tabindex:"-1"},[n("Our Team "),t("a",{class:"header-anchor",href:"#our-team","aria-label":'Permalink to "Our Team"'},"")],-1)),e[4]||(e[4]=t("p",null,"Say hello to the Pixel Services team !",-1)),s(o(i),{size:"small",members:a})]))}});export{b as __pageData,h as default};
@@ -0,0 +1,19 @@
import{_ as a,c as i,a0 as t,o as n}from"./chunks/framework.p2VkXzrt.js";const m=JSON.parse('{"title":"🛠️ Command Arguments","description":"","frontmatter":{"banner_title":"MoBot - Command Arguments","banner_description":"Learn how to use command arguments in MoBot","head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-commands-command-arguments.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-commands-command-arguments.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"mobot/commands/command-arguments.md","filePath":"mobot/commands/command-arguments.md"}'),e={name:"mobot/commands/command-arguments.md"};function h(l,s,p,r,d,k){return n(),i("div",null,s[0]||(s[0]=[t(`<h1 id="🛠️-command-arguments" tabindex="-1">🛠️ Command Arguments <a class="header-anchor" href="#🛠️-command-arguments" aria-label="Permalink to &quot;🛠️ Command Arguments&quot;"></a></h1><p>Command arguments allow you to pass additional information to your commands when they are invoked. This is useful for creating dynamic commands that can perform different actions based on user input.</p><h2 id="📜-slashcommandargument-annotation" tabindex="-1">📜 <code>@SlashCommandArgument</code> Annotation <a class="header-anchor" href="#📜-slashcommandargument-annotation" aria-label="Permalink to &quot;📜 \`@SlashCommandArgument\` Annotation&quot;"></a></h2><p>The <code>@SlashCommandArgument</code> annotation is used to define an argument for a slash command. You can specify the name, description, type, and whether the argument is required or optional. You can add it to the method that handles the command, and it will automatically parse the argument from the command invocation. <code>SlashCommandArgument</code>&#39;s can also be stacked, so you can have multiple arguments for a single command.</p><p>Optionally you can add a <code>Map&lt;String, Object&gt;</code> to the method signature to get all arguments as a Map. If you prefer to retrieve the arguments from the event, you can use <code>#event.getOptions()</code>.</p><table tabindex="0"><thead><tr><th>Option</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td>The name of the argument. This is what users will type to provide the value.</td></tr><tr><td><code>description</code></td><td>A short description of what the argument does.</td></tr><tr><td><code>type</code></td><td>The type of the argument. This can be a string, integer, etc.</td></tr><tr><td><code>required</code></td><td>Whether the argument is required or optional.</td></tr><tr><td><code>autoComplete</code></td><td>Whether the argument should be auto-completed.</td></tr></tbody></table><p>Heres an example of a command with an argument using the <code>@SlashCommandArgument</code> annotation:</p><div class="language-java vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">java</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MyCommand</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> implements</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> SlashCommandHandler</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> @</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">SlashCommand</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> name</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;greet&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> description</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;Greet a user&quot;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> @</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">SlashCommandArgument</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> name</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;user&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> description</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;The user to greet&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> type</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> OptionType.USER,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> required</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> true</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onGreetCommand</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(SlashCommandInteractionEvent </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">event</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, Map&lt;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">String</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">Object</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt; </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">args</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Get the user argument</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> User user </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (User) args.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;user&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Reply to the command</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> event.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">reply</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Hello, &quot;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> +</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> user.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">getName</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;!&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">).</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">queue</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">();</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div>`,8)]))}const g=a(e,[["render",h]]);export{m as __pageData,g as default};
@@ -0,0 +1,19 @@
import{_ as a,c as i,a0 as t,o as n}from"./chunks/framework.p2VkXzrt.js";const m=JSON.parse('{"title":"🛠️ Command Arguments","description":"","frontmatter":{"banner_title":"MoBot - Command Arguments","banner_description":"Learn how to use command arguments in MoBot","head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-commands-command-arguments.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-commands-command-arguments.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"mobot/commands/command-arguments.md","filePath":"mobot/commands/command-arguments.md"}'),e={name:"mobot/commands/command-arguments.md"};function h(l,s,p,r,d,k){return n(),i("div",null,s[0]||(s[0]=[t(`<h1 id="🛠️-command-arguments" tabindex="-1">🛠️ Command Arguments <a class="header-anchor" href="#🛠️-command-arguments" aria-label="Permalink to &quot;🛠️ Command Arguments&quot;"></a></h1><p>Command arguments allow you to pass additional information to your commands when they are invoked. This is useful for creating dynamic commands that can perform different actions based on user input.</p><h2 id="📜-slashcommandargument-annotation" tabindex="-1">📜 <code>@SlashCommandArgument</code> Annotation <a class="header-anchor" href="#📜-slashcommandargument-annotation" aria-label="Permalink to &quot;📜 \`@SlashCommandArgument\` Annotation&quot;"></a></h2><p>The <code>@SlashCommandArgument</code> annotation is used to define an argument for a slash command. You can specify the name, description, type, and whether the argument is required or optional. You can add it to the method that handles the command, and it will automatically parse the argument from the command invocation. <code>SlashCommandArgument</code>&#39;s can also be stacked, so you can have multiple arguments for a single command.</p><p>Optionally you can add a <code>Map&lt;String, Object&gt;</code> to the method signature to get all arguments as a Map. If you prefer to retrieve the arguments from the event, you can use <code>#event.getOptions()</code>.</p><table tabindex="0"><thead><tr><th>Option</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td>The name of the argument. This is what users will type to provide the value.</td></tr><tr><td><code>description</code></td><td>A short description of what the argument does.</td></tr><tr><td><code>type</code></td><td>The type of the argument. This can be a string, integer, etc.</td></tr><tr><td><code>required</code></td><td>Whether the argument is required or optional.</td></tr><tr><td><code>autoComplete</code></td><td>Whether the argument should be auto-completed.</td></tr></tbody></table><p>Heres an example of a command with an argument using the <code>@SlashCommandArgument</code> annotation:</p><div class="language-java vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">java</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MyCommand</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> implements</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> SlashCommandHandler</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> @</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">SlashCommand</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> name</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;greet&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> description</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;Greet a user&quot;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> @</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">SlashCommandArgument</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> name</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;user&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> description</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;The user to greet&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> type</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> OptionType.USER,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> required</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> true</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onGreetCommand</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(SlashCommandInteractionEvent </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">event</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, Map&lt;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">String</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">Object</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt; </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">args</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Get the user argument</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> User user </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (User) args.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;user&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Reply to the command</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> event.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">reply</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Hello, &quot;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> +</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> user.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">getName</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;!&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">).</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">queue</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">();</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div>`,8)]))}const g=a(e,[["render",h]]);export{m as __pageData,g as default};
@@ -0,0 +1,14 @@
import{_ as s,c as i,a0 as n,o as t}from"./chunks/framework.p2VkXzrt.js";const c=JSON.parse('{"title":"🛠️ Creating a Command","description":"","frontmatter":{"banner_title":"MoBot - Creating a Command","banner_description":"Learn how to create custom commands for MoBot","head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-commands-creating-a-command.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-commands-creating-a-command.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"mobot/commands/creating-a-command.md","filePath":"mobot/commands/creating-a-command.md"}'),e={name:"mobot/commands/creating-a-command.md"};function o(h,a,d,l,r,p){return t(),i("div",null,a[0]||(a[0]=[n(`<h1 id="🛠️-creating-a-command" tabindex="-1">🛠️ Creating a Command <a class="header-anchor" href="#🛠️-creating-a-command" aria-label="Permalink to &quot;🛠️ Creating a Command&quot;"></a></h1><p>Commands are a core feature of Discord Bots. They allow users to interact with the bot and perform various actions. In MoBot, creating a command is straightforward and flexible, allowing you to define custom behavior for your bot.</p><h2 id="🚀-commands-in-the-mobot-api" tabindex="-1">🚀 Commands in the MoBot API <a class="header-anchor" href="#🚀-commands-in-the-mobot-api" aria-label="Permalink to &quot;🚀 Commands in the MoBot API&quot;"></a></h2><p>To make commands easy to use, MoBot provides a extensive API for creating and managing commands. Apart from the <code>SlashCommandHandler</code> interface, the SlashCommand System is build entirely from annotations.</p><div class="warning custom-block"><p class="custom-block-title">NOTE</p><p>You will have to implement the <code>SlashCommandHandler</code> interface if you want to use <code>@SlashCommand</code> and other annotations.</p></div><h2 id="📜-slashcommand-annotation" tabindex="-1">📜 <code>@SlashCommand</code> Annotation <a class="header-anchor" href="#📜-slashcommand-annotation" aria-label="Permalink to &quot;📜 \`@SlashCommand\` Annotation&quot;"></a></h2><p>The <code>@SlashCommand</code> annotation is used to define a slash command. Apart from the name and description, you can also specify aliases and required permissions. This annotation is placed on a method that will handle the command when it is invoked. The method should accept a <code>SlashCommandInteractionEvent</code> parameter, which contains information about the command invocation and allows you to respond to the user.</p><table tabindex="0"><thead><tr><th>Option</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td>The name of the command. This is what users will type to invoke the command.</td></tr><tr><td><code>description</code></td><td>A short description of what the command does.</td></tr><tr><td><code>aliases</code></td><td>An array of alternative names for the command.</td></tr><tr><td><code>permissions</code></td><td>The permission required to use the command.</td></tr></tbody></table><p>Heres an example of a simple <code>PingCommand</code> using the <code>@SlashCommand</code> annotation:</p><div class="language-java vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">java</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> PingCommand</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> implements</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> SlashCommandHandler</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> @</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">SlashCommand</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> name</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;ping&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> description</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;Ping the bot to check if it&#39;s alive&quot;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onPingCommand</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(SlashCommandInteractionEvent </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">event</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> event.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">reply</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Pong!&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">).</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">queue</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">();</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="🛠️-registering-the-command" tabindex="-1">🛠️ Registering the Command <a class="header-anchor" href="#🛠️-registering-the-command" aria-label="Permalink to &quot;🛠️ Registering the Command&quot;"></a></h2><p>To register the command, you need to create an instance of your command class and register it using the <code>#registerSlashCommandHandler</code> method in your module&#39;s main class.</p><p>Here&#39;s an example of how to register the <code>PingCommand</code> in your module:</p><div class="language-java vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">java</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MyModule</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> extends</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MbModule</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> @</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">Override</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onEnable</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> registerSlashCommandHandler</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">new</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> PingCommand</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">());</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div>`,14)]))}const k=s(e,[["render",o]]);export{c as __pageData,k as default};
@@ -0,0 +1,14 @@
import{_ as s,c as i,a0 as n,o as t}from"./chunks/framework.p2VkXzrt.js";const c=JSON.parse('{"title":"🛠️ Creating a Command","description":"","frontmatter":{"banner_title":"MoBot - Creating a Command","banner_description":"Learn how to create custom commands for MoBot","head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-commands-creating-a-command.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-commands-creating-a-command.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"mobot/commands/creating-a-command.md","filePath":"mobot/commands/creating-a-command.md"}'),e={name:"mobot/commands/creating-a-command.md"};function o(h,a,d,l,r,p){return t(),i("div",null,a[0]||(a[0]=[n(`<h1 id="🛠️-creating-a-command" tabindex="-1">🛠️ Creating a Command <a class="header-anchor" href="#🛠️-creating-a-command" aria-label="Permalink to &quot;🛠️ Creating a Command&quot;"></a></h1><p>Commands are a core feature of Discord Bots. They allow users to interact with the bot and perform various actions. In MoBot, creating a command is straightforward and flexible, allowing you to define custom behavior for your bot.</p><h2 id="🚀-commands-in-the-mobot-api" tabindex="-1">🚀 Commands in the MoBot API <a class="header-anchor" href="#🚀-commands-in-the-mobot-api" aria-label="Permalink to &quot;🚀 Commands in the MoBot API&quot;"></a></h2><p>To make commands easy to use, MoBot provides a extensive API for creating and managing commands. Apart from the <code>SlashCommandHandler</code> interface, the SlashCommand System is build entirely from annotations.</p><div class="warning custom-block"><p class="custom-block-title">NOTE</p><p>You will have to implement the <code>SlashCommandHandler</code> interface if you want to use <code>@SlashCommand</code> and other annotations.</p></div><h2 id="📜-slashcommand-annotation" tabindex="-1">📜 <code>@SlashCommand</code> Annotation <a class="header-anchor" href="#📜-slashcommand-annotation" aria-label="Permalink to &quot;📜 \`@SlashCommand\` Annotation&quot;"></a></h2><p>The <code>@SlashCommand</code> annotation is used to define a slash command. Apart from the name and description, you can also specify aliases and required permissions. This annotation is placed on a method that will handle the command when it is invoked. The method should accept a <code>SlashCommandInteractionEvent</code> parameter, which contains information about the command invocation and allows you to respond to the user.</p><table tabindex="0"><thead><tr><th>Option</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td>The name of the command. This is what users will type to invoke the command.</td></tr><tr><td><code>description</code></td><td>A short description of what the command does.</td></tr><tr><td><code>aliases</code></td><td>An array of alternative names for the command.</td></tr><tr><td><code>permissions</code></td><td>The permission required to use the command.</td></tr></tbody></table><p>Heres an example of a simple <code>PingCommand</code> using the <code>@SlashCommand</code> annotation:</p><div class="language-java vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">java</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> PingCommand</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> implements</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> SlashCommandHandler</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> @</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">SlashCommand</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> name</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;ping&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> description</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;Ping the bot to check if it&#39;s alive&quot;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onPingCommand</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(SlashCommandInteractionEvent </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">event</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> event.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">reply</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Pong!&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">).</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">queue</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">();</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="🛠️-registering-the-command" tabindex="-1">🛠️ Registering the Command <a class="header-anchor" href="#🛠️-registering-the-command" aria-label="Permalink to &quot;🛠️ Registering the Command&quot;"></a></h2><p>To register the command, you need to create an instance of your command class and register it using the <code>#registerSlashCommandHandler</code> method in your module&#39;s main class.</p><p>Here&#39;s an example of how to register the <code>PingCommand</code> in your module:</p><div class="language-java vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">java</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MyModule</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> extends</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MbModule</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> @</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">Override</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onEnable</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> registerSlashCommandHandler</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">new</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> PingCommand</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">());</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div>`,14)]))}const k=s(e,[["render",o]]);export{c as __pageData,k as default};
@@ -0,0 +1 @@
import{_ as t,c as e,o}from"./chunks/framework.p2VkXzrt.js";const d=JSON.parse('{"title":"","description":"","frontmatter":{"head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-configuration-custom-configs.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-configuration-custom-configs.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"mobot/configuration/custom-configs.md","filePath":"mobot/configuration/custom-configs.md"}'),n={name:"mobot/configuration/custom-configs.md"};function a(c,i,s,m,r,g){return o(),e("div")}const p=t(n,[["render",a]]);export{d as __pageData,p as default};
@@ -0,0 +1 @@
import{_ as t,c as e,o}from"./chunks/framework.p2VkXzrt.js";const d=JSON.parse('{"title":"","description":"","frontmatter":{"head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-configuration-custom-configs.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-configuration-custom-configs.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"mobot/configuration/custom-configs.md","filePath":"mobot/configuration/custom-configs.md"}'),n={name:"mobot/configuration/custom-configs.md"};function a(c,i,s,m,r,g){return o(),e("div")}const p=t(n,[["render",a]]);export{d as __pageData,p as default};
@@ -0,0 +1 @@
import{_ as t,c as e,o as a}from"./chunks/framework.p2VkXzrt.js";const g=JSON.parse('{"title":"","description":"","frontmatter":{"head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-configuration-default-config.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-configuration-default-config.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"mobot/configuration/default-config.md","filePath":"mobot/configuration/default-config.md"}'),n={name:"mobot/configuration/default-config.md"};function o(i,c,r,m,s,f){return a(),e("div")}const p=t(n,[["render",o]]);export{g as __pageData,p as default};
@@ -0,0 +1 @@
import{_ as t,c as e,o as a}from"./chunks/framework.p2VkXzrt.js";const g=JSON.parse('{"title":"","description":"","frontmatter":{"head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-configuration-default-config.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-configuration-default-config.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"mobot/configuration/default-config.md","filePath":"mobot/configuration/default-config.md"}'),n={name:"mobot/configuration/default-config.md"};function o(i,c,r,m,s,f){return a(),e("div")}const p=t(n,[["render",o]]);export{g as __pageData,p as default};
@@ -0,0 +1 @@
import{_ as t,c as n,o as e}from"./chunks/framework.p2VkXzrt.js";const d=JSON.parse('{"title":"","description":"","frontmatter":{"head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-configuration-non-yaml-configs.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-configuration-non-yaml-configs.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"mobot/configuration/non-yaml-configs.md","filePath":"mobot/configuration/non-yaml-configs.md"}'),a={name:"mobot/configuration/non-yaml-configs.md"};function o(i,m,c,r,s,g){return e(),n("div")}const p=t(a,[["render",o]]);export{d as __pageData,p as default};
@@ -0,0 +1 @@
import{_ as t,c as n,o as e}from"./chunks/framework.p2VkXzrt.js";const d=JSON.parse('{"title":"","description":"","frontmatter":{"head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-configuration-non-yaml-configs.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-configuration-non-yaml-configs.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"mobot/configuration/non-yaml-configs.md","filePath":"mobot/configuration/non-yaml-configs.md"}'),a={name:"mobot/configuration/non-yaml-configs.md"};function o(i,m,c,r,s,g){return e(),n("div")}const p=t(a,[["render",o]]);export{d as __pageData,p as default};
@@ -0,0 +1,21 @@
import{_ as s,c as a,a0 as i,o as t}from"./chunks/framework.p2VkXzrt.js";const k=JSON.parse('{"title":"📦 Module Lifecycle","description":"","frontmatter":{"banner_title":"MoBot - Module Lifecycle","banner_description":"Learn about the lifecycle of a MoBot module","head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-creating-a-module-module-lifecycle.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-creating-a-module-module-lifecycle.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"mobot/creating-a-module/module-lifecycle.md","filePath":"mobot/creating-a-module/module-lifecycle.md"}'),l={name:"mobot/creating-a-module/module-lifecycle.md"};function n(o,e,h,d,r,p){return t(),a("div",null,e[0]||(e[0]=[i(`<h1 id="📦-module-lifecycle" tabindex="-1">📦 Module Lifecycle <a class="header-anchor" href="#📦-module-lifecycle" aria-label="Permalink to &quot;📦 Module Lifecycle&quot;"></a></h1><p>MoBot modules follow a specific lifecycle to ensure proper initialization, operation, and cleanup. Understanding this lifecycle is crucial for creating reliable and efficient modules.</p><h2 id="🔄-lifecycle-phases" tabindex="-1">🔄 Lifecycle Phases <a class="header-anchor" href="#🔄-lifecycle-phases" aria-label="Permalink to &quot;🔄 Lifecycle Phases&quot;"></a></h2><p>The lifecycle of a MoBot module consists of several phases, each with its own purpose and responsibilities. Heres a breakdown of each phase:</p><h3 id="_1-initialization" tabindex="-1">1. Initialization <a class="header-anchor" href="#_1-initialization" aria-label="Permalink to &quot;1. Initialization&quot;"></a></h3><p>When MoBot starts, it scans the modules directory for JAR files. Each module is loaded, and its MbModule class is instantiated. During this phase, the module&#39;s dependencies are resolved, and its configuration is loaded.</p><h3 id="_2-pre-enable" tabindex="-1">2. Pre-Enable <a class="header-anchor" href="#_2-pre-enable" aria-label="Permalink to &quot;2. Pre-Enable&quot;"></a></h3><p>Before the Discord Bot is fully initialized, the <code>preEnable()</code> method of the module&#39;s main class is called. This is where you can perform actions that involve the <code>BotBuilder</code>. This includes stuff like setting the bots status or other tasks that can not be performed after the bot is fully initialized.</p><h3 id="_3-enable" tabindex="-1">3. Enable <a class="header-anchor" href="#_3-enable" aria-label="Permalink to &quot;3. Enable&quot;"></a></h3><p>After initialization, the <code>onEnable()</code> method of the module&#39;s main class is called. This is where you should set up your module&#39;s main functionality, such as registering commands, listeners, or tasks.</p><h3 id="_4-disable" tabindex="-1">4. Disable <a class="header-anchor" href="#_4-disable" aria-label="Permalink to &quot;4. Disable&quot;"></a></h3><p>When MoBot shuts down or the module is unloaded, the <code>onDisable()</code> method is called. Use this phase to clean up resources, save data, and gracefully stop any ongoing tasks.</p><h3 id="_5-post-disable" tabindex="-1">5. Post-Disable <a class="header-anchor" href="#_5-post-disable" aria-label="Permalink to &quot;5. Post-Disable&quot;"></a></h3><p>After the Discord Bot is fully disabled, the <code>postDisable()</code> method of the module&#39;s main class is called. You can use this phase to perform any final cleanup tasks that require the bot to be fully disabled.</p><div class="warning custom-block"><p class="custom-block-title">NOTE</p><p>All of these methods are optional, and you can choose to implement only the ones you need.</p></div><h2 id="usage-example" tabindex="-1">Usage Example <a class="header-anchor" href="#usage-example" aria-label="Permalink to &quot;Usage Example&quot;"></a></h2><div class="language-java vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">java</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MyModule</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> extends</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MbModule</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> @</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">Override</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> preEnable</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Perform actions before the bot is fully initialized</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> @</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">Override</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onEnable</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Register commands, listeners, etc.</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> @</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">Override</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onDisable</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Save data, stop tasks, etc.</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> @</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">Override</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> postDisable</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Final cleanup tasks</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="🛠️-cheat-sheet" tabindex="-1">🛠️ Cheat Sheet <a class="header-anchor" href="#🛠️-cheat-sheet" aria-label="Permalink to &quot;🛠️ Cheat Sheet&quot;"></a></h2><table tabindex="0"><thead><tr><th>Method</th><th>Description</th></tr></thead><tbody><tr><td><code>preEnable()</code></td><td>Called before the bot is fully initialized. Use this to set up the bot.</td></tr><tr><td><code>onEnable()</code></td><td>Called when the module is enabled. Use this to register commands, listeners, etc.</td></tr><tr><td><code>onDisable()</code></td><td>Called when the module is disabled. Use this to save data, clean up resources etc.</td></tr><tr><td><code>postDisable()</code></td><td>Called after the bot is fully disabled. Use this for final cleanup tasks.</td></tr></tbody></table>`,19)]))}const u=s(l,[["render",n]]);export{k as __pageData,u as default};
@@ -0,0 +1,21 @@
import{_ as s,c as a,a0 as i,o as t}from"./chunks/framework.p2VkXzrt.js";const k=JSON.parse('{"title":"📦 Module Lifecycle","description":"","frontmatter":{"banner_title":"MoBot - Module Lifecycle","banner_description":"Learn about the lifecycle of a MoBot module","head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-creating-a-module-module-lifecycle.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-creating-a-module-module-lifecycle.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"mobot/creating-a-module/module-lifecycle.md","filePath":"mobot/creating-a-module/module-lifecycle.md"}'),l={name:"mobot/creating-a-module/module-lifecycle.md"};function n(o,e,h,d,r,p){return t(),a("div",null,e[0]||(e[0]=[i(`<h1 id="📦-module-lifecycle" tabindex="-1">📦 Module Lifecycle <a class="header-anchor" href="#📦-module-lifecycle" aria-label="Permalink to &quot;📦 Module Lifecycle&quot;"></a></h1><p>MoBot modules follow a specific lifecycle to ensure proper initialization, operation, and cleanup. Understanding this lifecycle is crucial for creating reliable and efficient modules.</p><h2 id="🔄-lifecycle-phases" tabindex="-1">🔄 Lifecycle Phases <a class="header-anchor" href="#🔄-lifecycle-phases" aria-label="Permalink to &quot;🔄 Lifecycle Phases&quot;"></a></h2><p>The lifecycle of a MoBot module consists of several phases, each with its own purpose and responsibilities. Heres a breakdown of each phase:</p><h3 id="_1-initialization" tabindex="-1">1. Initialization <a class="header-anchor" href="#_1-initialization" aria-label="Permalink to &quot;1. Initialization&quot;"></a></h3><p>When MoBot starts, it scans the modules directory for JAR files. Each module is loaded, and its MbModule class is instantiated. During this phase, the module&#39;s dependencies are resolved, and its configuration is loaded.</p><h3 id="_2-pre-enable" tabindex="-1">2. Pre-Enable <a class="header-anchor" href="#_2-pre-enable" aria-label="Permalink to &quot;2. Pre-Enable&quot;"></a></h3><p>Before the Discord Bot is fully initialized, the <code>preEnable()</code> method of the module&#39;s main class is called. This is where you can perform actions that involve the <code>BotBuilder</code>. This includes stuff like setting the bots status or other tasks that can not be performed after the bot is fully initialized.</p><h3 id="_3-enable" tabindex="-1">3. Enable <a class="header-anchor" href="#_3-enable" aria-label="Permalink to &quot;3. Enable&quot;"></a></h3><p>After initialization, the <code>onEnable()</code> method of the module&#39;s main class is called. This is where you should set up your module&#39;s main functionality, such as registering commands, listeners, or tasks.</p><h3 id="_4-disable" tabindex="-1">4. Disable <a class="header-anchor" href="#_4-disable" aria-label="Permalink to &quot;4. Disable&quot;"></a></h3><p>When MoBot shuts down or the module is unloaded, the <code>onDisable()</code> method is called. Use this phase to clean up resources, save data, and gracefully stop any ongoing tasks.</p><h3 id="_5-post-disable" tabindex="-1">5. Post-Disable <a class="header-anchor" href="#_5-post-disable" aria-label="Permalink to &quot;5. Post-Disable&quot;"></a></h3><p>After the Discord Bot is fully disabled, the <code>postDisable()</code> method of the module&#39;s main class is called. You can use this phase to perform any final cleanup tasks that require the bot to be fully disabled.</p><div class="warning custom-block"><p class="custom-block-title">NOTE</p><p>All of these methods are optional, and you can choose to implement only the ones you need.</p></div><h2 id="usage-example" tabindex="-1">Usage Example <a class="header-anchor" href="#usage-example" aria-label="Permalink to &quot;Usage Example&quot;"></a></h2><div class="language-java vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">java</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MyModule</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> extends</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MbModule</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> @</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">Override</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> preEnable</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Perform actions before the bot is fully initialized</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> @</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">Override</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onEnable</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Register commands, listeners, etc.</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> @</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">Override</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onDisable</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Save data, stop tasks, etc.</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> @</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">Override</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> postDisable</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Final cleanup tasks</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="🛠️-cheat-sheet" tabindex="-1">🛠️ Cheat Sheet <a class="header-anchor" href="#🛠️-cheat-sheet" aria-label="Permalink to &quot;🛠️ Cheat Sheet&quot;"></a></h2><table tabindex="0"><thead><tr><th>Method</th><th>Description</th></tr></thead><tbody><tr><td><code>preEnable()</code></td><td>Called before the bot is fully initialized. Use this to set up the bot.</td></tr><tr><td><code>onEnable()</code></td><td>Called when the module is enabled. Use this to register commands, listeners, etc.</td></tr><tr><td><code>onDisable()</code></td><td>Called when the module is disabled. Use this to save data, clean up resources etc.</td></tr><tr><td><code>postDisable()</code></td><td>Called after the bot is fully disabled. Use this for final cleanup tasks.</td></tr></tbody></table>`,19)]))}const u=s(l,[["render",n]]);export{k as __pageData,u as default};
@@ -0,0 +1,35 @@
import{_ as i,c as a,a0 as e,o as t}from"./chunks/framework.p2VkXzrt.js";const c=JSON.parse('{"title":"🧩 Creating a Module","description":"","frontmatter":{"banner_title":"MoBot - Creating a Module","banner_description":"Learn how to create a module for MoBot","head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-creating-a-module-modules-introduction.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-creating-a-module-modules-introduction.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"mobot/creating-a-module/modules-introduction.md","filePath":"mobot/creating-a-module/modules-introduction.md"}'),n={name:"mobot/creating-a-module/modules-introduction.md"};function l(o,s,h,p,r,d){return t(),a("div",null,s[0]||(s[0]=[e(`<h1 id="🧩-creating-a-module" tabindex="-1">🧩 Creating a Module <a class="header-anchor" href="#🧩-creating-a-module" aria-label="Permalink to &quot;🧩 Creating a Module&quot;"></a></h1><p>MoBot is designed to be modular, allowing you to create your own modules to extend its functionality. This guide will walk you through the process of creating a module for MoBot.</p><h2 id="🧠-prerequisites" tabindex="-1">🧠 Prerequisites <a class="header-anchor" href="#🧠-prerequisites" aria-label="Permalink to &quot;🧠 Prerequisites&quot;"></a></h2><p>Before we begin, make sure youre comfortable with:</p><ul><li>Basic <strong>Java</strong> programming</li><li>Using <strong>Maven</strong> (or any preferred Java build tool)</li><li>Understanding the basics of how MoBot operates</li></ul><p>If you&#39;re new to Java or Maven, we recommend checking out a few beginner tutorials first.</p><p>Also, make sure you&#39;ve reviewed the <a href="/mobot/introduction/installation.html">MoBot Installation Guide</a> to understand how the bot is structured and how modules fit into it.</p><h2 id="🧩-what-makes-a-module" tabindex="-1">🧩 What Makes a Module? <a class="header-anchor" href="#🧩-what-makes-a-module" aria-label="Permalink to &quot;🧩 What Makes a Module?&quot;"></a></h2><p>For a module to be recognized and loaded by MoBot, it needs <strong>two essential parts</strong>:</p><ol><li>A <strong>Main class</strong> that extends <code>MbModule</code></li><li>A <strong><code>module.yml</code></strong> configuration file that defines metadata about the module</li></ol><p>Additionally, youll need to include the <strong>MoBot API</strong> as a dependency in your project.</p><h2 id="🛠-step-1-set-up-your-maven-project" tabindex="-1">🛠 Step 1: Set Up Your Maven Project <a class="header-anchor" href="#🛠-step-1-set-up-your-maven-project" aria-label="Permalink to &quot;🛠 Step 1: Set Up Your Maven Project&quot;"></a></h2><p>To create a module, you need to set up a Maven project. You can do this using your favorite IDE or by using the command line. If you&#39;re using the command line, you can create a new Maven project with the following command:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">mvn</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> archetype:generate</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DgroupId=com.example</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DartifactId=MyModule</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DarchetypeArtifactId=maven-archetype-quickstart</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DinteractiveMode=false</span></span></code></pre></div><p>This will create a new Maven project looking something like this:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">MyModule/</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">├──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> pom.xml</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">└──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> src/</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> └──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> main/</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> └──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> java/</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> └──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> com/</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> └──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> example/</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> └──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> MyModule/</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> └──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> App.java</span></span></code></pre></div><h3 id="add-mobot-api-dependency" tabindex="-1">Add MoBot API Dependency <a class="header-anchor" href="#add-mobot-api-dependency" aria-label="Permalink to &quot;Add MoBot API Dependency&quot;"></a></h3><p>To use the MoBot API in your module, you need to add it as a dependency in your <code>pom.xml</code> file. Open the <code>pom.xml</code> file and add the following lines inside the <code>&lt;repositories&gt;</code> and <code>&lt;dependencies&gt;</code> sections:</p><div class="language-xml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">xml</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">repository</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &lt;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">id</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;pixel-services-releases&lt;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">id</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &lt;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;Pixel Services&lt;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &lt;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">url</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;https://maven.pixel-services.com/releases&lt;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">url</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">repository</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">dependency</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &lt;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">groupId</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;com.pixelservices.mobot&lt;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">groupId</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &lt;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">artifactId</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;mobot-api&lt;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">artifactId</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &lt;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">version</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;VERSION&lt;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">version</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt; </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">&lt;!-- Replace VERSION --&gt;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">dependency</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span></code></pre></div><p>Make sure to replace <code>VERSION</code> with the latest version of the MoBot API.</p><p><a href="https://maven.pixel-services.com/#/releases/com/pixelservices/mobot/mobot-api" target="_blank" rel="noreferrer"><img src="https://img.shields.io/maven-metadata/v?metadataUrl=https://maven.pixel-services.com/releases/com/pixelservices/mobot/mobot-api/maven-metadata.xml" alt="Latest Version"></a></p><h2 id="🧱-step-2-create-your-main-class" tabindex="-1">🧱 Step 2: Create Your Main Class <a class="header-anchor" href="#🧱-step-2-create-your-main-class" aria-label="Permalink to &quot;🧱 Step 2: Create Your Main Class&quot;"></a></h2><p>Either locate your existing main class or create a new one. This class will be the entry point for your module and should extend <code>MbModule</code>.</p><div class="language-java vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">java</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MyModule</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> extends</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MbModule</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> @</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">Override</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onEnable</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> //Do something</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> @</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">Override</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onDisable</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> //Do something</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="📜-step-3-create-the-module-yml-file" tabindex="-1">📜 Step 3: Create the <code>module.yml</code> File <a class="header-anchor" href="#📜-step-3-create-the-module-yml-file" aria-label="Permalink to &quot;📜 Step 3: Create the \`module.yml\` File&quot;"></a></h2><p>The <code>module.yml</code> file contains metadata about your module, such as its name, version, and description. Create a new file named <code>module.yml</code> in the <code>src/main/resources</code> directory of your project.</p><div class="language-yaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">MyModule</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">version</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1.0.0</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">description</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">This is a sample module for MoBot.</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">com.example.MyModule</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">authors</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Your Name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">license</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">MIT</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">depedencies</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: []</span></span></code></pre></div><h3 id="explanation-of-the-fields" tabindex="-1">Explanation of the Fields <a class="header-anchor" href="#explanation-of-the-fields" aria-label="Permalink to &quot;Explanation of the Fields&quot;"></a></h3><ul><li><strong>name</strong>: The name of your module.</li><li><strong>version</strong>: The version of your module.</li><li><strong>description</strong>: A brief description of your module.</li><li><strong>main</strong>: The fully qualified name of your main class.</li><li><strong>authors</strong>: A list of authors for your module.</li><li><strong>license</strong>: The license under which your module is distributed.</li><li><strong>dependencies</strong>: A list of other modules that your module depends on. This is optional and can be left empty if your module has no dependencies.</li></ul><h2 id="🚀-step-4-build-your-module" tabindex="-1">🚀 Step 4: Build Your Module <a class="header-anchor" href="#🚀-step-4-build-your-module" aria-label="Permalink to &quot;🚀 Step 4: Build Your Module&quot;"></a></h2><p>Once you have created your main class and <code>module.yml</code> file, you can build your module using Maven. Open a terminal in the root directory of your project and run the following command:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">mvn</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clean</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> package</span></span></code></pre></div><p>This will create a JAR file for your module in the <code>target</code> directory. The JAR file will be named <code>MyModule-1.0.0.jar</code> (or whatever version you specified in the <code>module.yml</code> file).</p><p>Congratulations! You have successfully created a module for MoBot. Now you can load it into your MoBot instance and start using it.</p><h2 id="🔌-step-5-load-your-module-into-mobot" tabindex="-1">🔌 Step 5: Load Your Module into MoBot <a class="header-anchor" href="#🔌-step-5-load-your-module-into-mobot" aria-label="Permalink to &quot;🔌 Step 5: Load Your Module into MoBot&quot;"></a></h2><p>To load your module into MoBot, simply place the JAR file you just created into the <code>modules</code> directory of your MoBot instance. When you start MoBot, it will automatically detect and load your module.</p><p>Need help? Join our <a href="https://discord.gg/KTF3Wsk85G" target="_blank" rel="noreferrer">Discord server</a> for support and to connect with other MoBot users.</p>`,37)]))}const u=i(n,[["render",l]]);export{c as __pageData,u as default};
@@ -0,0 +1,35 @@
import{_ as i,c as a,a0 as e,o as t}from"./chunks/framework.p2VkXzrt.js";const c=JSON.parse('{"title":"🧩 Creating a Module","description":"","frontmatter":{"banner_title":"MoBot - Creating a Module","banner_description":"Learn how to create a module for MoBot","head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-creating-a-module-modules-introduction.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-creating-a-module-modules-introduction.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"mobot/creating-a-module/modules-introduction.md","filePath":"mobot/creating-a-module/modules-introduction.md"}'),n={name:"mobot/creating-a-module/modules-introduction.md"};function l(o,s,h,p,r,d){return t(),a("div",null,s[0]||(s[0]=[e(`<h1 id="🧩-creating-a-module" tabindex="-1">🧩 Creating a Module <a class="header-anchor" href="#🧩-creating-a-module" aria-label="Permalink to &quot;🧩 Creating a Module&quot;"></a></h1><p>MoBot is designed to be modular, allowing you to create your own modules to extend its functionality. This guide will walk you through the process of creating a module for MoBot.</p><h2 id="🧠-prerequisites" tabindex="-1">🧠 Prerequisites <a class="header-anchor" href="#🧠-prerequisites" aria-label="Permalink to &quot;🧠 Prerequisites&quot;"></a></h2><p>Before we begin, make sure youre comfortable with:</p><ul><li>Basic <strong>Java</strong> programming</li><li>Using <strong>Maven</strong> (or any preferred Java build tool)</li><li>Understanding the basics of how MoBot operates</li></ul><p>If you&#39;re new to Java or Maven, we recommend checking out a few beginner tutorials first.</p><p>Also, make sure you&#39;ve reviewed the <a href="/mobot/introduction/installation.html">MoBot Installation Guide</a> to understand how the bot is structured and how modules fit into it.</p><h2 id="🧩-what-makes-a-module" tabindex="-1">🧩 What Makes a Module? <a class="header-anchor" href="#🧩-what-makes-a-module" aria-label="Permalink to &quot;🧩 What Makes a Module?&quot;"></a></h2><p>For a module to be recognized and loaded by MoBot, it needs <strong>two essential parts</strong>:</p><ol><li>A <strong>Main class</strong> that extends <code>MbModule</code></li><li>A <strong><code>module.yml</code></strong> configuration file that defines metadata about the module</li></ol><p>Additionally, youll need to include the <strong>MoBot API</strong> as a dependency in your project.</p><h2 id="🛠-step-1-set-up-your-maven-project" tabindex="-1">🛠 Step 1: Set Up Your Maven Project <a class="header-anchor" href="#🛠-step-1-set-up-your-maven-project" aria-label="Permalink to &quot;🛠 Step 1: Set Up Your Maven Project&quot;"></a></h2><p>To create a module, you need to set up a Maven project. You can do this using your favorite IDE or by using the command line. If you&#39;re using the command line, you can create a new Maven project with the following command:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">mvn</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> archetype:generate</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DgroupId=com.example</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DartifactId=MyModule</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DarchetypeArtifactId=maven-archetype-quickstart</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DinteractiveMode=false</span></span></code></pre></div><p>This will create a new Maven project looking something like this:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">MyModule/</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">├──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> pom.xml</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">└──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> src/</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> └──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> main/</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> └──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> java/</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> └──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> com/</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> └──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> example/</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> └──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> MyModule/</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> └──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> App.java</span></span></code></pre></div><h3 id="add-mobot-api-dependency" tabindex="-1">Add MoBot API Dependency <a class="header-anchor" href="#add-mobot-api-dependency" aria-label="Permalink to &quot;Add MoBot API Dependency&quot;"></a></h3><p>To use the MoBot API in your module, you need to add it as a dependency in your <code>pom.xml</code> file. Open the <code>pom.xml</code> file and add the following lines inside the <code>&lt;repositories&gt;</code> and <code>&lt;dependencies&gt;</code> sections:</p><div class="language-xml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">xml</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">repository</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &lt;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">id</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;pixel-services-releases&lt;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">id</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &lt;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;Pixel Services&lt;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &lt;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">url</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;https://maven.pixel-services.com/releases&lt;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">url</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">repository</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">dependency</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &lt;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">groupId</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;com.pixelservices.mobot&lt;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">groupId</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &lt;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">artifactId</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;mobot-api&lt;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">artifactId</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &lt;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">version</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;VERSION&lt;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">version</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt; </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">&lt;!-- Replace VERSION --&gt;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">dependency</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span></code></pre></div><p>Make sure to replace <code>VERSION</code> with the latest version of the MoBot API.</p><p><a href="https://maven.pixel-services.com/#/releases/com/pixelservices/mobot/mobot-api" target="_blank" rel="noreferrer"><img src="https://img.shields.io/maven-metadata/v?metadataUrl=https://maven.pixel-services.com/releases/com/pixelservices/mobot/mobot-api/maven-metadata.xml" alt="Latest Version"></a></p><h2 id="🧱-step-2-create-your-main-class" tabindex="-1">🧱 Step 2: Create Your Main Class <a class="header-anchor" href="#🧱-step-2-create-your-main-class" aria-label="Permalink to &quot;🧱 Step 2: Create Your Main Class&quot;"></a></h2><p>Either locate your existing main class or create a new one. This class will be the entry point for your module and should extend <code>MbModule</code>.</p><div class="language-java vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">java</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MyModule</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> extends</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MbModule</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> @</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">Override</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onEnable</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> //Do something</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> @</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">Override</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onDisable</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> //Do something</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="📜-step-3-create-the-module-yml-file" tabindex="-1">📜 Step 3: Create the <code>module.yml</code> File <a class="header-anchor" href="#📜-step-3-create-the-module-yml-file" aria-label="Permalink to &quot;📜 Step 3: Create the \`module.yml\` File&quot;"></a></h2><p>The <code>module.yml</code> file contains metadata about your module, such as its name, version, and description. Create a new file named <code>module.yml</code> in the <code>src/main/resources</code> directory of your project.</p><div class="language-yaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">MyModule</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">version</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1.0.0</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">description</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">This is a sample module for MoBot.</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">com.example.MyModule</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">authors</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Your Name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">license</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">MIT</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">depedencies</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: []</span></span></code></pre></div><h3 id="explanation-of-the-fields" tabindex="-1">Explanation of the Fields <a class="header-anchor" href="#explanation-of-the-fields" aria-label="Permalink to &quot;Explanation of the Fields&quot;"></a></h3><ul><li><strong>name</strong>: The name of your module.</li><li><strong>version</strong>: The version of your module.</li><li><strong>description</strong>: A brief description of your module.</li><li><strong>main</strong>: The fully qualified name of your main class.</li><li><strong>authors</strong>: A list of authors for your module.</li><li><strong>license</strong>: The license under which your module is distributed.</li><li><strong>dependencies</strong>: A list of other modules that your module depends on. This is optional and can be left empty if your module has no dependencies.</li></ul><h2 id="🚀-step-4-build-your-module" tabindex="-1">🚀 Step 4: Build Your Module <a class="header-anchor" href="#🚀-step-4-build-your-module" aria-label="Permalink to &quot;🚀 Step 4: Build Your Module&quot;"></a></h2><p>Once you have created your main class and <code>module.yml</code> file, you can build your module using Maven. Open a terminal in the root directory of your project and run the following command:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">mvn</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clean</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> package</span></span></code></pre></div><p>This will create a JAR file for your module in the <code>target</code> directory. The JAR file will be named <code>MyModule-1.0.0.jar</code> (or whatever version you specified in the <code>module.yml</code> file).</p><p>Congratulations! You have successfully created a module for MoBot. Now you can load it into your MoBot instance and start using it.</p><h2 id="🔌-step-5-load-your-module-into-mobot" tabindex="-1">🔌 Step 5: Load Your Module into MoBot <a class="header-anchor" href="#🔌-step-5-load-your-module-into-mobot" aria-label="Permalink to &quot;🔌 Step 5: Load Your Module into MoBot&quot;"></a></h2><p>To load your module into MoBot, simply place the JAR file you just created into the <code>modules</code> directory of your MoBot instance. When you start MoBot, it will automatically detect and load your module.</p><p>Need help? Join our <a href="https://discord.gg/KTF3Wsk85G" target="_blank" rel="noreferrer">Discord server</a> for support and to connect with other MoBot users.</p>`,37)]))}const u=i(n,[["render",l]]);export{c as __pageData,u as default};
@@ -0,0 +1 @@
import{_ as e,c as t,o as a}from"./chunks/framework.p2VkXzrt.js";const p=JSON.parse('{"title":"","description":"","frontmatter":{"head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-events-creating-a-listener.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-events-creating-a-listener.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"mobot/events/creating-a-listener.md","filePath":"mobot/events/creating-a-listener.md"}'),n={name:"mobot/events/creating-a-listener.md"};function r(s,i,o,c,m,d){return a(),t("div")}const l=e(n,[["render",r]]);export{p as __pageData,l as default};
@@ -0,0 +1 @@
import{_ as e,c as t,o as a}from"./chunks/framework.p2VkXzrt.js";const p=JSON.parse('{"title":"","description":"","frontmatter":{"head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-events-creating-a-listener.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-events-creating-a-listener.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"mobot/events/creating-a-listener.md","filePath":"mobot/events/creating-a-listener.md"}'),n={name:"mobot/events/creating-a-listener.md"};function r(s,i,o,c,m,d){return a(),t("div")}const l=e(n,[["render",r]]);export{p as __pageData,l as default};
@@ -0,0 +1 @@
import{_ as t,c as e,o as n}from"./chunks/framework.p2VkXzrt.js";const v=JSON.parse('{"title":"","description":"","frontmatter":{"head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-events-events-introduction.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-events-events-introduction.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"mobot/events/events-introduction.md","filePath":"mobot/events/events-introduction.md"}'),o={name:"mobot/events/events-introduction.md"};function a(s,r,i,c,m,d){return n(),e("div")}const _=t(o,[["render",a]]);export{v as __pageData,_ as default};
@@ -0,0 +1 @@
import{_ as t,c as e,o as n}from"./chunks/framework.p2VkXzrt.js";const v=JSON.parse('{"title":"","description":"","frontmatter":{"head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-events-events-introduction.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-events-events-introduction.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"mobot/events/events-introduction.md","filePath":"mobot/events/events-introduction.md"}'),o={name:"mobot/events/events-introduction.md"};function a(s,r,i,c,m,d){return n(),e("div")}const _=t(o,[["render",a]]);export{v as __pageData,_ as default};
+1
View File
@@ -0,0 +1 @@
import{_ as a,c as n,j as e,a as t,o as r}from"./chunks/framework.p2VkXzrt.js";const h=JSON.parse('{"title":"MoBot","description":"","frontmatter":{"banner_title":"MoBot - A Modular Discord Bot","banner_description":"MoBot is a modular Discord bot written in Java, with a feature rich API.","head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-index.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-index.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"mobot/index.md","filePath":"mobot/index.md"}'),i={name:"mobot/index.md"};function s(d,o,l,m,c,u){return r(),n("div",null,o[0]||(o[0]=[e("h1",{id:"mobot",tabindex:"-1"},[t("MoBot "),e("a",{class:"header-anchor",href:"#mobot","aria-label":'Permalink to "MoBot"'},"")],-1),e("p",null,"MoBot is a modular, extensible Discord bot framework built in Java. It's designed to give developers full control over bot behavior through a clean and powerful API, while keeping setup and module development approachable—even for beginners.",-1),e("p",null,"At its core, MoBot supports a plugin-like architecture that allows you to build and manage independent modules, each with its own logic, commands, event listeners, and dependencies. Whether you're creating small utilities or full-featured systems, MoBot provides the structure and flexibility to support your ideas.",-1),e("p",null,"Modules are easy to configure and hot-load, and the framework handles startup order, logging, and lifecycle management out of the box. With a strong focus on developer experience, MoBot includes detailed documentation and examples to help you get started quickly.",-1),e("p",null,[t("Ready to get started? Follow the "),e("a",{href:"/mobot/introduction/installation.html"},"Installation guide"),t(". Interested in building your own modules? Head over to "),e("a",{href:"/mobot/creating-a-module/modules-introduction.html"},"Creating a Module"),t(" to learn more.")],-1)]))}const g=a(i,[["render",s]]);export{h as __pageData,g as default};
+1
View File
@@ -0,0 +1 @@
import{_ as a,c as n,j as e,a as t,o as r}from"./chunks/framework.p2VkXzrt.js";const h=JSON.parse('{"title":"MoBot","description":"","frontmatter":{"banner_title":"MoBot - A Modular Discord Bot","banner_description":"MoBot is a modular Discord bot written in Java, with a feature rich API.","head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-index.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-index.png"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:height","content":"1280"}],["meta",{"name":"twitter:image:width","content":"669"}],["meta",{"name":"twitter:description","content":""}]]},"headers":[],"relativePath":"mobot/index.md","filePath":"mobot/index.md"}'),i={name:"mobot/index.md"};function s(d,o,l,m,c,u){return r(),n("div",null,o[0]||(o[0]=[e("h1",{id:"mobot",tabindex:"-1"},[t("MoBot "),e("a",{class:"header-anchor",href:"#mobot","aria-label":'Permalink to "MoBot"'},"")],-1),e("p",null,"MoBot is a modular, extensible Discord bot framework built in Java. It's designed to give developers full control over bot behavior through a clean and powerful API, while keeping setup and module development approachable—even for beginners.",-1),e("p",null,"At its core, MoBot supports a plugin-like architecture that allows you to build and manage independent modules, each with its own logic, commands, event listeners, and dependencies. Whether you're creating small utilities or full-featured systems, MoBot provides the structure and flexibility to support your ideas.",-1),e("p",null,"Modules are easy to configure and hot-load, and the framework handles startup order, logging, and lifecycle management out of the box. With a strong focus on developer experience, MoBot includes detailed documentation and examples to help you get started quickly.",-1),e("p",null,[t("Ready to get started? Follow the "),e("a",{href:"/mobot/introduction/installation.html"},"Installation guide"),t(". Interested in building your own modules? Head over to "),e("a",{href:"/mobot/creating-a-module/modules-introduction.html"},"Creating a Module"),t(" to learn more.")],-1)]))}const g=a(i,[["render",s]]);export{h as __pageData,g as default};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long