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
ConstructorDescriptionUserContextMenuEvent
(net.dv8tion.jda.api.JDA api, long responseNumber, net.dv8tion.jda.api.interactions.commands.context.UserContextInteraction interaction, CommandClient client) -
Method Summary
Modifier and TypeMethodDescriptionReturns theCommandClient
that triggered this event.boolean
isOwner()
Tests whether theUser
who triggered this event is an owner of the bot.void
Responds with aFile
with the provided name, or a default name if left null.void
Responds with a String message.void
respond
(net.dv8tion.jda.api.entities.MessageEmbed embed) Responds with aMessageEmbed
.void
respond
(net.dv8tion.jda.api.utils.messages.MessageCreateData message) Responds with aMessage
.Methods inherited from class net.dv8tion.jda.api.events.interaction.command.UserContextInteractionEvent
getInteraction, getTargetMember
Methods inherited from class net.dv8tion.jda.api.events.interaction.command.GenericContextInteractionEvent
getTarget, getTargetType
Methods inherited from class net.dv8tion.jda.api.events.interaction.command.GenericCommandInteractionEvent
deferReply, getCommandIdLong, getCommandType, getHook, getName, getOptions, getSubcommandGroup, getSubcommandName, isGuildCommand, replyModal
Methods inherited from class net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent
getChannel, getGuild, getGuildLocale, getIdLong, getMember, getToken, getTypeRaw, getUser, getUserLocale, isAcknowledged
Methods inherited from class net.dv8tion.jda.api.events.Event
getJDA, getRawData, getResponseNumber, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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, isGuildCommand
Methods inherited from interface net.dv8tion.jda.api.interactions.commands.context.ContextInteraction
getTarget
Methods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IDeferrableCallback
getHook
Methods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IModalCallback
replyModal
Methods inherited from interface net.dv8tion.jda.api.interactions.Interaction
getChannel, getChannelType, getGuild, getGuildChannel, getGuildLocale, getJDA, getMember, getMessageChannel, getToken, getType, getTypeRaw, getUser, getUserLocale, isAcknowledged, isFromGuild
Methods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IReplyCallback
deferReply, deferReply, reply, reply, replyComponents, replyComponents, replyEmbeds, replyEmbeds, replyFiles, replyFiles, replyFormat
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
Methods 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 theCommandClient
that triggered this event.- Returns:
- The initiating CommandClient
-
respond
Responds with a String message.The
ReplyCallbackAction
returned by sending the response as aMessage
automatically 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
ReplyCallbackAction
returned by sending the response as aMessage
automatically 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
ReplyCallbackAction
returned by sending the response as aMessage
automatically doesRestAction#queue()
.- Parameters:
message
- The Message to reply with
-
respond
Responds with aFile
with the provided name, or a default name if left null.The
ReplyCallbackAction
returned by sending the response as aMessage
automatically 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 theUser
who triggered this event is an owner of the bot.- Returns:
true
if the User is the Owner, elsefalse
-