Skip to content

Main Class

Francisco Solis edited this page Jul 18, 2021 · 3 revisions

How to use the DiscordBotBase

We assume that you're using java for the development of the bot.

Create a new class and then extend it to cl.franciscosolis.discordbotbase.DiscordBotBase. Then you must override the method getVersion, specify your bot version and add your package to the packages list so it can load all the modules and commands, after that make sure to execute this.init() in your main class so the bot can be initialized.

After all that your main class should be something like this:

package cl.franciscosolis.discordbot;

import cl.franciscosolis.discordbotbase.DiscordBotBase;

public class Main extends DiscordBot{

    public static void main(String[] args){ new DiscordBot(); }

    public DiscordBot(){
        this.packages.add("cl.franciscosolis.discordbot");
        this.init();
    }

    public String getVersion(){
        return "1.0-SNAPSHOT";
    }
}

Clone this wiki locally