Package de.presti.ree6.commands
Class CommandEvent
java.lang.Object
de.presti.ree6.commands.CommandEvent
Event class used to parse and provide Information about a command execution.
-
Constructor Summary
ConstructorsConstructorDescriptionCommandEvent(String command, net.dv8tion.jda.api.entities.Member member, net.dv8tion.jda.api.entities.Guild guild, net.dv8tion.jda.api.entities.Message message, net.dv8tion.jda.api.entities.channel.unions.MessageChannelUnion textChannel, String[] arguments, net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent slashCommandInteractionEvent) Constructor used to save the Data. -
Method Summary
Modifier and TypeMethodDescriptionString[]Get the Arguments associated with the Event.String[]getArguments(boolean parseFromSlash) Get the Arguments associated with the Event.net.dv8tion.jda.api.entities.channel.unions.MessageChannelUnionGet theTextChannelEntity associated with the Event.net.dv8tion.jda.api.entities.GuildgetGuild()Get theGuildEntity associated with the Event.net.dv8tion.jda.api.interactions.InteractionHookGet theInteractionHookfrom theSlashCommandInteractionEvent.net.dv8tion.jda.api.entities.MemberGet theMemberEntity associated with the Event.net.dv8tion.jda.api.entities.MessageGet theMessageEntity associated with the Event.net.dv8tion.jda.api.interactions.commands.OptionMappingGet an option from the slash command!getResource(String key, Object... parameters) Get a Message from the Guild specific Language Setting.net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEventGet theSlashCommandInteractionEventEntity associated with the Event.Get the Subcommand of the Slash Command.Get the Subcommand Group of the Slash Command.net.dv8tion.jda.api.entities.UsergetUser()Get theUserEntity associated with the Event.booleanCheck if the Command Execution is a Slash Command or not.voidReply to the Command execution.voidReply to the Command execution.voidreply(net.dv8tion.jda.api.entities.MessageEmbed message) Reply to the Command execution.voidreply(net.dv8tion.jda.api.entities.MessageEmbed message, int deleteSecond) Reply to the Command execution.voidreply(net.dv8tion.jda.api.utils.messages.MessageCreateData message) Reply to the Command execution.voidreply(net.dv8tion.jda.api.utils.messages.MessageCreateData message, int deleteSecond) Reply to the Command execution.voidupdate(net.dv8tion.jda.api.entities.Message message, net.dv8tion.jda.api.utils.messages.MessageEditData messageEditData) Update a Message that has been sent.
-
Constructor Details
-
CommandEvent
public CommandEvent(String command, @Nonnull net.dv8tion.jda.api.entities.Member member, @Nonnull net.dv8tion.jda.api.entities.Guild guild, @Nullable net.dv8tion.jda.api.entities.Message message, @Nonnull net.dv8tion.jda.api.entities.channel.unions.MessageChannelUnion textChannel, @Nullable String[] arguments, @Nullable net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent slashCommandInteractionEvent) Constructor used to save the Data.- Parameters:
command- the Command Name.member- theMemberEntity.guild- theGuildEntity.message- theMessageEntity.textChannel- theTextChannelEntity.arguments- the given Arguments.slashCommandInteractionEvent- theSlashCommandInteractionEventEntity.
-
-
Method Details
-
reply
Reply to the Command execution.- Parameters:
message- the Message to reply with.
-
reply
Reply to the Command execution.- Parameters:
message- the Message to reply with.deleteSecond- the Seconds to delete the Message after.
-
reply
public void reply(net.dv8tion.jda.api.entities.MessageEmbed message) Reply to the Command execution.- Parameters:
message- the Message to reply with.
-
reply
public void reply(net.dv8tion.jda.api.entities.MessageEmbed message, int deleteSecond) Reply to the Command execution.- Parameters:
message- the Message to reply with.deleteSecond- the Seconds to delete the Message after.
-
reply
public void reply(net.dv8tion.jda.api.utils.messages.MessageCreateData message) Reply to the Command execution.- Parameters:
message- the Message to reply with.
-
reply
public void reply(net.dv8tion.jda.api.utils.messages.MessageCreateData message, int deleteSecond) Reply to the Command execution.- Parameters:
message- the Message to reply with.deleteSecond- the Seconds to delete the Message after.
-
update
public void update(@Nullable net.dv8tion.jda.api.entities.Message message, net.dv8tion.jda.api.utils.messages.MessageEditData messageEditData) Update a Message that has been sent.- Parameters:
message- the Message that has been sent.messageEditData- the Message Edit that is being used to update the message.
-
getResource
Get a Message from the Guild specific Language Setting.- Parameters:
key- the Key of the Message.parameters- the Parameters to replace in the Message.- Returns:
- the Message.
-
getUser
@Nonnull public net.dv8tion.jda.api.entities.User getUser()Get theUserEntity associated with the Event.- Returns:
- the
UserEntity.
-
getMember
@Nonnull public net.dv8tion.jda.api.entities.Member getMember()Get theMemberEntity associated with the Event.- Returns:
- the
MemberEntity.
-
getGuild
@Nonnull public net.dv8tion.jda.api.entities.Guild getGuild()Get theGuildEntity associated with the Event.- Returns:
- the
GuildEntity.
-
getMessage
@Nullable public net.dv8tion.jda.api.entities.Message getMessage()Get theMessageEntity associated with the Event.- Returns:
- the
MessageEntity.
-
getChannel
@Nonnull public net.dv8tion.jda.api.entities.channel.unions.MessageChannelUnion getChannel()Get theTextChannelEntity associated with the Event.- Returns:
- the
TextChannelEntity.
-
getArguments
Get the Arguments associated with the Event.- Returns:
- the Arguments.
-
getArguments
Get the Arguments associated with the Event.- Parameters:
parseFromSlash- if the Arguments should be parsed from the SlashCommandInteractionEvent.- Returns:
- the Arguments.
-
getSlashCommandInteractionEvent
@Nullable public net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent getSlashCommandInteractionEvent()Get theSlashCommandInteractionEventEntity associated with the Event.- Returns:
- the
SlashCommandInteractionEventEntity.
-
getOption
Get an option from the slash command!- Parameters:
name- The option name.- Returns:
- the
OptionMappingof the option | or null.
-
getSubcommand
Get the Subcommand of the Slash Command.- Returns:
- the Subcommand.
-
getSubcommandGroup
Get the Subcommand Group of the Slash Command.- Returns:
- the Subcommand Group.
-
isSlashCommand
public boolean isSlashCommand()Check if the Command Execution is a Slash Command or not.- Returns:
- true, if it is a Slash Command Execution. | false, if not.
-
getInteractionHook
public net.dv8tion.jda.api.interactions.InteractionHook getInteractionHook()Get theInteractionHookfrom theSlashCommandInteractionEvent.- Returns:
- the
InteractionHookEntity.
-