Package net.bonn2.modules.settings
Class Settings
java.lang.Object
net.bonn2.modules.Module
net.bonn2.modules.settings.Settings
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SettingGet the value of aSetting, or a default valuenet.dv8tion.jda.api.interactions.commands.build.CommandData[]getDescriptions(String module) getName()static Map<String,Setting.Type> getRegisteredSettings(String module) static Setting.TypegetRegisteredSettingType(Module module, String key) getSettings(@NotNull Module module) static booleanhasSetting(@NotNull Module module, String key) Check if a setting is registeredvoidload()static voidstatic intregisteredSettingsCount(@NotNull Module module) voidvoidstatic booleanstatic booleanstatic booleanstatic booleanSets aSettingback to the default.Methods inherited from class net.bonn2.modules.Module
getAuthor, getDepends, getDescription
-
Constructor Details
-
Settings
public Settings()
-
-
Method Details
-
getName
-
getVersion
- Overrides:
getVersionin classModule
-
registerLoggingChannels
public void registerLoggingChannels()- Specified by:
registerLoggingChannelsin classModule
-
registerSettings
public void registerSettings()- Specified by:
registerSettingsin classModule
-
load
public void load() -
getCommands
public net.dv8tion.jda.api.interactions.commands.build.CommandData[] getCommands()- Specified by:
getCommandsin classModule
-
register
public static void register(@NotNull @NotNull Module module, String key, Setting.Type type, String unSet, String description) -
getRegisteredSettings
-
getDescriptions
-
set
-
set
-
set
-
unSet
Sets aSettingback to the default. As if it was never set. -
get
Get the value of aSetting, or a default value- Parameters:
module- The module theSettingis registered tokey- The key to theSetting- Returns:
- The
Settingof the registered value, or anIntSettingof value 0 if unregistered
-
registeredSettingsCount
-
hasSetting
Check if a setting is registered- Parameters:
module- The module the setting is registered tokey- The key to the setting- Returns:
- True if the setting is registered, false if it isn't
-
getRegisteredSettingType
-
getSettings
-