Package com.jagrosh.jdautilities.command
Interface GuildSettingsManager<T>
- Type Parameters:
T
- The specific type of the settings object.
public interface GuildSettingsManager<T>
An implementable frame for classes that handle Guild-Specific
settings.
Standard implementations should be able to simply provide a
type of Object
provided a non-null
Guild
. Further
customization of the implementation is allowed on the developer
end.
- Since:
- 2.0
- Author:
- Kaidan Gustave
- Implementation Note:
- Unless in the event of a major breaking change to
JDA, there is no chance of implementations of this
interface being required to implement additional
methods.
If in the future it is decided to add a method to this interface, the method will have a default implementation that doesn't require developer additions.
-
Method Summary
Modifier and TypeMethodDescriptiongetSettings
(net.dv8tion.jda.api.entities.Guild guild) Gets settings for a specifiedGuild
as an object of the specified typeT
, ornull
if the guild has no settings.default void
init()
Called when JDA has fired aReadyEvent
.default void
shutdown()
Called when JDA has fired aShutdownEvent
.
-
Method Details
-
getSettings
Gets settings for a specifiedGuild
as an object of the specified typeT
, ornull
if the guild has no settings.- Parameters:
guild
- The guild to get settings for.- Returns:
- The settings object for the guild, or
null
if the guild has no settings.
-
init
default void init()Called when JDA has fired aReadyEvent
.Developers should implement this method to create or initialize resources when starting their bot.
-
shutdown
default void shutdown()Called when JDA has fired aShutdownEvent
.Developers should implement this method to free up or close resources when shutting their bot.
-