Package com.jagrosh.jdautilities.command
Class UserContextMenuEvent
java.lang.Object
net.dv8tion.jda.api.events.Event
net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent
net.dv8tion.jda.api.events.interaction.command.GenericCommandInteractionEvent
net.dv8tion.jda.api.events.interaction.command.GenericContextInteractionEvent<net.dv8tion.jda.api.entities.User>
net.dv8tion.jda.api.events.interaction.command.UserContextInteractionEvent
com.jagrosh.jdautilities.command.UserContextMenuEvent
- All Implemented Interfaces:
net.dv8tion.jda.api.entities.ISnowflake,net.dv8tion.jda.api.events.GenericEvent,net.dv8tion.jda.api.interactions.callbacks.IDeferrableCallback,net.dv8tion.jda.api.interactions.callbacks.IModalCallback,net.dv8tion.jda.api.interactions.callbacks.IReplyCallback,net.dv8tion.jda.api.interactions.commands.CommandInteraction,net.dv8tion.jda.api.interactions.commands.CommandInteractionPayload,net.dv8tion.jda.api.interactions.commands.context.ContextInteraction<net.dv8tion.jda.api.entities.User>,net.dv8tion.jda.api.interactions.commands.context.UserContextInteraction,net.dv8tion.jda.api.interactions.Interaction
public class UserContextMenuEvent
extends net.dv8tion.jda.api.events.interaction.command.UserContextInteractionEvent
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.dv8tion.jda.api.interactions.commands.context.ContextInteraction
net.dv8tion.jda.api.interactions.commands.context.ContextInteraction.ContextTarget -
Field Summary
Fields inherited from class net.dv8tion.jda.api.events.Event
api, rawData, responseNumber -
Constructor Summary
ConstructorsConstructorDescriptionUserContextMenuEvent(net.dv8tion.jda.api.JDA api, long responseNumber, net.dv8tion.jda.api.interactions.commands.context.UserContextInteraction interaction, CommandClient client) -
Method Summary
Modifier and TypeMethodDescriptionReturns theCommandClientthat triggered this event.booleanisOwner()Tests whether theUserwho triggered this event is an owner of the bot.voidResponds with aFilewith the provided name, or a default name if left null.voidResponds with a String message.voidrespond(net.dv8tion.jda.api.entities.MessageEmbed embed) Responds with aMessageEmbed.voidrespond(net.dv8tion.jda.api.utils.messages.MessageCreateData message) Responds with aMessage.Methods inherited from class net.dv8tion.jda.api.events.interaction.command.UserContextInteractionEvent
getInteraction, getTargetMemberMethods inherited from class net.dv8tion.jda.api.events.interaction.command.GenericContextInteractionEvent
getTarget, getTargetTypeMethods inherited from class net.dv8tion.jda.api.events.interaction.command.GenericCommandInteractionEvent
deferReply, getCommandIdLong, getCommandType, getHook, getName, getOptions, getSubcommandGroup, getSubcommandName, isGuildCommand, replyModalMethods inherited from class net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent
getChannel, getGuild, getGuildLocale, getIdLong, getMember, getToken, getTypeRaw, getUser, getUserLocale, isAcknowledgedMethods inherited from class net.dv8tion.jda.api.events.Event
getJDA, getRawData, getResponseNumber, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.dv8tion.jda.api.interactions.commands.CommandInteractionPayload
getCommandId, getCommandIdLong, getCommandString, getCommandType, getFullCommandName, getName, getOption, getOption, getOption, getOption, getOptions, getOptionsByName, getOptionsByType, getSubcommandGroup, getSubcommandName, isGlobalCommand, isGuildCommandMethods inherited from interface net.dv8tion.jda.api.interactions.commands.context.ContextInteraction
getTargetMethods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IDeferrableCallback
getHookMethods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IModalCallback
replyModalMethods inherited from interface net.dv8tion.jda.api.interactions.Interaction
getChannel, getChannelType, getGuild, getGuildChannel, getGuildLocale, getJDA, getMember, getMessageChannel, getToken, getType, getTypeRaw, getUser, getUserLocale, isAcknowledged, isFromGuildMethods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IReplyCallback
deferReply, deferReply, reply, reply, replyComponents, replyComponents, replyEmbeds, replyEmbeds, replyFiles, replyFiles, replyFormatMethods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreatedMethods inherited from interface net.dv8tion.jda.api.interactions.commands.context.UserContextInteraction
getTargetType
-
Constructor Details
-
UserContextMenuEvent
public UserContextMenuEvent(@NotNull net.dv8tion.jda.api.JDA api, long responseNumber, @NotNull net.dv8tion.jda.api.interactions.commands.context.UserContextInteraction interaction, CommandClient client)
-
-
Method Details
-
getClient
Returns theCommandClientthat triggered this event.- Returns:
- The initiating CommandClient
-
respond
Responds with a String message.The
ReplyCallbackActionreturned by sending the response as aMessageautomatically doesRestAction#queue().- Parameters:
message- A String message to reply with
-
respond
public void respond(net.dv8tion.jda.api.entities.MessageEmbed embed) Responds with aMessageEmbed.The
ReplyCallbackActionreturned by sending the response as aMessageautomatically doesRestAction#queue().- Parameters:
embed- The MessageEmbed to reply with
-
respond
public void respond(net.dv8tion.jda.api.utils.messages.MessageCreateData message) Responds with aMessage.The
ReplyCallbackActionreturned by sending the response as aMessageautomatically doesRestAction#queue().- Parameters:
message- The Message to reply with
-
respond
Responds with aFilewith the provided name, or a default name if left null.The
ReplyCallbackActionreturned by sending the response as aMessageautomatically doesRestAction#queue().This method uses
IReplyCallback.replyFiles(FileUpload...)to send the File. For more information on what a bot may send using this, you may find the info in that method.- Parameters:
file- The File to reply withfilename- The filename that Discord should display (null for default).description- The description to set (null for no description).spoiler- whether the file should be marked as spoiler.
-
isOwner
public boolean isOwner()Tests whether theUserwho triggered this event is an owner of the bot.- Returns:
trueif the User is the Owner, elsefalse
-