Class Module

java.lang.Object
com.gmt2001.module.Module
Direct Known Subclasses:
CoreModule

public abstract class Module extends Object
A bot module written in Java
Author:
gmt2001
  • Constructor Details

    • Module

      public Module()
  • Method Details

    • onLoad

      public void onLoad()
      Executes immediately after loading this module
    • afterLoad

      public void afterLoad()
      Executes after all models have been loaded
    • defaultEnabledState

      public boolean defaultEnabledState()
      Indicates the default enabled state of the module on a new installation
      Returns:
      true if the module should be enabled
    • isEnabled

      public final boolean isEnabled()
      Indicates if this module is currently enabled
      Returns:
      true if enabled
    • onEnable

      public void onEnable()
      Executes when the module state changes to enabled

      Also executes after afterLoad() if the initialization state of the module is enabled

    • onDisable

      public void onDisable()
      Executes when the module state changes to disabled

      Also executes after afterLoad() if the initialization state of the module is disabled

    • onEvent

      public void onEvent(Event event)
      Receives all events except for IrcModerationEvent, CommandEvent, and DiscordChannelCommandEvent
      Parameters:
      event - the event data
    • onIRCModerationEvent

      public void onIRCModerationEvent(IrcModerationEvent event)
      Parameters:
      event - the event data
    • onCommandEvent

      public boolean onCommandEvent(CommandEvent event)
      Receives CommandEvent

      If false is returned, command cost/reward are undone

      Parameters:
      event - the event data
      Returns:
      true if the command was handled successfully
    • onDiscordChannelCommandEvent

      public boolean onDiscordChannelCommandEvent(DiscordChannelCommandEvent event)
      Receives DiscordChannelCommandEvent

      If false is returned, command cost/reward are undone

      Parameters:
      event - the event data
      Returns:
      true if the command was handled successfully