1.0.0 release
This commit is contained in:
		
							parent
							
								
									c2fcc1cee0
								
							
						
					
					
						commit
						68194b3879
					
				@ -8,7 +8,7 @@ plugins {
 | 
				
			|||||||
mainClassName = 'tech.nevets.modbot.CoreBot'
 | 
					mainClassName = 'tech.nevets.modbot.CoreBot'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
group 'tech.nevets'
 | 
					group 'tech.nevets'
 | 
				
			||||||
version '0.1.0-beta'
 | 
					version '1.0.0'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sourceCompatibility = JavaVersion.VERSION_17
 | 
					sourceCompatibility = JavaVersion.VERSION_17
 | 
				
			||||||
targetCompatibility = JavaVersion.VERSION_17
 | 
					targetCompatibility = JavaVersion.VERSION_17
 | 
				
			||||||
 | 
				
			|||||||
@ -18,6 +18,7 @@ public class CoreBot {
 | 
				
			|||||||
    public static JDA jda;
 | 
					    public static JDA jda;
 | 
				
			||||||
    public static final Config CORE_CONFIG = new Config("core");
 | 
					    public static final Config CORE_CONFIG = new Config("core");
 | 
				
			||||||
    public static final List<ListenerAdapter> PLUGIN_LISTENERS = new ArrayList<>();
 | 
					    public static final List<ListenerAdapter> PLUGIN_LISTENERS = new ArrayList<>();
 | 
				
			||||||
 | 
					    private static String botPrefix;
 | 
				
			||||||
    private static List<BotModule> modules;
 | 
					    private static List<BotModule> modules;
 | 
				
			||||||
    private static final Logger LOGGER = LoggerFactory.getLogger(CoreBot.class);
 | 
					    private static final Logger LOGGER = LoggerFactory.getLogger(CoreBot.class);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -25,6 +26,7 @@ public class CoreBot {
 | 
				
			|||||||
        setLoggingLevel(Level.INFO);
 | 
					        setLoggingLevel(Level.INFO);
 | 
				
			||||||
        CORE_CONFIG.addDefaults(getDefaults());
 | 
					        CORE_CONFIG.addDefaults(getDefaults());
 | 
				
			||||||
        CORE_CONFIG.loadConfig();
 | 
					        CORE_CONFIG.loadConfig();
 | 
				
			||||||
 | 
					        botPrefix = CORE_CONFIG.getConfig().getString("bot.prefix");
 | 
				
			||||||
        modules = ModuleLoader.loadModules();
 | 
					        modules = ModuleLoader.loadModules();
 | 
				
			||||||
        CoreListener coreListener = new CoreListener();
 | 
					        CoreListener coreListener = new CoreListener();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -33,6 +35,7 @@ public class CoreBot {
 | 
				
			|||||||
                .addEventListeners(coreListener);
 | 
					                .addEventListeners(coreListener);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for (ListenerAdapter listener : PLUGIN_LISTENERS) {
 | 
					        for (ListenerAdapter listener : PLUGIN_LISTENERS) {
 | 
				
			||||||
 | 
					            LOGGER.error("Loaded Plugin listener");
 | 
				
			||||||
            builder.addEventListeners(listener);
 | 
					            builder.addEventListeners(listener);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -67,8 +70,12 @@ public class CoreBot {
 | 
				
			|||||||
        return defaults;
 | 
					        return defaults;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static void setLoggingLevel(Level level) {
 | 
					    private static void setLoggingLevel(Level level) {
 | 
				
			||||||
        ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
 | 
					        ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
 | 
				
			||||||
        root.setLevel(level);
 | 
					        root.setLevel(level);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public static String getPrefix() {
 | 
				
			||||||
 | 
					        return botPrefix;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -40,7 +40,7 @@ public class CoreListener extends ListenerAdapter {
 | 
				
			|||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (raw.startsWith(CoreBot.CORE_CONFIG.getConfig().getString("bot.prefix"))) {
 | 
					        if (raw.startsWith(CoreBot.getPrefix())) {
 | 
				
			||||||
            registry.handle(event);
 | 
					            registry.handle(event);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user