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

    Constructors
    Constructor
    Description
    UserContextMenuEvent(net.dv8tion.jda.api.JDA api, long responseNumber, net.dv8tion.jda.api.interactions.commands.context.UserContextInteraction interaction, CommandClient client)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the CommandClient that triggered this event.
    boolean
    Tests whether the User who triggered this event is an owner of the bot.
    void
    respond(File file, String filename, String description, boolean spoiler)
    Responds with a File with the provided name, or a default name if left null.
    void
    respond(String message)
    Responds with a String message.
    void
    respond(net.dv8tion.jda.api.entities.MessageEmbed embed)
    Responds with a MessageEmbed.
    void
    respond(net.dv8tion.jda.api.utils.messages.MessageCreateData message)
    Responds with a Message.

    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

      public CommandClient getClient()
      Returns the CommandClient that triggered this event.
      Returns:
      The initiating CommandClient
    • respond

      public void respond(String message)
      Responds with a String message.

      The ReplyCallbackAction returned by sending the response as a Message automatically does RestAction#queue().

      Parameters:
      message - A String message to reply with
    • respond

      public void respond(net.dv8tion.jda.api.entities.MessageEmbed embed)
      Responds with a MessageEmbed.

      The ReplyCallbackAction returned by sending the response as a Message automatically does RestAction#queue().

      Parameters:
      embed - The MessageEmbed to reply with
    • respond

      public void respond(net.dv8tion.jda.api.utils.messages.MessageCreateData message)
      Responds with a Message.

      The ReplyCallbackAction returned by sending the response as a Message automatically does RestAction#queue().

      Parameters:
      message - The Message to reply with
    • respond

      public void respond(File file, String filename, String description, boolean spoiler)
      Responds with a File with the provided name, or a default name if left null.

      The ReplyCallbackAction returned by sending the response as a Message automatically does RestAction#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 with
      filename - 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 the User who triggered this event is an owner of the bot.
      Returns:
      true if the User is the Owner, else false