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
    Modifier and Type
    Field
    Description
    static net.dv8tion.jda.api.entities.StageInstance
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    initCommands(List<net.dv8tion.jda.api.entities.Guild> guilds)
    Registers guild specific commands (unused)
    void
    onReady(@NotNull net.dv8tion.jda.api.events.session.ReadyEvent event)
    Accounts for stages running after reboot
    void
    onSlashCommandInteraction(@NotNull net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent event)
    Handles implementation for all registered audio slash commands
    void
    onStageInstanceCreate(@NotNull net.dv8tion.jda.api.events.stage.StageInstanceCreateEvent event)
    Checks for stage instances being created, to allow bot to join stages and play music
    void
    onStageInstanceDelete(@NotNull net.dv8tion.jda.api.events.stage.StageInstanceDeleteEvent event)
    Removes compatibility for stage channels once the instance is deleted
    protected void
    updateGuildCommands(net.dv8tion.jda.api.entities.Guild guild)
     
    List<net.dv8tion.jda.api.interactions.commands.build.CommandData>
    Generates a list of commands to be updated ListenerAdapter.onReady(ReadyEvent)
    protected void
    updateMusicChannel(net.dv8tion.jda.api.entities.Guild guild, net.dv8tion.jda.api.entities.channel.middleman.GuildMessageChannel channel)
    Internal updates to Database

    Methods 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • stageInstance

      public static net.dv8tion.jda.api.entities.StageInstance stageInstance
  • Constructor Details

    • SlashMusicCommands

      public SlashMusicCommands()
  • Method Details

    • initCommands

      public void initCommands(List<net.dv8tion.jda.api.entities.Guild> guilds)
      Registers guild specific commands (unused)
      Parameters:
      guilds - list of guilds to update commands for
    • updateJdaCommands

      public List<net.dv8tion.jda.api.interactions.commands.build.CommandData> updateJdaCommands()
      Generates a list of commands to be updated ListenerAdapter.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:
      onStageInstanceCreate in class net.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:
      onStageInstanceDelete in class net.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:
      onReady in class net.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:
      onSlashCommandInteraction in class net.dv8tion.jda.api.hooks.ListenerAdapter