diff --git a/404.html b/404.html index 0724981..6f20375 100644 --- a/404.html +++ b/404.html @@ -17,7 +17,7 @@
- + \ No newline at end of file diff --git a/assets/banner-cards/mobot-commands-command-arguments.png b/assets/banner-cards/mobot-commands-command-arguments.png new file mode 100644 index 0000000..dbbd97b Binary files /dev/null and b/assets/banner-cards/mobot-commands-command-arguments.png differ diff --git a/assets/banner-cards/mobot-commands-creating-a-command.png b/assets/banner-cards/mobot-commands-creating-a-command.png new file mode 100644 index 0000000..22bc24e Binary files /dev/null and b/assets/banner-cards/mobot-commands-creating-a-command.png differ diff --git a/assets/banner-cards/mobot-configuration-custom-configs.png b/assets/banner-cards/mobot-configuration-custom-configs.png new file mode 100644 index 0000000..f1b717c Binary files /dev/null and b/assets/banner-cards/mobot-configuration-custom-configs.png differ diff --git a/assets/banner-cards/mobot-configuration-default-config.png b/assets/banner-cards/mobot-configuration-default-config.png new file mode 100644 index 0000000..3af3935 Binary files /dev/null and b/assets/banner-cards/mobot-configuration-default-config.png differ diff --git a/assets/banner-cards/mobot-configuration-non-yaml-configs.png b/assets/banner-cards/mobot-configuration-non-yaml-configs.png new file mode 100644 index 0000000..95faa0a Binary files /dev/null and b/assets/banner-cards/mobot-configuration-non-yaml-configs.png differ diff --git a/assets/banner-cards/mobot-creating-a-module-module-lifecycle.png b/assets/banner-cards/mobot-creating-a-module-module-lifecycle.png new file mode 100644 index 0000000..7485c0f Binary files /dev/null and b/assets/banner-cards/mobot-creating-a-module-module-lifecycle.png differ diff --git a/assets/banner-cards/mobot-creating-a-module-modules-introduction.png b/assets/banner-cards/mobot-creating-a-module-modules-introduction.png new file mode 100644 index 0000000..02b122c Binary files /dev/null and b/assets/banner-cards/mobot-creating-a-module-modules-introduction.png differ diff --git a/assets/banner-cards/mobot-events-creating-a-listener.png b/assets/banner-cards/mobot-events-creating-a-listener.png new file mode 100644 index 0000000..7ba7738 Binary files /dev/null and b/assets/banner-cards/mobot-events-creating-a-listener.png differ diff --git a/assets/banner-cards/mobot-events-events-introduction.png b/assets/banner-cards/mobot-events-events-introduction.png new file mode 100644 index 0000000..470fd0f Binary files /dev/null and b/assets/banner-cards/mobot-events-events-introduction.png differ diff --git a/assets/banner-cards/mobot-index.png b/assets/banner-cards/mobot-index.png index 7e57532..0e5a307 100644 Binary files a/assets/banner-cards/mobot-index.png and b/assets/banner-cards/mobot-index.png differ diff --git a/assets/banner-cards/mobot-introduction-installation.png b/assets/banner-cards/mobot-introduction-installation.png new file mode 100644 index 0000000..ef65064 Binary files /dev/null and b/assets/banner-cards/mobot-introduction-installation.png differ diff --git a/assets/index.md.tEfotoPq.js b/assets/index.md.tEfotoPq.js new file mode 100644 index 0000000..54c4ef1 --- /dev/null +++ b/assets/index.md.tEfotoPq.js @@ -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}; diff --git a/assets/index.md.tEfotoPq.lean.js b/assets/index.md.tEfotoPq.lean.js new file mode 100644 index 0000000..54c4ef1 --- /dev/null +++ b/assets/index.md.tEfotoPq.lean.js @@ -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}; diff --git a/assets/mobot_commands_command-arguments.md.Cuc3b3v9.js b/assets/mobot_commands_command-arguments.md.Cuc3b3v9.js new file mode 100644 index 0000000..4ead3ad --- /dev/null +++ b/assets/mobot_commands_command-arguments.md.Cuc3b3v9.js @@ -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(`

πŸ› οΈ Command Arguments ​

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.

πŸ“œ @SlashCommandArgument Annotation ​

The @SlashCommandArgument 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. SlashCommandArgument's can also be stacked, so you can have multiple arguments for a single command.

Optionally you can add a Map<String, Object> to the method signature to get all arguments as a Map. If you prefer to retrieve the arguments from the event, you can use #event.getOptions().

OptionDescription
nameThe name of the argument. This is what users will type to provide the value.
descriptionA short description of what the argument does.
typeThe type of the argument. This can be a string, integer, etc.
requiredWhether the argument is required or optional.
autoCompleteWhether the argument should be auto-completed.

Here’s an example of a command with an argument using the @SlashCommandArgument annotation:

java
public class MyCommand implements SlashCommandHandler {
+    @SlashCommand(
+        name = "greet",
+        description = "Greet a user"
+    )
+    @SlashCommandArgument(
+        name = "user",
+        description = "The user to greet",
+        type = OptionType.USER,
+        required = true
+    )
+    public void onGreetCommand(SlashCommandInteractionEvent event, Map<String, Object> args) {
+        // Get the user argument
+        User user = (User) args.get("user");
+        
+        // Reply to the command
+        event.reply("Hello, " + user.getName() + "!").queue();
+    }
+}
`,8)]))}const g=a(e,[["render",h]]);export{m as __pageData,g as default}; diff --git a/assets/mobot_commands_command-arguments.md.Cuc3b3v9.lean.js b/assets/mobot_commands_command-arguments.md.Cuc3b3v9.lean.js new file mode 100644 index 0000000..4ead3ad --- /dev/null +++ b/assets/mobot_commands_command-arguments.md.Cuc3b3v9.lean.js @@ -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(`

πŸ› οΈ Command Arguments ​

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.

πŸ“œ @SlashCommandArgument Annotation ​

The @SlashCommandArgument 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. SlashCommandArgument's can also be stacked, so you can have multiple arguments for a single command.

Optionally you can add a Map<String, Object> to the method signature to get all arguments as a Map. If you prefer to retrieve the arguments from the event, you can use #event.getOptions().

OptionDescription
nameThe name of the argument. This is what users will type to provide the value.
descriptionA short description of what the argument does.
typeThe type of the argument. This can be a string, integer, etc.
requiredWhether the argument is required or optional.
autoCompleteWhether the argument should be auto-completed.

Here’s an example of a command with an argument using the @SlashCommandArgument annotation:

java
public class MyCommand implements SlashCommandHandler {
+    @SlashCommand(
+        name = "greet",
+        description = "Greet a user"
+    )
+    @SlashCommandArgument(
+        name = "user",
+        description = "The user to greet",
+        type = OptionType.USER,
+        required = true
+    )
+    public void onGreetCommand(SlashCommandInteractionEvent event, Map<String, Object> args) {
+        // Get the user argument
+        User user = (User) args.get("user");
+        
+        // Reply to the command
+        event.reply("Hello, " + user.getName() + "!").queue();
+    }
+}
`,8)]))}const g=a(e,[["render",h]]);export{m as __pageData,g as default}; diff --git a/assets/mobot_commands_creating-a-command.md.DrPP2R0G.js b/assets/mobot_commands_creating-a-command.md.DrPP2R0G.js new file mode 100644 index 0000000..f610301 --- /dev/null +++ b/assets/mobot_commands_creating-a-command.md.DrPP2R0G.js @@ -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(`

πŸ› οΈ Creating a Command ​

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.

πŸš€ Commands in the MoBot API ​

To make commands easy to use, MoBot provides a extensive API for creating and managing commands. Apart from the SlashCommandHandler interface, the SlashCommand System is build entirely from annotations.

NOTE

You will have to implement the SlashCommandHandler interface if you want to use @SlashCommand and other annotations.

πŸ“œ @SlashCommand Annotation ​

The @SlashCommand 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 SlashCommandInteractionEvent parameter, which contains information about the command invocation and allows you to respond to the user.

OptionDescription
nameThe name of the command. This is what users will type to invoke the command.
descriptionA short description of what the command does.
aliasesAn array of alternative names for the command.
permissionsThe permission required to use the command.

Here’s an example of a simple PingCommand using the @SlashCommand annotation:

java
public class PingCommand implements SlashCommandHandler {
+    @SlashCommand(
+        name = "ping",
+        description = "Ping the bot to check if it's alive"
+    )
+    public void onPingCommand(SlashCommandInteractionEvent event) {
+        event.reply("Pong!").queue();
+    }
+}

πŸ› οΈ Registering the Command ​

To register the command, you need to create an instance of your command class and register it using the #registerSlashCommandHandler method in your module's main class.

Here's an example of how to register the PingCommand in your module:

java
public class MyModule extends MbModule {
+    @Override
+    public void onEnable() {
+        registerSlashCommandHandler(new PingCommand());
+    }
+}
`,14)]))}const k=s(e,[["render",o]]);export{c as __pageData,k as default}; diff --git a/assets/mobot_commands_creating-a-command.md.DrPP2R0G.lean.js b/assets/mobot_commands_creating-a-command.md.DrPP2R0G.lean.js new file mode 100644 index 0000000..f610301 --- /dev/null +++ b/assets/mobot_commands_creating-a-command.md.DrPP2R0G.lean.js @@ -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(`

πŸ› οΈ Creating a Command ​

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.

πŸš€ Commands in the MoBot API ​

To make commands easy to use, MoBot provides a extensive API for creating and managing commands. Apart from the SlashCommandHandler interface, the SlashCommand System is build entirely from annotations.

NOTE

You will have to implement the SlashCommandHandler interface if you want to use @SlashCommand and other annotations.

πŸ“œ @SlashCommand Annotation ​

The @SlashCommand 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 SlashCommandInteractionEvent parameter, which contains information about the command invocation and allows you to respond to the user.

OptionDescription
nameThe name of the command. This is what users will type to invoke the command.
descriptionA short description of what the command does.
aliasesAn array of alternative names for the command.
permissionsThe permission required to use the command.

Here’s an example of a simple PingCommand using the @SlashCommand annotation:

java
public class PingCommand implements SlashCommandHandler {
+    @SlashCommand(
+        name = "ping",
+        description = "Ping the bot to check if it's alive"
+    )
+    public void onPingCommand(SlashCommandInteractionEvent event) {
+        event.reply("Pong!").queue();
+    }
+}

πŸ› οΈ Registering the Command ​

To register the command, you need to create an instance of your command class and register it using the #registerSlashCommandHandler method in your module's main class.

Here's an example of how to register the PingCommand in your module:

java
public class MyModule extends MbModule {
+    @Override
+    public void onEnable() {
+        registerSlashCommandHandler(new PingCommand());
+    }
+}
`,14)]))}const k=s(e,[["render",o]]);export{c as __pageData,k as default}; diff --git a/assets/mobot_configuration_custom-configs.md.BBg-YrVf.js b/assets/mobot_configuration_custom-configs.md.BBg-YrVf.js new file mode 100644 index 0000000..7029ea7 --- /dev/null +++ b/assets/mobot_configuration_custom-configs.md.BBg-YrVf.js @@ -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}; diff --git a/assets/mobot_configuration_custom-configs.md.BBg-YrVf.lean.js b/assets/mobot_configuration_custom-configs.md.BBg-YrVf.lean.js new file mode 100644 index 0000000..7029ea7 --- /dev/null +++ b/assets/mobot_configuration_custom-configs.md.BBg-YrVf.lean.js @@ -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}; diff --git a/assets/mobot_configuration_default-config.md.CWK17AB-.js b/assets/mobot_configuration_default-config.md.CWK17AB-.js new file mode 100644 index 0000000..dbc4fed --- /dev/null +++ b/assets/mobot_configuration_default-config.md.CWK17AB-.js @@ -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}; diff --git a/assets/mobot_configuration_default-config.md.CWK17AB-.lean.js b/assets/mobot_configuration_default-config.md.CWK17AB-.lean.js new file mode 100644 index 0000000..dbc4fed --- /dev/null +++ b/assets/mobot_configuration_default-config.md.CWK17AB-.lean.js @@ -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}; diff --git a/assets/mobot_configuration_non-yaml-configs.md.D1wDyLf4.js b/assets/mobot_configuration_non-yaml-configs.md.D1wDyLf4.js new file mode 100644 index 0000000..a383062 --- /dev/null +++ b/assets/mobot_configuration_non-yaml-configs.md.D1wDyLf4.js @@ -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}; diff --git a/assets/mobot_configuration_non-yaml-configs.md.D1wDyLf4.lean.js b/assets/mobot_configuration_non-yaml-configs.md.D1wDyLf4.lean.js new file mode 100644 index 0000000..a383062 --- /dev/null +++ b/assets/mobot_configuration_non-yaml-configs.md.D1wDyLf4.lean.js @@ -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}; diff --git a/assets/mobot_creating-a-module_module-lifecycle.md.BfG9RjVD.js b/assets/mobot_creating-a-module_module-lifecycle.md.BfG9RjVD.js new file mode 100644 index 0000000..4251f45 --- /dev/null +++ b/assets/mobot_creating-a-module_module-lifecycle.md.BfG9RjVD.js @@ -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(`

πŸ“¦ Module Lifecycle ​

MoBot modules follow a specific lifecycle to ensure proper initialization, operation, and cleanup. Understanding this lifecycle is crucial for creating reliable and efficient modules.

πŸ”„ Lifecycle Phases ​

The lifecycle of a MoBot module consists of several phases, each with its own purpose and responsibilities. Here’s a breakdown of each phase:

1. Initialization ​

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's dependencies are resolved, and its configuration is loaded.

2. Pre-Enable ​

Before the Discord Bot is fully initialized, the preEnable() method of the module's main class is called. This is where you can perform actions that involve the BotBuilder. This includes stuff like setting the bots status or other tasks that can not be performed after the bot is fully initialized.

3. Enable ​

After initialization, the onEnable() method of the module's main class is called. This is where you should set up your module's main functionality, such as registering commands, listeners, or tasks.

4. Disable ​

When MoBot shuts down or the module is unloaded, the onDisable() method is called. Use this phase to clean up resources, save data, and gracefully stop any ongoing tasks.

5. Post-Disable ​

After the Discord Bot is fully disabled, the postDisable() method of the module's main class is called. You can use this phase to perform any final cleanup tasks that require the bot to be fully disabled.

NOTE

All of these methods are optional, and you can choose to implement only the ones you need.

Usage Example ​

java
public class MyModule extends MbModule {
+    @Override
+    public void preEnable() {
+        // Perform actions before the bot is fully initialized
+    }
+    
+    @Override
+    public void onEnable() {
+        // Register commands, listeners, etc.
+    }
+    
+    @Override
+    public void onDisable() {
+        // Save data, stop tasks, etc.
+    }
+
+    @Override
+    public void postDisable() {
+        // Final cleanup tasks
+    }
+}

πŸ› οΈ Cheat Sheet ​

MethodDescription
preEnable()Called before the bot is fully initialized. Use this to set up the bot.
onEnable()Called when the module is enabled. Use this to register commands, listeners, etc.
onDisable()Called when the module is disabled. Use this to save data, clean up resources etc.
postDisable()Called after the bot is fully disabled. Use this for final cleanup tasks.
`,19)]))}const u=s(l,[["render",n]]);export{k as __pageData,u as default}; diff --git a/assets/mobot_creating-a-module_module-lifecycle.md.BfG9RjVD.lean.js b/assets/mobot_creating-a-module_module-lifecycle.md.BfG9RjVD.lean.js new file mode 100644 index 0000000..4251f45 --- /dev/null +++ b/assets/mobot_creating-a-module_module-lifecycle.md.BfG9RjVD.lean.js @@ -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(`

πŸ“¦ Module Lifecycle ​

MoBot modules follow a specific lifecycle to ensure proper initialization, operation, and cleanup. Understanding this lifecycle is crucial for creating reliable and efficient modules.

πŸ”„ Lifecycle Phases ​

The lifecycle of a MoBot module consists of several phases, each with its own purpose and responsibilities. Here’s a breakdown of each phase:

1. Initialization ​

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's dependencies are resolved, and its configuration is loaded.

2. Pre-Enable ​

Before the Discord Bot is fully initialized, the preEnable() method of the module's main class is called. This is where you can perform actions that involve the BotBuilder. This includes stuff like setting the bots status or other tasks that can not be performed after the bot is fully initialized.

3. Enable ​

After initialization, the onEnable() method of the module's main class is called. This is where you should set up your module's main functionality, such as registering commands, listeners, or tasks.

4. Disable ​

When MoBot shuts down or the module is unloaded, the onDisable() method is called. Use this phase to clean up resources, save data, and gracefully stop any ongoing tasks.

5. Post-Disable ​

After the Discord Bot is fully disabled, the postDisable() method of the module's main class is called. You can use this phase to perform any final cleanup tasks that require the bot to be fully disabled.

NOTE

All of these methods are optional, and you can choose to implement only the ones you need.

Usage Example ​

java
public class MyModule extends MbModule {
+    @Override
+    public void preEnable() {
+        // Perform actions before the bot is fully initialized
+    }
+    
+    @Override
+    public void onEnable() {
+        // Register commands, listeners, etc.
+    }
+    
+    @Override
+    public void onDisable() {
+        // Save data, stop tasks, etc.
+    }
+
+    @Override
+    public void postDisable() {
+        // Final cleanup tasks
+    }
+}

πŸ› οΈ Cheat Sheet ​

MethodDescription
preEnable()Called before the bot is fully initialized. Use this to set up the bot.
onEnable()Called when the module is enabled. Use this to register commands, listeners, etc.
onDisable()Called when the module is disabled. Use this to save data, clean up resources etc.
postDisable()Called after the bot is fully disabled. Use this for final cleanup tasks.
`,19)]))}const u=s(l,[["render",n]]);export{k as __pageData,u as default}; diff --git a/assets/mobot_creating-a-module_modules-introduction.md.BWpvzdqx.js b/assets/mobot_creating-a-module_modules-introduction.md.BWpvzdqx.js new file mode 100644 index 0000000..831cba9 --- /dev/null +++ b/assets/mobot_creating-a-module_modules-introduction.md.BWpvzdqx.js @@ -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(`

🧩 Creating a Module ​

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.

🧠 Prerequisites ​

Before we begin, make sure you’re comfortable with:

If you're new to Java or Maven, we recommend checking out a few beginner tutorials first.

Also, make sure you've reviewed the MoBot Installation Guide to understand how the bot is structured and how modules fit into it.

🧩 What Makes a Module? ​

For a module to be recognized and loaded by MoBot, it needs two essential parts:

  1. A Main class that extends MbModule
  2. A module.yml configuration file that defines metadata about the module

Additionally, you’ll need to include the MoBot API as a dependency in your project.

πŸ›  Step 1: Set Up Your Maven Project ​

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're using the command line, you can create a new Maven project with the following command:

bash
mvn archetype:generate -DgroupId=com.example -DartifactId=MyModule -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

This will create a new Maven project looking something like this:

bash
MyModule/
+β”œβ”€β”€ pom.xml
+└── src/
+    └── main/
+        └── java/
+            └── com/
+                └── example/
+                    └── MyModule/
+                        └── App.java

Add MoBot API Dependency ​

To use the MoBot API in your module, you need to add it as a dependency in your pom.xml file. Open the pom.xml file and add the following lines inside the <repositories> and <dependencies> sections:

xml
<repository>
+    <id>pixel-services-releases</id>
+    <name>Pixel Services</name>
+    <url>https://maven.pixel-services.com/releases</url>
+</repository>
+
+<dependency>
+    <groupId>com.pixelservices.mobot</groupId>
+    <artifactId>mobot-api</artifactId>
+    <version>VERSION</version> <!-- Replace VERSION -->
+</dependency>

Make sure to replace VERSION with the latest version of the MoBot API.

Latest Version

🧱 Step 2: Create Your Main Class ​

Either locate your existing main class or create a new one. This class will be the entry point for your module and should extend MbModule.

java
public class MyModule extends MbModule {
+    @Override
+    public void onEnable() {
+        //Do something
+    }
+
+    @Override
+    public void onDisable() {
+        //Do something
+    }
+}

πŸ“œ Step 3: Create the module.yml File ​

The module.yml file contains metadata about your module, such as its name, version, and description. Create a new file named module.yml in the src/main/resources directory of your project.

yaml
name: MyModule
+version: 1.0.0
+description: This is a sample module for MoBot.
+main: com.example.MyModule
+authors: [Your Name]
+license: MIT
+depedencies: []

Explanation of the Fields ​

πŸš€ Step 4: Build Your Module ​

Once you have created your main class and module.yml file, you can build your module using Maven. Open a terminal in the root directory of your project and run the following command:

bash
mvn clean package

This will create a JAR file for your module in the target directory. The JAR file will be named MyModule-1.0.0.jar (or whatever version you specified in the module.yml file).

Congratulations! You have successfully created a module for MoBot. Now you can load it into your MoBot instance and start using it.

πŸ”Œ Step 5: Load Your Module into MoBot ​

To load your module into MoBot, simply place the JAR file you just created into the modules directory of your MoBot instance. When you start MoBot, it will automatically detect and load your module.

Need help? Join our Discord server for support and to connect with other MoBot users.

`,37)]))}const u=i(n,[["render",l]]);export{c as __pageData,u as default}; diff --git a/assets/mobot_creating-a-module_modules-introduction.md.BWpvzdqx.lean.js b/assets/mobot_creating-a-module_modules-introduction.md.BWpvzdqx.lean.js new file mode 100644 index 0000000..831cba9 --- /dev/null +++ b/assets/mobot_creating-a-module_modules-introduction.md.BWpvzdqx.lean.js @@ -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(`

🧩 Creating a Module ​

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.

🧠 Prerequisites ​

Before we begin, make sure you’re comfortable with:

If you're new to Java or Maven, we recommend checking out a few beginner tutorials first.

Also, make sure you've reviewed the MoBot Installation Guide to understand how the bot is structured and how modules fit into it.

🧩 What Makes a Module? ​

For a module to be recognized and loaded by MoBot, it needs two essential parts:

  1. A Main class that extends MbModule
  2. A module.yml configuration file that defines metadata about the module

Additionally, you’ll need to include the MoBot API as a dependency in your project.

πŸ›  Step 1: Set Up Your Maven Project ​

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're using the command line, you can create a new Maven project with the following command:

bash
mvn archetype:generate -DgroupId=com.example -DartifactId=MyModule -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

This will create a new Maven project looking something like this:

bash
MyModule/
+β”œβ”€β”€ pom.xml
+└── src/
+    └── main/
+        └── java/
+            └── com/
+                └── example/
+                    └── MyModule/
+                        └── App.java

Add MoBot API Dependency ​

To use the MoBot API in your module, you need to add it as a dependency in your pom.xml file. Open the pom.xml file and add the following lines inside the <repositories> and <dependencies> sections:

xml
<repository>
+    <id>pixel-services-releases</id>
+    <name>Pixel Services</name>
+    <url>https://maven.pixel-services.com/releases</url>
+</repository>
+
+<dependency>
+    <groupId>com.pixelservices.mobot</groupId>
+    <artifactId>mobot-api</artifactId>
+    <version>VERSION</version> <!-- Replace VERSION -->
+</dependency>

Make sure to replace VERSION with the latest version of the MoBot API.

Latest Version

🧱 Step 2: Create Your Main Class ​

Either locate your existing main class or create a new one. This class will be the entry point for your module and should extend MbModule.

java
public class MyModule extends MbModule {
+    @Override
+    public void onEnable() {
+        //Do something
+    }
+
+    @Override
+    public void onDisable() {
+        //Do something
+    }
+}

πŸ“œ Step 3: Create the module.yml File ​

The module.yml file contains metadata about your module, such as its name, version, and description. Create a new file named module.yml in the src/main/resources directory of your project.

yaml
name: MyModule
+version: 1.0.0
+description: This is a sample module for MoBot.
+main: com.example.MyModule
+authors: [Your Name]
+license: MIT
+depedencies: []

Explanation of the Fields ​

πŸš€ Step 4: Build Your Module ​

Once you have created your main class and module.yml file, you can build your module using Maven. Open a terminal in the root directory of your project and run the following command:

bash
mvn clean package

This will create a JAR file for your module in the target directory. The JAR file will be named MyModule-1.0.0.jar (or whatever version you specified in the module.yml file).

Congratulations! You have successfully created a module for MoBot. Now you can load it into your MoBot instance and start using it.

πŸ”Œ Step 5: Load Your Module into MoBot ​

To load your module into MoBot, simply place the JAR file you just created into the modules directory of your MoBot instance. When you start MoBot, it will automatically detect and load your module.

Need help? Join our Discord server for support and to connect with other MoBot users.

`,37)]))}const u=i(n,[["render",l]]);export{c as __pageData,u as default}; diff --git a/assets/mobot_events_creating-a-listener.md.By59Lqsu.js b/assets/mobot_events_creating-a-listener.md.By59Lqsu.js new file mode 100644 index 0000000..ea0a741 --- /dev/null +++ b/assets/mobot_events_creating-a-listener.md.By59Lqsu.js @@ -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}; diff --git a/assets/mobot_events_creating-a-listener.md.By59Lqsu.lean.js b/assets/mobot_events_creating-a-listener.md.By59Lqsu.lean.js new file mode 100644 index 0000000..ea0a741 --- /dev/null +++ b/assets/mobot_events_creating-a-listener.md.By59Lqsu.lean.js @@ -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}; diff --git a/assets/mobot_events_events-introduction.md.cEArHWcq.js b/assets/mobot_events_events-introduction.md.cEArHWcq.js new file mode 100644 index 0000000..84a5141 --- /dev/null +++ b/assets/mobot_events_events-introduction.md.cEArHWcq.js @@ -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}; diff --git a/assets/mobot_events_events-introduction.md.cEArHWcq.lean.js b/assets/mobot_events_events-introduction.md.cEArHWcq.lean.js new file mode 100644 index 0000000..84a5141 --- /dev/null +++ b/assets/mobot_events_events-introduction.md.cEArHWcq.lean.js @@ -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}; diff --git a/assets/mobot_index.md.Bklchsn4.js b/assets/mobot_index.md.Bklchsn4.js new file mode 100644 index 0000000..f2a1b6b --- /dev/null +++ b/assets/mobot_index.md.Bklchsn4.js @@ -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}; diff --git a/assets/mobot_index.md.Bklchsn4.lean.js b/assets/mobot_index.md.Bklchsn4.lean.js new file mode 100644 index 0000000..f2a1b6b --- /dev/null +++ b/assets/mobot_index.md.Bklchsn4.lean.js @@ -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}; diff --git a/assets/mobot_introduction_installation.md.D8x3Ns7p.js b/assets/mobot_introduction_installation.md.D8x3Ns7p.js new file mode 100644 index 0000000..7a9e32f --- /dev/null +++ b/assets/mobot_introduction_installation.md.D8x3Ns7p.js @@ -0,0 +1,5 @@ +import{_ as e,c as o,a0 as a,o as i}from"./chunks/framework.p2VkXzrt.js";const p=JSON.parse('{"title":"πŸ“¦ Installation","description":"","frontmatter":{"banner_title":"MoBot - Installation","banner_description":"How to install MoBot and set up MoBot","head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-introduction-installation.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-introduction-installation.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/introduction/installation.md","filePath":"mobot/introduction/installation.md"}'),s={name:"mobot/introduction/installation.md"};function n(l,t,r,d,h,c){return i(),o("div",null,t[0]||(t[0]=[a(`

πŸ“¦ Installation ​

Follow these steps to install and set up MoBot on your machine. MoBot is designed to be easy to install and configure, so you can get started quickly.

πŸ”§ Requirements ​

πŸ€– Create a Discord Bot ​

If you already have a Discord bot, you can skip this step. If you don't have a bot yet, follow these steps to create one:

Click to expand
  1. Go to the Discord Developer Portal.
  2. Click on the "New Application" button.
  3. Enter a name for your application and click "Create".
  4. In the left sidebar, click on "Bot".
  5. Click on the "Add Bot" button.
  6. Under the "Token" section, click on "Copy" to copy your bot token. Keep this token secret! It is used to authenticate your bot with Discord.
  7. Under the "Privileged Gateway Intents" section, enable the intents you need for your bot. For example, if your bot needs to read messages in channels, enable the "Message Content Intent".
  8. Under the "OAuth2" section, select the "bot" scope and the permissions your bot needs. This will generate a URL that you can use to invite your bot to your server.
  9. Copy the generated URL and paste it into your browser. Select the server you want to invite your bot to and click "Authorize".
  10. Your bot is now created and invited to your server!

πŸ“₯ Download MoBot ​

Grab the latest release from the Releases Page.

  1. Go to the Releases Page
  2. Download the latest MoBot.jar file.

πŸš€ Run MoBot for the First Time ​

In your terminal, navigate to the directory where you downloaded MoBot.jar and run the following command:

bash
java -jar MoBot.jar

When you run MoBot for the first time, MoBot will ask you for a Discord bot token. You can get your token from the Discord Developer Portal.

Once you enter your token, MoBot will create a bot.yml file in the same directory. This file contains your bot's configuration settings. Additionally, MoBot will create a modules directory where you can place your custom modules.

It should look something like this:

bash
mobot/
+β”œβ”€β”€ MoBot.jar
+β”œβ”€β”€ bot.yml
+└── modules/

βš™οΈ Configure MoBot ​

Open the bot.yml file in a text editor. This file contains the configuration settings for your bot. You can customize various settings, such as:

Depending on what modules you have installed, you may need to enable specific intents. For example, if you have a module that requires the GUILD_MEMBERS intent, you need to add it in the bot.yml file.

yaml
intents:
+  - GUILD_MEMBERS

πŸ”Œ Install Modules ​

As of today, there is no official MoBot module repository. However, you can find some community modules on our Discord. To install a module, simply place the module's .jar file in the modules directory. MoBot will automatically load the module on startup.

You can also create your own modules! Check out the Creating a Module section for more information on how to create and manage your own modules.

βœ… Start the Bot ​

Once you have configured your bot and installed any necessary modules, you can start the bot by running the following command in your terminal:

bash
java -jar MoBot.jar

You should see logs indicating that the bot and any modules have been loaded successfully.

Need help? Join our Discord server for support and to connect with other MoBot users.

`,30)]))}const m=e(s,[["render",n]]);export{p as __pageData,m as default}; diff --git a/assets/mobot_introduction_installation.md.D8x3Ns7p.lean.js b/assets/mobot_introduction_installation.md.D8x3Ns7p.lean.js new file mode 100644 index 0000000..7a9e32f --- /dev/null +++ b/assets/mobot_introduction_installation.md.D8x3Ns7p.lean.js @@ -0,0 +1,5 @@ +import{_ as e,c as o,a0 as a,o as i}from"./chunks/framework.p2VkXzrt.js";const p=JSON.parse('{"title":"πŸ“¦ Installation","description":"","frontmatter":{"banner_title":"MoBot - Installation","banner_description":"How to install MoBot and set up MoBot","head":[["meta",{"name":"twitter:image","content":"/assets/banner-cards/mobot-introduction-installation.png"}],["meta",{"name":"twitter:image:src","content":"https://docs.pixel-services.com/assets/banner-cards/mobot-introduction-installation.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/introduction/installation.md","filePath":"mobot/introduction/installation.md"}'),s={name:"mobot/introduction/installation.md"};function n(l,t,r,d,h,c){return i(),o("div",null,t[0]||(t[0]=[a(`

πŸ“¦ Installation ​

Follow these steps to install and set up MoBot on your machine. MoBot is designed to be easy to install and configure, so you can get started quickly.

πŸ”§ Requirements ​

πŸ€– Create a Discord Bot ​

If you already have a Discord bot, you can skip this step. If you don't have a bot yet, follow these steps to create one:

Click to expand
  1. Go to the Discord Developer Portal.
  2. Click on the "New Application" button.
  3. Enter a name for your application and click "Create".
  4. In the left sidebar, click on "Bot".
  5. Click on the "Add Bot" button.
  6. Under the "Token" section, click on "Copy" to copy your bot token. Keep this token secret! It is used to authenticate your bot with Discord.
  7. Under the "Privileged Gateway Intents" section, enable the intents you need for your bot. For example, if your bot needs to read messages in channels, enable the "Message Content Intent".
  8. Under the "OAuth2" section, select the "bot" scope and the permissions your bot needs. This will generate a URL that you can use to invite your bot to your server.
  9. Copy the generated URL and paste it into your browser. Select the server you want to invite your bot to and click "Authorize".
  10. Your bot is now created and invited to your server!

πŸ“₯ Download MoBot ​

Grab the latest release from the Releases Page.

  1. Go to the Releases Page
  2. Download the latest MoBot.jar file.

πŸš€ Run MoBot for the First Time ​

In your terminal, navigate to the directory where you downloaded MoBot.jar and run the following command:

bash
java -jar MoBot.jar

When you run MoBot for the first time, MoBot will ask you for a Discord bot token. You can get your token from the Discord Developer Portal.

Once you enter your token, MoBot will create a bot.yml file in the same directory. This file contains your bot's configuration settings. Additionally, MoBot will create a modules directory where you can place your custom modules.

It should look something like this:

bash
mobot/
+β”œβ”€β”€ MoBot.jar
+β”œβ”€β”€ bot.yml
+└── modules/

βš™οΈ Configure MoBot ​

Open the bot.yml file in a text editor. This file contains the configuration settings for your bot. You can customize various settings, such as:

Depending on what modules you have installed, you may need to enable specific intents. For example, if you have a module that requires the GUILD_MEMBERS intent, you need to add it in the bot.yml file.

yaml
intents:
+  - GUILD_MEMBERS

πŸ”Œ Install Modules ​

As of today, there is no official MoBot module repository. However, you can find some community modules on our Discord. To install a module, simply place the module's .jar file in the modules directory. MoBot will automatically load the module on startup.

You can also create your own modules! Check out the Creating a Module section for more information on how to create and manage your own modules.

βœ… Start the Bot ​

Once you have configured your bot and installed any necessary modules, you can start the bot by running the following command in your terminal:

bash
java -jar MoBot.jar

You should see logs indicating that the bot and any modules have been loaded successfully.

Need help? Join our Discord server for support and to connect with other MoBot users.

`,30)]))}const m=e(s,[["render",n]]);export{p as __pageData,m as default}; diff --git a/flash/advanced/fullstack-development.html b/flash/advanced/fullstack-development.html index b55578b..200d4ff 100644 --- a/flash/advanced/fullstack-development.html +++ b/flash/advanced/fullstack-development.html @@ -54,7 +54,7 @@ server.start(); } }

