Class SlashMusicCommands
java.lang.Object
net.dv8tion.jda.api.hooks.ListenerAdapter
dev.jacrispys.JavaBot.commands.audio.SlashMusicCommands
- All Implemented Interfaces:
net.dv8tion.jda.api.hooks.EventListener
public class SlashMusicCommands
extends net.dv8tion.jda.api.hooks.ListenerAdapter
New solution to commands, registers slash commands for audio and handles their implementations
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinitCommands(List<net.dv8tion.jda.api.entities.Guild> guilds) Registers guild specific commands (unused)voidonReady(@NotNull net.dv8tion.jda.api.events.session.ReadyEvent event) Accounts for stages running after rebootvoidonSlashCommandInteraction(@NotNull net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent event) Handles implementation for all registered audio slash commandsvoidonStageInstanceCreate(@NotNull net.dv8tion.jda.api.events.stage.StageInstanceCreateEvent event) Checks for stage instances being created, to allow bot to join stages and play musicvoidonStageInstanceDelete(@NotNull net.dv8tion.jda.api.events.stage.StageInstanceDeleteEvent event) Removes compatibility for stage channels once the instance is deletedprotected voidupdateGuildCommands(net.dv8tion.jda.api.entities.Guild guild) List<net.dv8tion.jda.api.interactions.commands.build.CommandData>Generates a list of commands to be updatedListenerAdapter.onReady(ReadyEvent)protected voidupdateMusicChannel(net.dv8tion.jda.api.entities.Guild guild, net.dv8tion.jda.api.entities.channel.middleman.GuildMessageChannel channel) Internal updates to DatabaseMethods inherited from class net.dv8tion.jda.api.hooks.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, onCommandAutoCompleteInteraction, onEmojiAdded, onEmojiRemoved, onEmojiUpdateName, onEmojiUpdateRoles, onEntitySelectInteraction, onEvent, onException, onForumTagAdd, onForumTagRemove, onForumTagUpdateEmoji, onForumTagUpdateModerated, onForumTagUpdateName, onGatewayPing, onGenericAutoCompleteInteraction, onGenericAutoModRule, onGenericChannel, onGenericChannelUpdate, onGenericCommandInteraction, onGenericComponentInteractionCreate, onGenericContextInteraction, onGenericEmoji, onGenericEmojiUpdate, onGenericEvent, onGenericForumTag, onGenericForumTagUpdate, onGenericGuild, onGenericGuildInvite, onGenericGuildMember, onGenericGuildMemberUpdate, onGenericGuildSticker, onGenericGuildStickerUpdate, onGenericGuildUpdate, onGenericGuildVoice, onGenericInteractionCreate, onGenericMessage, onGenericMessageReaction, onGenericPermissionOverride, onGenericPrivilegeUpdate, onGenericRole, onGenericRoleUpdate, onGenericScheduledEventGateway, onGenericScheduledEventUpdate, onGenericScheduledEventUser, onGenericSelectMenuInteraction, onGenericSelfUpdate, onGenericSession, onGenericSessionEvent, onGenericStageInstance, onGenericStageInstanceUpdate, onGenericThread, onGenericThreadMember, onGenericUpdate, onGenericUser, onGenericUserPresence, onGenericUserUpdate, onGuildAuditLogEntryCreate, onGuildAvailable, onGuildBan, onGuildInviteCreate, onGuildInviteDelete, onGuildJoin, onGuildLeave, onGuildMemberJoin, onGuildMemberRemove, onGuildMemberRoleAdd, onGuildMemberRoleRemove, onGuildMemberUpdate, onGuildMemberUpdateAvatar, 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, onGuildUpdateSplash, onGuildUpdateSystemChannel, onGuildUpdateVanityCode, onGuildUpdateVerificationLevel, onGuildVoiceDeafen, onGuildVoiceGuildDeafen, onGuildVoiceGuildMute, onGuildVoiceMute, onGuildVoiceRequestToSpeak, onGuildVoiceSelfDeafen, onGuildVoiceSelfMute, onGuildVoiceStream, onGuildVoiceSuppress, onGuildVoiceUpdate, onGuildVoiceVideo, onHttpRequest, onMessageBulkDelete, onMessageContextInteraction, onMessageDelete, onMessageEmbed, onMessageReactionAdd, onMessageReactionRemove, onMessageReactionRemoveAll, onMessageReactionRemoveEmoji, onMessageReceived, onMessageUpdate, onModalInteraction, onPermissionOverrideCreate, onPermissionOverrideDelete, onPermissionOverrideUpdate, onRawGateway, onRoleCreate, onRoleDelete, onRoleUpdateColor, onRoleUpdateHoisted, onRoleUpdateIcon, onRoleUpdateMentionable, onRoleUpdateName, onRoleUpdatePermissions, onRoleUpdatePosition, onScheduledEventCreate, onScheduledEventDelete, onScheduledEventUpdateDescription, onScheduledEventUpdateEndTime, onScheduledEventUpdateImage, onScheduledEventUpdateLocation, onScheduledEventUpdateName, onScheduledEventUpdateStartTime, onScheduledEventUpdateStatus, onScheduledEventUserAdd, onScheduledEventUserRemove, onSelfUpdateAvatar, onSelfUpdateGlobalName, onSelfUpdateMFA, onSelfUpdateName, onSelfUpdateVerified, onSessionDisconnect, onSessionInvalidate, onSessionRecreate, onSessionResume, onShutdown, onStageInstanceUpdatePrivacyLevel, onStageInstanceUpdateTopic, onStatusChange, onStringSelectInteraction, onThreadHidden, onThreadMemberJoin, onThreadMemberLeave, onThreadRevealed, onUnavailableGuildJoined, onUnavailableGuildLeave, onUserActivityEnd, onUserActivityStart, onUserContextInteraction, onUserTyping, onUserUpdateActivities, onUserUpdateActivityOrder, onUserUpdateAvatar, onUserUpdateDiscriminator, onUserUpdateFlags, onUserUpdateGlobalName, onUserUpdateName, onUserUpdateOnlineStatus
-
Field Details
-
stageInstance
public static net.dv8tion.jda.api.entities.StageInstance stageInstance
-
-
Constructor Details
-
SlashMusicCommands
public SlashMusicCommands()
-
-
Method Details
-
initCommands
Registers guild specific commands (unused)- Parameters:
guilds- list of guilds to update commands for
-
updateJdaCommands
Generates a list of commands to be updatedListenerAdapter.onReady(ReadyEvent)- Returns:
- the list of Commands
-
updateGuildCommands
protected void updateGuildCommands(net.dv8tion.jda.api.entities.Guild guild) -
updateMusicChannel
protected void updateMusicChannel(net.dv8tion.jda.api.entities.Guild guild, net.dv8tion.jda.api.entities.channel.middleman.GuildMessageChannel channel) Internal updates to Database -
onStageInstanceCreate
public void onStageInstanceCreate(@NotNull @NotNull net.dv8tion.jda.api.events.stage.StageInstanceCreateEvent event) Checks for stage instances being created, to allow bot to join stages and play music- Overrides:
onStageInstanceCreatein classnet.dv8tion.jda.api.hooks.ListenerAdapter
-
onStageInstanceDelete
public void onStageInstanceDelete(@NotNull @NotNull net.dv8tion.jda.api.events.stage.StageInstanceDeleteEvent event) Removes compatibility for stage channels once the instance is deleted- Overrides:
onStageInstanceDeletein classnet.dv8tion.jda.api.hooks.ListenerAdapter
-
onReady
public void onReady(@NotNull @NotNull net.dv8tion.jda.api.events.session.ReadyEvent event) Accounts for stages running after reboot- Overrides:
onReadyin classnet.dv8tion.jda.api.hooks.ListenerAdapter
-
onSlashCommandInteraction
public void onSlashCommandInteraction(@NotNull @NotNull net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent event) Handles implementation for all registered audio slash commands- Overrides:
onSlashCommandInteractionin classnet.dv8tion.jda.api.hooks.ListenerAdapter
-