java.lang.Object
net.dv8tion.jda.api.hooks.ListenerAdapter
de.chojo.jdautil.interactions.dispatching.InteractionHub<C,M,U>
- All Implemented Interfaces:
EventListener
public class InteractionHub<C extends Slash, M extends Message, U extends User>
extends ListenerAdapter
-
Constructor Summary
ConstructorsConstructorDescriptionInteractionHub(ShardManager shardManager, Map<String, C> slash, Map<String, M> messages, Map<String, U> users, ConversationService conversationService, ILocalizer localizer, BiConsumer<InteractionContext, Throwable> commandErrorHandler, MenuService buttons, PageService pages, ModalService modalService, Consumer<InteractionResult> postCommandHook, Function<InteractionMeta, List<Long>> guildCommandMapper, Function<InteractionMeta, Map<Long, String>> aliasMapper, boolean cleanGuildCommands, boolean testMode, String premiumErrorMessage, SKUConfiguration skuConfiguration, BiFunction<User, Guild, List<SKU>> entitlementProvider) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Slash, M extends Message, U extends User>
InteractionHubBuilder<T, M, U> builder(ShardManager shardManager) Future of the command deployment started when the hub was built.getMessage(String name) getSlash()getUser()voidonCommandAutoCompleteInteraction(@NotNull CommandAutoCompleteInteractionEvent event) voidonGuildJoin(@NotNull GuildJoinEvent event) voidonMessageContextInteraction(@NotNull MessageContextInteractionEvent event) voidonMessageReceived(@NotNull MessageReceivedEvent event) voidonSlashCommandInteraction(@NotNull SlashCommandInteractionEvent event) voidonUserContextInteraction(@NotNull UserContextInteractionEvent event) voidrefreshGuildCommands(Guild guild) Rebuilds and deploys the guild commands of a guild, including its aliases.Methods inherited from class ListenerAdapter
onApplicationCommandUpdatePrivileges, onApplicationUpdatePrivileges, onAutoModExecution, onAutoModRuleCreate, onAutoModRuleDelete, onAutoModRuleUpdate, onButtonInteraction, onChannelCreate, onChannelDelete, onChannelUpdateAppliedTags, onChannelUpdateArchived, onChannelUpdateArchiveTimestamp, onChannelUpdateAutoArchiveDuration, onChannelUpdateBitrate, onChannelUpdateDefaultLayout, onChannelUpdateDefaultReaction, onChannelUpdateDefaultSortOrder, onChannelUpdateDefaultThreadSlowmode, onChannelUpdateFlags, onChannelUpdateInvitable, onChannelUpdateLocked, onChannelUpdateName, onChannelUpdateNSFW, onChannelUpdateParent, onChannelUpdatePosition, onChannelUpdateRegion, onChannelUpdateSlowmode, onChannelUpdateTopic, onChannelUpdateType, onChannelUpdateUserLimit, onChannelUpdateVoiceStatus, onEmojiAdded, onEmojiRemoved, onEmojiUpdateName, onEmojiUpdateRoles, onEntitlementCreate, onEntitlementDelete, onEntitlementUpdate, onEntitySelectInteraction, onEvent, onException, onForumTagAdd, onForumTagRemove, onForumTagUpdateEmoji, onForumTagUpdateModerated, onForumTagUpdateName, onGatewayPing, onGenericAutoCompleteInteraction, onGenericAutoModRule, onGenericChannel, onGenericChannelUpdate, onGenericCommandInteraction, onGenericComponentInteractionCreate, onGenericContextInteraction, onGenericEmoji, onGenericEmojiUpdate, onGenericEntitlement, onGenericEvent, onGenericForumTag, onGenericForumTagUpdate, onGenericGuild, onGenericGuildInvite, onGenericGuildMember, onGenericGuildMemberUpdate, onGenericGuildSticker, onGenericGuildStickerUpdate, onGenericGuildUpdate, onGenericGuildVoice, onGenericInteractionCreate, onGenericMessage, onGenericMessagePollVote, onGenericMessageReaction, onGenericPermissionOverride, onGenericPrivilegeUpdate, onGenericRole, onGenericRoleUpdate, onGenericScheduledEventGateway, onGenericScheduledEventUpdate, onGenericScheduledEventUser, onGenericSelectMenuInteraction, onGenericSelfUpdate, onGenericSession, onGenericSoundboardSound, onGenericSoundboardSoundUpdate, onGenericStageInstance, onGenericStageInstanceUpdate, onGenericThread, onGenericThreadMember, onGenericUpdate, onGenericUser, onGenericUserPresence, onGenericUserUpdate, onGuildAuditLogEntryCreate, onGuildAvailable, onGuildBan, onGuildInviteCreate, onGuildInviteDelete, onGuildLeave, onGuildMemberJoin, onGuildMemberRemove, onGuildMemberRoleAdd, onGuildMemberRoleRemove, onGuildMemberUpdate, onGuildMemberUpdateAvatar, onGuildMemberUpdateBanner, onGuildMemberUpdateBoostTime, onGuildMemberUpdateFlags, onGuildMemberUpdateNickname, onGuildMemberUpdatePending, onGuildMemberUpdateTimeOut, onGuildReady, onGuildStickerAdded, onGuildStickerRemoved, onGuildStickerUpdateAvailable, onGuildStickerUpdateDescription, onGuildStickerUpdateName, onGuildStickerUpdateTags, onGuildTimeout, onGuildUnavailable, onGuildUnban, onGuildUpdateAfkChannel, onGuildUpdateAfkTimeout, onGuildUpdateBanner, onGuildUpdateBoostCount, onGuildUpdateBoostTier, onGuildUpdateCommunityUpdatesChannel, onGuildUpdateDescription, onGuildUpdateExplicitContentLevel, onGuildUpdateFeatures, onGuildUpdateIcon, onGuildUpdateLocale, onGuildUpdateMaxMembers, onGuildUpdateMaxPresences, onGuildUpdateMFALevel, onGuildUpdateName, onGuildUpdateNotificationLevel, onGuildUpdateNSFWLevel, onGuildUpdateOwner, onGuildUpdateRulesChannel, onGuildUpdateSafetyAlertsChannel, onGuildUpdateSecurityIncidentActions, onGuildUpdateSecurityIncidentDetections, onGuildUpdateSplash, onGuildUpdateSystemChannel, onGuildUpdateSystemChannelFlags, onGuildUpdateVanityCode, onGuildUpdateVerificationLevel, onGuildVoiceDeafen, onGuildVoiceGuildDeafen, onGuildVoiceGuildMute, onGuildVoiceMute, onGuildVoiceRequestToSpeak, onGuildVoiceSelfDeafen, onGuildVoiceSelfMute, onGuildVoiceStream, onGuildVoiceSuppress, onGuildVoiceUpdate, onGuildVoiceVideo, onHttpRequest, onMessageBulkDelete, onMessageDelete, onMessagePollVoteAdd, onMessagePollVoteRemove, onMessageReactionAdd, onMessageReactionRemove, onMessageReactionRemoveAll, onMessageReactionRemoveEmoji, onMessageUpdate, onModalInteraction, onPermissionOverrideCreate, onPermissionOverrideDelete, onPermissionOverrideUpdate, onRawGateway, onReady, onRoleCreate, onRoleDelete, onRoleUpdateColor, onRoleUpdateColors, onRoleUpdateHoisted, onRoleUpdateIcon, onRoleUpdateMentionable, onRoleUpdateName, onRoleUpdatePermissions, onRoleUpdatePosition, onScheduledEventCreate, onScheduledEventDelete, onScheduledEventUpdateCoverImage, onScheduledEventUpdateDescription, onScheduledEventUpdateEndTime, onScheduledEventUpdateImage, onScheduledEventUpdateLocation, onScheduledEventUpdateName, onScheduledEventUpdateStartTime, onScheduledEventUpdateStatus, onScheduledEventUserAdd, onScheduledEventUserRemove, onSelfUpdateAvatar, onSelfUpdateDiscriminator, onSelfUpdateGlobalName, onSelfUpdateMFA, onSelfUpdateName, onSelfUpdateVerified, onSessionDisconnect, onSessionInvalidate, onSessionRecreate, onSessionResume, onShutdown, onSoundboardSoundCreate, onSoundboardSoundDelete, onSoundboardSoundUpdateEmoji, onSoundboardSoundUpdateName, onSoundboardSoundUpdateVolume, onStageInstanceCreate, onStageInstanceDelete, onStageInstanceUpdatePrivacyLevel, onStageInstanceUpdateTopic, onStatusChange, onStringSelectInteraction, onThreadHidden, onThreadMemberJoin, onThreadMemberLeave, onThreadRevealed, onUnavailableGuildJoined, onUnavailableGuildLeave, onUserActivityEnd, onUserActivityStart, onUserTyping, onUserUpdateActivities, onUserUpdateActivityOrder, onUserUpdateAvatar, onUserUpdateDiscriminator, onUserUpdateFlags, onUserUpdateGlobalName, onUserUpdateName, onUserUpdateOnlineStatus, onUserUpdatePrimaryGuild, onVoiceChannelEffectSend
-
Constructor Details
-
Method Details
-
builder
public static <T extends Slash, M extends Message, U extends User> InteractionHubBuilder<T,M, builderU> (ShardManager shardManager) -
onMessageContextInteraction
- Overrides:
onMessageContextInteractionin classListenerAdapter
-
onUserContextInteraction
- Overrides:
onUserContextInteractionin classListenerAdapter
-
onSlashCommandInteraction
- Overrides:
onSlashCommandInteractionin classListenerAdapter
-
onCommandAutoCompleteInteraction
public void onCommandAutoCompleteInteraction(@NotNull @NotNull CommandAutoCompleteInteractionEvent event) - Overrides:
onCommandAutoCompleteInteractionin classListenerAdapter
-
onGuildJoin
- Overrides:
onGuildJoinin classListenerAdapter
-
deployment
Future of the command deployment started when the hub was built.- Returns:
- future completing once every command is deployed
-
refreshGuildCommands
Rebuilds and deploys the guild commands of a guild, including its aliases.Blocks until discord accepted the commands. Only waits for a deployment running on the same guild.
- Parameters:
guild- guild to refresh
-
onMessageReceived
- Overrides:
onMessageReceivedin classListenerAdapter
-
getSlash
-
getMessage
-
getUser
-
getSlash
-
getUser
-
getMessage
-
buttonService
-
pageServices
-
modalService
-
conversationService
-