πŸš€ Package and Deploy your app! ​

With the frontend and backend code in place, you can now build the JAR file and deploy it to your server. The JAR file will contain both the frontend and backend code, making it easy to deploy and run your fullstack application.

All you've left to do is run the jarfile on any machine that has Java installed, and your fullstack application will be up and running!

- + \ No newline at end of file diff --git a/flash/advanced/handler-default-implementations.html b/flash/advanced/handler-default-implementations.html index ef462f8..19506d1 100644 --- a/flash/advanced/handler-default-implementations.html +++ b/flash/advanced/handler-default-implementations.html @@ -127,7 +127,7 @@ return "{\"username\":\"" + user.getUsername() + "\"}"; } }

For reference, here's a visual representation of how an HDI chain operates:

HDI Chain

- + \ No newline at end of file diff --git a/flash/core-concepts/handlers.html b/flash/core-concepts/handlers.html index 0978434..11fffdf 100644 --- a/flash/core-concepts/handlers.html +++ b/flash/core-concepts/handlers.html @@ -28,7 +28,7 @@
Skip to content

πŸ“š Handlers ​

In Flash, handlers are the building blocks of your application logic. They are responsible for processing incoming requests, executing the necessary logic, and generating the appropriate response.

There are several types of handlers in Flash, each serving a specific purpose and providing a different level of control over the request lifecycle. Understanding the different handler types will help you structure your application logic more effectively and make the most out of Flash's powerful routing system.

