Skip to content

Pixel-Services/MoBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

MoBot is a modular bot framework for Discord. It allows developers to create, extend, and manage custom modules that hook into the bot to add rich, interactive features.


📋 Table of Contents

Setup Project

To create a module for MoBot, follow these steps:

  1. Create a Java Project (Maven/Gradle):
  • Maven: Add the MoBot dependency in pom.xml:

    <dependency>
        <groupId>net.vitacraft</groupId>
        <artifactId>MoBot</artifactId>
        <version>VERSION</version> <!-- Replace VERSION -->
    </dependency>
  • Gradle: Add the dependency in build.gradle:

    dependencies {
        implementation "net.vitacraft:MoBot:VERSION"  // Replace VERSION
    }

Find the latest version here.

  1. Create Main Module Class: Extend the MBModule class:

    public class WelcomeModule extends MBModule {
        @Override
        public void onEnable() {
            getLogger().info("WelcomeModule enabled!");
        }
    
        @Override
        public void onDisable() {
            getLogger().info("WelcomeModule disabled!");
        }
    }
  2. Create Service File: Create resources/META-INF/services/net.vitacraft.api.MBModule, and to this file add one line to it: the fully qualified name of your main module class, for example:

    com.example.WelcomeModule
    

Installation

  1. Install MoBot by adding it as a dependency in your Maven or Gradle project (see the Setup Project section).

  2. Create bot.yml file inside the resources folder to configure your bot:

    name: WelcomeModule
    version: '1.0.0'
    description: A Test Module
    dependencies: []
    authors: [Your Name]
    priority: DEFAULT

Creating a Module

  1. Extend MBModule: In your Java class, override onEnable() and onDisable():

    public class WelcomeModule extends MBModule {
        @Override
        public void onEnable() {
            getLogger().info("Module enabled!");
        }
    
        @Override
        public void onDisable() {
            getLogger().info("Module disabled!");
        }
    }