Class MessageCommand
java.lang.Object
net.dv8tion.jda.api.hooks.ListenerAdapter
io.github.yusufsdiscordbot.yusufsdiscordcore.bot.handlers.extensions.MessageCommand
- All Implemented Interfaces:
net.dv8tion.jda.api.hooks.EventListener
public abstract class MessageCommand
extends net.dv8tion.jda.api.hooks.ListenerAdapter
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMessageCommand(String name, boolean isGuildOnly, CommandType... commandType) -
Method Summary
Modifier and TypeMethodDescriptionbooleanUsed 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.CommandDataRetrieves all the command data such as the name and description of the command.Used to determine what type of command it is.final StringgetName()Provides the user with name of the commandvoidonButtonInteraction(net.dv8tion.jda.api.events.interaction.component.ButtonInteractionEvent event) abstract voidonMessageContextInteraction(net.dv8tion.jda.api.events.interaction.command.MessageContextInteractionEvent event) voidonSelectMenuInteraction(net.dv8tion.jda.api.events.interaction.component.SelectMenuInteractionEvent 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, 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, onUserContextInteraction, onUserTyping, onUserUpdateActivities, onUserUpdateActivityOrder, onUserUpdateAvatar, onUserUpdateDiscriminator, onUserUpdateFlags, onUserUpdateName, onUserUpdateOnlineStatus
-
Constructor Details
-
MessageCommand
protected MessageCommand(@Nonnull String name, boolean isGuildOnly, @Nonnull CommandType... commandType)
-
-
Method Details
-
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
Used to determine what type of command it is. -
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 returnSlashCommandData.addOption(OptionType, String, String)
Choices can also be used which makes it easier for the user. which returnsOptionData.addChoice(String, long)
-
onMessageContextInteraction
public abstract void onMessageContextInteraction(net.dv8tion.jda.api.events.interaction.command.MessageContextInteractionEvent event) - Overrides:
onMessageContextInteractionin classnet.dv8tion.jda.api.hooks.ListenerAdapter
-
onButtonInteraction
public void onButtonInteraction(@Nonnull net.dv8tion.jda.api.events.interaction.component.ButtonInteractionEvent event) - Overrides:
onButtonInteractionin classnet.dv8tion.jda.api.hooks.ListenerAdapter
-
onSelectMenuInteraction
public void onSelectMenuInteraction(@Nonnull net.dv8tion.jda.api.events.interaction.component.SelectMenuInteractionEvent event) - Overrides:
onSelectMenuInteractionin classnet.dv8tion.jda.api.hooks.ListenerAdapter
-