πŸ“¦ Routing Behavior ​

Before diving into the different handler types, it's essential to understand how routing works in Flash. When a request is received by the server, Flash matches the request path and method against the registered routes to find the appropriate handler. The handler is then executed, and its response is sent back to the client.

Flash supports 3 main types of routing behaviors:

  • Literal Routing: Matches the exact path specified in the route definition.
  • Parametrized Routing: Matches paths with dynamic segments that are extracted as route parameters.
  • Dynamic Routing: Matches any path that starts with the specified prefix and is flagged with a wildcard "*" character.

πŸ“Œ Handler Types ​

1. RequestHandler ​

The RequestHandler is the "standard" type of handler in Flash, it provides the most control over the request lifecycle and allows you to define custom logic for handling requests. You can extend the RequestHandler class to create custom handlers that process incoming requests and generate responses.

Because RequestHandler is an abstract class, you need to implement both the handle() method and the super constructor in your custom handler to define the logic that should be executed when a request is received.

Since RequestHandler is an abstract class, you can leverage and chain HDI's to create cleaner and more maintainable route logic (more on that in the Handler Default Implementations guide).

2. SimpleHandler ​

The SimpleHandler is a lightweight handler that allows you to define request handling logic in a single method using lambda notation. It is useful for simple request processing tasks that don't require the full lifecycle control provided by RequestHandler.

