Package dev.sympho.bot_utils.component
Class ModalManager
java.lang.Object
dev.sympho.bot_utils.component.ComponentManager<ModalSubmitInteractionEvent,ModalEventContext,ModalManager.HandlerFunction,ModalManager.Handler>
dev.sympho.bot_utils.component.ModalManager
@Enclosing
public class ModalManager
extends ComponentManager<ModalSubmitInteractionEvent,ModalEventContext,ModalManager.HandlerFunction,ModalManager.Handler>
Centralized manager for modal submission handling.
- Since:
- 1.0
- Version:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceSpecification for the handling of a modal submission.static interfaceA function used to handle a modal submit event. -
Field Summary
Fields inherited from class dev.sympho.bot_utils.component.ComponentManager
logger -
Constructor Summary
ConstructorsConstructorDescriptionModalManager(GatewayDiscordClient client, AccessManager accessManager) Creates a new manager that receives interactions from the given client. -
Method Summary
Modifier and TypeMethodDescriptionprotected Class<ModalSubmitInteractionEvent>Retrieves the interaction event type.protected ModalEventContextmakeContext(ModalSubmitInteractionEvent event, AccessManager accessManager) Creates the interaction context.static StringCreates a custom ID for a modal with arguments in a format that is compatible with this manager.Methods inherited from class dev.sympho.bot_utils.component.ComponentManager
register, registerAll, reportFailure, runHandler, sourceField, start, stop, unregister
-
Constructor Details
-
ModalManager
Creates a new manager that receives interactions from the given client.- Parameters:
client- The client to receive interactions from.accessManager- The access manager to use.
-
-
Method Details
-
makeId
Creates a custom ID for a modal with arguments in a format that is compatible with this manager.- Parameters:
id- The modal handler ID.args- The interaction arguments.- Returns:
- The assembled custom ID.
-
getEventType
Description copied from class:ComponentManagerRetrieves the interaction event type.- Specified by:
getEventTypein classComponentManager<ModalSubmitInteractionEvent,ModalEventContext, ModalManager.HandlerFunction, ModalManager.Handler> - Returns:
- The interaction event type.
-
makeContext
protected ModalEventContext makeContext(ModalSubmitInteractionEvent event, AccessManager accessManager) Description copied from class:ComponentManagerCreates the interaction context.- Specified by:
makeContextin classComponentManager<ModalSubmitInteractionEvent,ModalEventContext, ModalManager.HandlerFunction, ModalManager.Handler> - Parameters:
event- The interaction event.accessManager- The access manager.- Returns:
- The created context.
-