Interface DeleteModule
- All Superinterfaces:
ModuleLocalization, ModuleSimple
Lets a moderator withdraw a message that was already delivered, and keeps the history needed to do so.
-
Method Summary
Modifier and TypeMethodDescriptionaddTag(MessageContext messageContext) Registers the tag that draws the withdraw button.voidclearHistory(FPlayer fPlayer) Forgets every message held for a player, so none of them can be withdrawn any more.config()The config section this module reads its settings from.booleanisCached(net.kyori.adventure.text.Component component) Whether a rendered message is one this module is holding.localization(FPlayer fPlayer) The localization section for a player, picked from their chosen language.The permission that gates this module.booleanWithdraws a message from everyone who received it.voidremoveCache(net.kyori.adventure.text.Component component) Forgets a held message.voidsave(FPlayer receiver, UUID messageUUID, net.kyori.adventure.text.Component component, boolean needToCache) Remembers a delivered message so it can be withdrawn later.voidsendUpdate(UUID receiver) Redraws a reader's chat after something was withdrawn.Methods inherited from interface ModuleLocalization
cooldown, cooldownOrThrow, permissions, sound, soundOrThrow
-
Method Details
-
config
Message.Format.Moderation.Delete config()Description copied from interface:ModuleSimpleThe config section this module reads its settings from.- Specified by:
configin interfaceModuleSimple- Returns:
- the settings
-
permission
Permission.Message.Format.Moderation.Delete permission()Description copied from interface:ModuleSimpleThe permission that gates this module.- Specified by:
permissionin interfaceModuleSimple- Returns:
- the permission
-
localization
Description copied from interface:ModuleLocalizationThe localization section for a player, picked from their chosen language.- Specified by:
localizationin interfaceModuleLocalization- Parameters:
fPlayer- the player the text is for- Returns:
- the localization settings
-
clearHistory
Forgets every message held for a player, so none of them can be withdrawn any more.- Parameters:
fPlayer- the player
-
addTag
Registers the tag that draws the withdraw button.- Parameters:
messageContext- the message being formatted- Returns:
- the context with the tag added
-
save
void save(FPlayer receiver, UUID messageUUID, net.kyori.adventure.text.Component component, boolean needToCache) Remembers a delivered message so it can be withdrawn later.- Parameters:
receiver- who received itmessageUUID- the message idcomponent- the rendered messageneedToCache- whether to keep the rendered form, which is only needed on some platforms
-
isCached
boolean isCached(net.kyori.adventure.text.Component component) Whether a rendered message is one this module is holding.- Parameters:
component- the rendered message- Returns:
- true if it is held
-
removeCache
void removeCache(net.kyori.adventure.text.Component component) Forgets a held message.- Parameters:
component- the rendered message
-
remove
-
sendUpdate
Redraws a reader's chat after something was withdrawn.- Parameters:
receiver- the reader
-