To create a SimpleHandler, you can use the server.get(), server.post(), server.put(), server.delete() etc. in general, you can use the server.<METHOD>() methods to register the handler with the server.

The arguments for these methods are the route path and a lambda expression that provides the request and response objects and defines the request handling logic.

java
server.get("/hello", (req, res) -> {
     return "Hello, World!";
 });

Both RequestHandler and SimpleHandler can specify the router behavior by the naming convention of the endpoint used to register the handler.

  • Literal Routing: /hello
    Will match exactly /hello

  • Parametrized Routing: /hello/:name
    Will match /hello/John, /hello/Alice, etc.

  • Dynamic Routing: /hello/*
    Will match /hello/../..

- + \ No newline at end of file diff --git a/flash/core-concepts/request-handler.html b/flash/core-concepts/request-handler.html index 3e532c5..6bbd28c 100644 --- a/flash/core-concepts/request-handler.html +++ b/flash/core-concepts/request-handler.html @@ -37,7 +37,7 @@ return response; } }

WARNING

Any logic that needs to be executed before the request handler is registered must be done within the constructor.

Request Handler methods ​

The RequestHandler class provides several methods that can be used to interact with the request and response objects easily and safely. Following are listed the methods available in the RequestHandler class, with a brief description of their purpose:

MethodParamsDescription
getRequestBody()noneReturns a JSONObject representation of the request body.
getSpecification()noneReturns an instance of HandlerSpecification containing all sorts of information about the handler.
expectedRequestParameter()String name, descriptionReturns an instance of ExpectedRequestParameter for the specified parameter name.
expectedBodyField()String name, descriptionReturns an instance of ExpectedBodyField for the specified field name.
expectedBodyFile()String name, descriptionReturns an instance of ExpectedBodyFile for the specified file name.

(More on the ExpectedRequestParameter, ExpectedBodyField, and ExpectedBodyFile classes in the next section).

- + \ No newline at end of file diff --git a/flash/core-concepts/request-response.html b/flash/core-concepts/request-response.html index 3c8d65a..96278c8 100644 --- a/flash/core-concepts/request-response.html +++ b/flash/core-concepts/request-response.html @@ -92,7 +92,7 @@ return "File saved at: " + myFile.getAbsolutePath(); } }

This time, you will need to use a tool like Postman to send a POST request to /helloFile with a multipart form data body containing a file named myFile. You should receive a response like File saved at: <path> where <path> is the location where the server saved the file.

- + \ No newline at end of file diff --git a/flash/core-concepts/server-router.html b/flash/core-concepts/server-router.html index 9d2afe0..88c9eef 100644 --- a/flash/core-concepts/server-router.html +++ b/flash/core-concepts/server-router.html @@ -49,7 +49,7 @@ return response; } }

In the example above, we create an /api router and register the MyHandler class to handle requests on the /api/hello endpoint.

This is because the path property of the RouteInfo annotation is relative to the base path of the router, which in this case is /api.

Visiting /api/hello from your browser will result in the response Hello, world!.

- + \ No newline at end of file diff --git a/flash/core-concepts/websockets.html b/flash/core-concepts/websockets.html index 095b041..ff9f94f 100644 --- a/flash/core-concepts/websockets.html +++ b/flash/core-concepts/websockets.html @@ -58,7 +58,7 @@ server.start(); } }

Interacting with Websockets sessions ​

The WebSocketSession object provides methods to interact with the Websocket session, such as sending messages, closing the connection, and getting the remote address and session ID.

MethodParamsDescription
getChannel()noneReturns an instance of AsynchronousSocketChannel useful for retrieving info about the client .
getRequestInfo()noneReturns an instance of RequestInfo containing all sorts of information about the request (headers, method, path etc.) .
getPath()noneReturns the path to the websocket endpoint as a String.
getId()noneReturns the id of the websocket session as a String, useful if you want to keep track of the connected clients in a custom manager.
getBuffer()noneReturns the ByteBuffer for that session.
sendMessage()String messageSends the message to the client as a String. it's up to the developer to stringify and de-stringify any data you want to send back and forth
close()noneCloses the websocket session.

NOTE

WebsocketHandler includes a setId(String id) method for overriding the default session ID. Unless you have a specific reason to change it, it's best to leave it as is.

Similarly, the setBuffer(ByteBuffer buffer) method allows you to override the default buffer. If you're unsure about this, it's recommended to keep the default setting.

- + \ No newline at end of file diff --git a/flash/file-serving/dynamic-file-server.html b/flash/file-serving/dynamic-file-server.html index 0cc10c9..422d884 100644 --- a/flash/file-serving/dynamic-file-server.html +++ b/flash/file-serving/dynamic-file-server.html @@ -53,7 +53,7 @@ )); } } - + \ No newline at end of file diff --git a/flash/file-serving/static-file-server.html b/flash/file-serving/static-file-server.html index 9763cb6..cb4290a 100644 --- a/flash/file-serving/static-file-server.html +++ b/flash/file-serving/static-file-server.html @@ -53,7 +53,7 @@ )); } } - + \ No newline at end of file diff --git a/flash/index.html b/flash/index.html index 2426794..b5d0309 100644 --- a/flash/index.html +++ b/flash/index.html @@ -26,7 +26,7 @@
Skip to content

⚑ Flash ​

Flash is a simple, modern and fast expressive web framework written in Java. The project is maintained by Pixel Services and the open-source community.

- + \ No newline at end of file diff --git a/flash/introduction/installation.html b/flash/introduction/installation.html index c5ff8b6..d64ff9f 100644 --- a/flash/introduction/installation.html +++ b/flash/introduction/installation.html @@ -44,7 +44,7 @@ }
  • And the dependency :

    groovy
    dependencies {
         implementation 'com.pixelservices:flash:{{ latestVersion }}'
     }
  • ⚑ Latest version:
    - + \ No newline at end of file diff --git a/hashmap.json b/hashmap.json index c82016d..854cc06 100644 --- a/hashmap.json +++ b/hashmap.json @@ -1 +1 @@ -{"flash_advanced_fullstack-development.md":"DFJ2Nfm_","flash_advanced_handler-default-implementations.md":"CRxyEpV6","flash_core-concepts_handlers.md":"BZuBmBSX","flash_core-concepts_request-handler.md":"fjZWLpOw","flash_core-concepts_request-response.md":"BuTSfkDO","flash_core-concepts_server-router.md":"DIWo49Yl","flash_core-concepts_websockets.md":"ByGVX96c","flash_file-serving_dynamic-file-server.md":"DY_r4ecH","flash_file-serving_static-file-server.md":"BvN0FZB2","flash_index.md":"CAxgiNVz","flash_introduction_installation.md":"BEOKwAAp","index.md":"sDYgKdFh","mobot_index.md":"Be0Zoetq","serverlibraries_index.md":"CeIqSPIs"} +{"flash_advanced_fullstack-development.md":"DFJ2Nfm_","flash_advanced_handler-default-implementations.md":"CRxyEpV6","flash_core-concepts_handlers.md":"BZuBmBSX","flash_core-concepts_request-handler.md":"fjZWLpOw","flash_core-concepts_request-response.md":"BuTSfkDO","flash_core-concepts_server-router.md":"DIWo49Yl","flash_core-concepts_websockets.md":"ByGVX96c","flash_file-serving_dynamic-file-server.md":"DY_r4ecH","flash_file-serving_static-file-server.md":"BvN0FZB2","flash_index.md":"CAxgiNVz","flash_introduction_installation.md":"BEOKwAAp","index.md":"tEfotoPq","mobot_commands_command-arguments.md":"Cuc3b3v9","mobot_commands_creating-a-command.md":"DrPP2R0G","mobot_configuration_custom-configs.md":"BBg-YrVf","mobot_configuration_default-config.md":"CWK17AB-","mobot_configuration_non-yaml-configs.md":"D1wDyLf4","mobot_creating-a-module_module-lifecycle.md":"BfG9RjVD","mobot_creating-a-module_modules-introduction.md":"BWpvzdqx","mobot_events_creating-a-listener.md":"By59Lqsu","mobot_events_events-introduction.md":"cEArHWcq","mobot_index.md":"Bklchsn4","mobot_introduction_installation.md":"D8x3Ns7p","serverlibraries_index.md":"CeIqSPIs"} diff --git a/index.html b/index.html index ac8359e..700c9ef 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@ - + @@ -25,8 +25,8 @@ -
    Skip to content

    Pixel Services Documentation

    Explore the documentation for all public Pixel Services projects




    Our Team ​

    Say hello to the Pixel Services team !

    Relism

    Relism

    Backend Developer

    Sieadev

    Sieadev

    Developer

    - +
    Skip to content

    Pixel Services Documentation

    Explore the documentation for all public Pixel Services projects




    Our Team ​

    Say hello to the Pixel Services team !

    Relism

    Relism

    Backend Developer

    Sieadev

    Sieadev

    Developer

    + \ No newline at end of file diff --git a/mobot/commands/command-arguments.html b/mobot/commands/command-arguments.html new file mode 100644 index 0000000..304ce85 --- /dev/null +++ b/mobot/commands/command-arguments.html @@ -0,0 +1,50 @@ + + + + + + πŸ› οΈ Command Arguments | Pixel Services Docs + + + + + + + + + + + + + + + + + + + + + +
    Skip to content

    πŸ› οΈ Command Arguments ​

    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.

    πŸ“œ @SlashCommandArgument Annotation ​

    The @SlashCommandArgument 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. SlashCommandArgument's can also be stacked, so you can have multiple arguments for a single command.

    Optionally you can add a Map<String, Object> to the method signature to get all arguments as a Map. If you prefer to retrieve the arguments from the event, you can use #event.getOptions().

    OptionDescription
    nameThe name of the argument. This is what users will type to provide the value.
    descriptionA short description of what the argument does.
    typeThe type of the argument. This can be a string, integer, etc.
    requiredWhether the argument is required or optional.
    autoCompleteWhether the argument should be auto-completed.

    Here’s an example of a command with an argument using the @SlashCommandArgument annotation:

    java
    public class MyCommand implements SlashCommandHandler {
    +    @SlashCommand(
    +        name = "greet",
    +        description = "Greet a user"
    +    )
    +    @SlashCommandArgument(
    +        name = "user",
    +        description = "The user to greet",
    +        type = OptionType.USER,
    +        required = true
    +    )
    +    public void onGreetCommand(SlashCommandInteractionEvent event, Map<String, Object> args) {
    +        // Get the user argument
    +        User user = (User) args.get("user");
    +        
    +        // Reply to the command
    +        event.reply("Hello, " + user.getName() + "!").queue();
    +    }
    +}
    + + + + \ No newline at end of file diff --git a/mobot/commands/creating-a-command.html b/mobot/commands/creating-a-command.html new file mode 100644 index 0000000..1d1eda7 --- /dev/null +++ b/mobot/commands/creating-a-command.html @@ -0,0 +1,45 @@ + + + + + + πŸ› οΈ Creating a Command | Pixel Services Docs + + + + + + + + + + + + + + + + + + + + + +
    Skip to content

    πŸ› οΈ Creating a Command ​

    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.

    πŸš€ Commands in the MoBot API ​

    To make commands easy to use, MoBot provides a extensive API for creating and managing commands. Apart from the SlashCommandHandler interface, the SlashCommand System is build entirely from annotations.

    NOTE

    You will have to implement the SlashCommandHandler interface if you want to use @SlashCommand and other annotations.

    πŸ“œ @SlashCommand Annotation ​

    The @SlashCommand 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 SlashCommandInteractionEvent parameter, which contains information about the command invocation and allows you to respond to the user.

    OptionDescription
    nameThe name of the command. This is what users will type to invoke the command.
    descriptionA short description of what the command does.
    aliasesAn array of alternative names for the command.
    permissionsThe permission required to use the command.

    Here’s an example of a simple PingCommand using the @SlashCommand annotation:

    java
    public class PingCommand implements SlashCommandHandler {
    +    @SlashCommand(
    +        name = "ping",
    +        description = "Ping the bot to check if it's alive"
    +    )
    +    public void onPingCommand(SlashCommandInteractionEvent event) {
    +        event.reply("Pong!").queue();
    +    }
    +}

    πŸ› οΈ Registering the Command ​

    To register the command, you need to create an instance of your command class and register it using the #registerSlashCommandHandler method in your module's main class.

    Here's an example of how to register the PingCommand in your module:

    java
    public class MyModule extends MbModule {
    +    @Override
    +    public void onEnable() {
    +        registerSlashCommandHandler(new PingCommand());
    +    }
    +}
    + + + + \ No newline at end of file diff --git a/mobot/configuration/custom-configs.html b/mobot/configuration/custom-configs.html new file mode 100644 index 0000000..15a31da --- /dev/null +++ b/mobot/configuration/custom-configs.html @@ -0,0 +1,32 @@ + + + + + + Pixel Services Docs + + + + + + + + + + + + + + + + + + + + + +
    Skip to content
    + + + + \ No newline at end of file diff --git a/mobot/configuration/default-config.html b/mobot/configuration/default-config.html new file mode 100644 index 0000000..cc59ec4 --- /dev/null +++ b/mobot/configuration/default-config.html @@ -0,0 +1,32 @@ + + + + + + Pixel Services Docs + + + + + + + + + + + + + + + + + + + + + +
    Skip to content
    + + + + \ No newline at end of file diff --git a/mobot/configuration/non-yaml-configs.html b/mobot/configuration/non-yaml-configs.html new file mode 100644 index 0000000..5317bfb --- /dev/null +++ b/mobot/configuration/non-yaml-configs.html @@ -0,0 +1,32 @@ + + + + + + Pixel Services Docs + + + + + + + + + + + + + + + + + + + + + +
    Skip to content
    + + + + \ No newline at end of file diff --git a/mobot/creating-a-module/module-lifecycle.html b/mobot/creating-a-module/module-lifecycle.html new file mode 100644 index 0000000..c4641af --- /dev/null +++ b/mobot/creating-a-module/module-lifecycle.html @@ -0,0 +1,52 @@ + + + + + + πŸ“¦ Module Lifecycle | Pixel Services Docs + + + + + + + + + + + + + + + + + + + + + +
    Skip to content

    πŸ“¦ Module Lifecycle ​

    MoBot modules follow a specific lifecycle to ensure proper initialization, operation, and cleanup. Understanding this lifecycle is crucial for creating reliable and efficient modules.

    πŸ”„ Lifecycle Phases ​

    The lifecycle of a MoBot module consists of several phases, each with its own purpose and responsibilities. Here’s a breakdown of each phase:

    1. Initialization ​

    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's dependencies are resolved, and its configuration is loaded.

    2. Pre-Enable ​

    Before the Discord Bot is fully initialized, the preEnable() method of the module's main class is called. This is where you can perform actions that involve the BotBuilder. This includes stuff like setting the bots status or other tasks that can not be performed after the bot is fully initialized.

    3. Enable ​

    After initialization, the onEnable() method of the module's main class is called. This is where you should set up your module's main functionality, such as registering commands, listeners, or tasks.

    4. Disable ​

    When MoBot shuts down or the module is unloaded, the onDisable() method is called. Use this phase to clean up resources, save data, and gracefully stop any ongoing tasks.

    5. Post-Disable ​

    After the Discord Bot is fully disabled, the postDisable() method of the module's main class is called. You can use this phase to perform any final cleanup tasks that require the bot to be fully disabled.

    NOTE

    All of these methods are optional, and you can choose to implement only the ones you need.

    Usage Example ​

    java
    public class MyModule extends MbModule {
    +    @Override
    +    public void preEnable() {
    +        // Perform actions before the bot is fully initialized
    +    }
    +    
    +    @Override
    +    public void onEnable() {
    +        // Register commands, listeners, etc.
    +    }
    +    
    +    @Override
    +    public void onDisable() {
    +        // Save data, stop tasks, etc.
    +    }
    +
    +    @Override
    +    public void postDisable() {
    +        // Final cleanup tasks
    +    }
    +}

    πŸ› οΈ Cheat Sheet ​

    MethodDescription
    preEnable()Called before the bot is fully initialized. Use this to set up the bot.
    onEnable()Called when the module is enabled. Use this to register commands, listeners, etc.
    onDisable()Called when the module is disabled. Use this to save data, clean up resources etc.
    postDisable()Called after the bot is fully disabled. Use this for final cleanup tasks.
    + + + + \ No newline at end of file diff --git a/mobot/creating-a-module/modules-introduction.html b/mobot/creating-a-module/modules-introduction.html new file mode 100644 index 0000000..1219939 --- /dev/null +++ b/mobot/creating-a-module/modules-introduction.html @@ -0,0 +1,66 @@ + + + + + + 🧩 Creating a Module | Pixel Services Docs + + + + + + + + + + + + + + + + + + + + + +
    Skip to content

    🧩 Creating a Module ​

    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.

    🧠 Prerequisites ​

    Before we begin, make sure you’re comfortable with:

    • Basic Java programming
    • Using Maven (or any preferred Java build tool)
    • Understanding the basics of how MoBot operates

    If you're new to Java or Maven, we recommend checking out a few beginner tutorials first.

    Also, make sure you've reviewed the MoBot Installation Guide to understand how the bot is structured and how modules fit into it.

    🧩 What Makes a Module? ​

    For a module to be recognized and loaded by MoBot, it needs two essential parts:

    1. A Main class that extends MbModule
    2. A module.yml configuration file that defines metadata about the module

    Additionally, you’ll need to include the MoBot API as a dependency in your project.

    πŸ›  Step 1: Set Up Your Maven Project ​

    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're using the command line, you can create a new Maven project with the following command:

    bash
    mvn archetype:generate -DgroupId=com.example -DartifactId=MyModule -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

    This will create a new Maven project looking something like this:

    bash
    MyModule/
    +β”œβ”€β”€ pom.xml
    +└── src/
    +    └── main/
    +        └── java/
    +            └── com/
    +                └── example/
    +                    └── MyModule/
    +                        └── App.java

    Add MoBot API Dependency ​

    To use the MoBot API in your module, you need to add it as a dependency in your pom.xml file. Open the pom.xml file and add the following lines inside the <repositories> and <dependencies> sections:

    xml
    <repository>
    +    <id>pixel-services-releases</id>
    +    <name>Pixel Services</name>
    +    <url>https://maven.pixel-services.com/releases</url>
    +</repository>
    +
    +<dependency>
    +    <groupId>com.pixelservices.mobot</groupId>
    +    <artifactId>mobot-api</artifactId>
    +    <version>VERSION</version> <!-- Replace VERSION -->
    +</dependency>

    Make sure to replace VERSION with the latest version of the MoBot API.

    Latest Version

    🧱 Step 2: Create Your Main Class ​

    Either locate your existing main class or create a new one. This class will be the entry point for your module and should extend MbModule.

    java
    public class MyModule extends MbModule {
    +    @Override
    +    public void onEnable() {
    +        //Do something
    +    }
    +
    +    @Override
    +    public void onDisable() {
    +        //Do something
    +    }
    +}

    πŸ“œ Step 3: Create the module.yml File ​

    The module.yml file contains metadata about your module, such as its name, version, and description. Create a new file named module.yml in the src/main/resources directory of your project.

    yaml
    name: MyModule
    +version: 1.0.0
    +description: This is a sample module for MoBot.
    +main: com.example.MyModule
    +authors: [Your Name]
    +license: MIT
    +depedencies: []

    Explanation of the Fields ​

    • name: The name of your module.
    • version: The version of your module.
    • description: A brief description of your module.
    • main: The fully qualified name of your main class.
    • authors: A list of authors for your module.
    • license: The license under which your module is distributed.
    • dependencies: A list of other modules that your module depends on. This is optional and can be left empty if your module has no dependencies.

    πŸš€ Step 4: Build Your Module ​

    Once you have created your main class and module.yml file, you can build your module using Maven. Open a terminal in the root directory of your project and run the following command:

    bash
    mvn clean package

    This will create a JAR file for your module in the target directory. The JAR file will be named MyModule-1.0.0.jar (or whatever version you specified in the module.yml file).

    Congratulations! You have successfully created a module for MoBot. Now you can load it into your MoBot instance and start using it.

    πŸ”Œ Step 5: Load Your Module into MoBot ​

    To load your module into MoBot, simply place the JAR file you just created into the modules directory of your MoBot instance. When you start MoBot, it will automatically detect and load your module.

    Need help? Join our Discord server for support and to connect with other MoBot users.

    + + + + \ No newline at end of file diff --git a/mobot/events/creating-a-listener.html b/mobot/events/creating-a-listener.html new file mode 100644 index 0000000..5df4f60 --- /dev/null +++ b/mobot/events/creating-a-listener.html @@ -0,0 +1,32 @@ + + + + + + Pixel Services Docs + + + + + + + + + + + + + + + + + + + + + +
    Skip to content
    + + + + \ No newline at end of file diff --git a/mobot/events/events-introduction.html b/mobot/events/events-introduction.html new file mode 100644 index 0000000..b11a9da --- /dev/null +++ b/mobot/events/events-introduction.html @@ -0,0 +1,32 @@ + + + + + + Pixel Services Docs + + + + + + + + + + + + + + + + + + + + + +
    Skip to content
    + + + + \ No newline at end of file diff --git a/mobot/index.html b/mobot/index.html index 3d21e59..ffbc500 100644 --- a/mobot/index.html +++ b/mobot/index.html @@ -3,7 +3,7 @@ - Pixel Services Docs + MoBot | Pixel Services Docs @@ -13,7 +13,7 @@ - + @@ -25,8 +25,8 @@ -
    Skip to content
    - +
    Skip to content

    MoBot ​

    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.

    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.

    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.

    Ready to get started? Follow the Installation guide. Interested in building your own modules? Head over to Creating a Module to learn more.

    + \ No newline at end of file diff --git a/mobot/introduction/installation.html b/mobot/introduction/installation.html new file mode 100644 index 0000000..a0461b0 --- /dev/null +++ b/mobot/introduction/installation.html @@ -0,0 +1,36 @@ + + + + + + πŸ“¦ Installation | Pixel Services Docs + + + + + + + + + + + + + + + + + + + + + +
    Skip to content

    πŸ“¦ Installation ​

    Follow these steps to install and set up MoBot on your machine. MoBot is designed to be easy to install and configure, so you can get started quickly.

    πŸ”§ Requirements ​

    • Java 17 or higher
    • A Discord Bot Token (You can create one by following the instructions below)

    πŸ€– Create a Discord Bot ​

    If you already have a Discord bot, you can skip this step. If you don't have a bot yet, follow these steps to create one:

    Click to expand
    1. Go to the Discord Developer Portal.
    2. Click on the "New Application" button.
    3. Enter a name for your application and click "Create".
    4. In the left sidebar, click on "Bot".
    5. Click on the "Add Bot" button.
    6. Under the "Token" section, click on "Copy" to copy your bot token. Keep this token secret! It is used to authenticate your bot with Discord.
    7. Under the "Privileged Gateway Intents" section, enable the intents you need for your bot. For example, if your bot needs to read messages in channels, enable the "Message Content Intent".
    8. Under the "OAuth2" section, select the "bot" scope and the permissions your bot needs. This will generate a URL that you can use to invite your bot to your server.
    9. Copy the generated URL and paste it into your browser. Select the server you want to invite your bot to and click "Authorize".
    10. Your bot is now created and invited to your server!

    πŸ“₯ Download MoBot ​

    Grab the latest release from the Releases Page.

    1. Go to the Releases Page
    2. Download the latest MoBot.jar file.

    πŸš€ Run MoBot for the First Time ​

    In your terminal, navigate to the directory where you downloaded MoBot.jar and run the following command:

    bash
    java -jar MoBot.jar

    When you run MoBot for the first time, MoBot will ask you for a Discord bot token. You can get your token from the Discord Developer Portal.

    Once you enter your token, MoBot will create a bot.yml file in the same directory. This file contains your bot's configuration settings. Additionally, MoBot will create a modules directory where you can place your custom modules.

    It should look something like this:

    bash
    mobot/
    +β”œβ”€β”€ MoBot.jar
    +β”œβ”€β”€ bot.yml
    +└── modules/

    βš™οΈ Configure MoBot ​

    Open the bot.yml file in a text editor. This file contains the configuration settings for your bot. You can customize various settings, such as:

    • Token: Your Discord bot token.
    • Gateway Intents: The intents your bot will use. You can add or remove intents as needed.
    • Check Updates: Whether to check for updates on startup.

    Depending on what modules you have installed, you may need to enable specific intents. For example, if you have a module that requires the GUILD_MEMBERS intent, you need to add it in the bot.yml file.

    yaml
    intents:
    +  - GUILD_MEMBERS

    πŸ”Œ Install Modules ​

    As of today, there is no official MoBot module repository. However, you can find some community modules on our Discord. To install a module, simply place the module's .jar file in the modules directory. MoBot will automatically load the module on startup.

    You can also create your own modules! Check out the Creating a Module section for more information on how to create and manage your own modules.

    βœ… Start the Bot ​

    Once you have configured your bot and installed any necessary modules, you can start the bot by running the following command in your terminal:

    bash
    java -jar MoBot.jar

    You should see logs indicating that the bot and any modules have been loaded successfully.

    Need help? Join our Discord server for support and to connect with other MoBot users.

    + + + + \ No newline at end of file diff --git a/serverlibraries/index.html b/serverlibraries/index.html index 99bef75..d923d98 100644 --- a/serverlibraries/index.html +++ b/serverlibraries/index.html @@ -26,7 +26,7 @@
    Skip to content
    - + \ No newline at end of file