java.lang.Object
net.dv8tion.jda.api.hooks.ListenerAdapter
io.github.yusufsdiscordbot.yusufsdiscordcore.bot.handlers.extensions.UserCommand
All Implemented Interfaces:
net.dv8tion.jda.api.hooks.EventListener

public abstract class UserCommand extends net.dv8tion.jda.api.hooks.ListenerAdapter
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    UserCommand(String name, boolean isGuildOnly, CommandType... commandType)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Used to determine whether the command is Global(can be used on all servers) or whether it is only a Guild command(can only be used in specific servers)
    final net.dv8tion.jda.api.interactions.commands.build.CommandData
    Retrieves all the command data such as the name and description of the command.
    Used to determine what type of command it is.
    final String
    Provides the user with name of the command
    void
    onButtonInteraction(net.dv8tion.jda.api.events.interaction.component.ButtonInteractionEvent event)
     
    void
    onSelectMenuInteraction(net.dv8tion.jda.api.events.interaction.component.SelectMenuInteractionEvent event)
     
    abstract void
    onUserContextInteraction(net.dv8tion.jda.api.events.interaction.command.UserContextInteractionEvent event)
    Used to create a user context interaction event.

    Methods inherited from class net.dv8tion.jda.api.hooks.ListenerAdapter

    onChannelCreate, onChannelDelete, onChannelUpdateArchived, onChannelUpdateArchiveTimestamp, onChannelUpdateAutoArchiveDuration, onChannelUpdateBitrate, onChannelUpdateInvitable, onChannelUpdateLocked, onChannelUpdateName, onChannelUpdateNSFW, onChannelUpdateParent, onChannelUpdatePosition, onChannelUpdateRegion, onChannelUpdateSlowmode, onChannelUpdateTopic, onChannelUpdateType, onChannelUpdateUserLimit, onCommandAutoCompleteInteraction, onDisconnect, onEmoteAdded, onEmoteRemoved, onEmoteUpdateName, onEmoteUpdateRoles, onEvent, onException, onGatewayPing, onGenericAutoCompleteInteraction, onGenericChannel, onGenericChannelUpdate, onGenericCommandInteraction, onGenericComponentInteractionCreate, onGenericContextInteraction, onGenericEmote, onGenericEmoteUpdate, onGenericEvent, onGenericGuild, onGenericGuildInvite, onGenericGuildMember, onGenericGuildMemberUpdate, onGenericGuildUpdate, onGenericGuildVoice, onGenericInteractionCreate, onGenericMessage, onGenericMessageReaction, onGenericPermissionOverride, onGenericRole, onGenericRoleUpdate, onGenericSelfUpdate, onGenericStageInstance, onGenericStageInstanceUpdate, onGenericThread, onGenericThreadMember, onGenericUpdate, onGenericUser, onGenericUserPresence, onGuildAvailable, onGuildBan, onGuildInviteCreate, onGuildInviteDelete, onGuildJoin, onGuildLeave, onGuildMemberJoin, onGuildMemberRemove, onGuildMemberRoleAdd, onGuildMemberRoleRemove, onGuildMemberUpdate, onGuildMemberUpdateAvatar, onGuildMemberUpdateBoostTime, onGuildMemberUpdateNickname, onGuildMemberUpdatePending, onGuildMemberUpdateTimeOut, onGuildReady, 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, onGuildVoiceJoin, onGuildVoiceLeave, onGuildVoiceMove, onGuildVoiceMute, onGuildVoiceRequestToSpeak, onGuildVoiceSelfDeafen, onGuildVoiceSelfMute, onGuildVoiceStream, onGuildVoiceSuppress, onGuildVoiceUpdate, onGuildVoiceVideo, onHttpRequest, onMessageBulkDelete, onMessageContextInteraction, onMessageDelete, onMessageEmbed, onMessageReactionAdd, onMessageReactionRemove, onMessageReactionRemoveAll, onMessageReactionRemoveEmote, onMessageReceived, onMessageUpdate, onPermissionOverrideCreate, onPermissionOverrideDelete, onPermissionOverrideUpdate, onRawGateway, onReady, onReconnected, onResumed, onRoleCreate, onRoleDelete, onRoleUpdateColor, onRoleUpdateHoisted, onRoleUpdateIcon, onRoleUpdateMentionable, onRoleUpdateName, onRoleUpdatePermissions, onRoleUpdatePosition, onSelfUpdateAvatar, onSelfUpdateMFA, onSelfUpdateName, onSelfUpdateVerified, onShutdown, onSlashCommandInteraction, onStageInstanceCreate, onStageInstanceDelete, onStageInstanceUpdatePrivacyLevel, onStageInstanceUpdateTopic, onStatusChange, onThreadHidden, onThreadMemberJoin, onThreadMemberLeave, onThreadRevealed, onUnavailableGuildJoined, onUnavailableGuildLeave, onUserActivityEnd, onUserActivityStart, onUserTyping, onUserUpdateActivities, onUserUpdateActivityOrder, onUserUpdateAvatar, onUserUpdateDiscriminator, onUserUpdateFlags, onUserUpdateName, onUserUpdateOnlineStatus

    Methods inherited from class java.lang.Object

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

    • UserCommand

      protected UserCommand(@Nonnull String name, boolean isGuildOnly, @Nonnull CommandType... commandType)
  • Method Details

    • getName

      @Nonnull public final String getName()
      Provides the user with name of the command
      Returns:
      CommandDataImpl.getName()
    • checkIfIsGuildOnly

      public boolean checkIfIsGuildOnly()
      Used to determine whether the command is Global(can be used on all servers) or whether it is only a Guild command(can only be used in specific servers)
    • getCommandType

      public CommandType getCommandType()
      Used to determine what type of command it is.
      Returns:
      Must be one of the following:
    • getCommandData

      @Nonnull public final net.dv8tion.jda.api.interactions.commands.build.CommandData getCommandData()
      Retrieves all the command data such as the name and description of the command. Also used to create options and sub commands.
      Returns:
      CommandDataImpl(String, String) and can also return SlashCommandData.addOption(OptionType, String, String)

      Choices can also be used which makes it easier for the user. which returns OptionData.addChoice(String, long)

    • onUserContextInteraction

      public abstract void onUserContextInteraction(@Nonnull net.dv8tion.jda.api.events.interaction.command.UserContextInteractionEvent event)
      Used to create a user context interaction event.
      Overrides:
      onUserContextInteraction in class net.dv8tion.jda.api.hooks.ListenerAdapter
      Parameters:
      event - The event that is being used to create the user context interaction event.
    • onButtonInteraction

      public void onButtonInteraction(@Nonnull net.dv8tion.jda.api.events.interaction.component.ButtonInteractionEvent event)
      Overrides:
      onButtonInteraction in class net.dv8tion.jda.api.hooks.ListenerAdapter
    • onSelectMenuInteraction

      public void onSelectMenuInteraction(@Nonnull net.dv8tion.jda.api.events.interaction.component.SelectMenuInteractionEvent event)
      Overrides:
      onSelectMenuInteraction in class net.dv8tion.jda.api.hooks.ListenerAdapter