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
ConstructorDescriptionCommandEvent
(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.MessageChannelUnion
Get theTextChannel
Entity associated with the Event.net.dv8tion.jda.api.entities.Guild
getGuild()
Get theGuild
Entity associated with the Event.net.dv8tion.jda.api.interactions.InteractionHook
Get theInteractionHook
from theSlashCommandInteractionEvent
.net.dv8tion.jda.api.entities.Member
Get theMember
Entity associated with the Event.net.dv8tion.jda.api.entities.Message
Get theMessage
Entity associated with the Event.net.dv8tion.jda.api.interactions.commands.OptionMapping
Get 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.SlashCommandInteractionEvent
Get theSlashCommandInteractionEvent
Entity associated with the Event.Get the Subcommand of the Slash Command.Get the Subcommand Group of the Slash Command.net.dv8tion.jda.api.entities.User
getUser()
Get theUser
Entity associated with the Event.boolean
Check if the Command Execution is a Slash Command or not.void
Reply to the Command execution.void
Reply to the Command execution.void
reply
(net.dv8tion.jda.api.entities.MessageEmbed message) Reply to the Command execution.void
reply
(net.dv8tion.jda.api.entities.MessageEmbed message, int deleteSecond) Reply to the Command execution.void
reply
(net.dv8tion.jda.api.utils.messages.MessageCreateData message) Reply to the Command execution.void
reply
(net.dv8tion.jda.api.utils.messages.MessageCreateData message, int deleteSecond) Reply to the Command execution.void
update
(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
- theMember
Entity.guild
- theGuild
Entity.message
- theMessage
Entity.textChannel
- theTextChannel
Entity.arguments
- the given Arguments.slashCommandInteractionEvent
- theSlashCommandInteractionEvent
Entity.
-
-
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 theUser
Entity associated with the Event.- Returns:
- the
User
Entity.
-
getMember
@Nonnull public net.dv8tion.jda.api.entities.Member getMember()Get theMember
Entity associated with the Event.- Returns:
- the
Member
Entity.
-
getGuild
@Nonnull public net.dv8tion.jda.api.entities.Guild getGuild()Get theGuild
Entity associated with the Event.- Returns:
- the
Guild
Entity.
-
getMessage
@Nullable public net.dv8tion.jda.api.entities.Message getMessage()Get theMessage
Entity associated with the Event.- Returns:
- the
Message
Entity.
-
getChannel
@Nonnull public net.dv8tion.jda.api.entities.channel.unions.MessageChannelUnion getChannel()Get theTextChannel
Entity associated with the Event.- Returns:
- the
TextChannel
Entity.
-
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 theSlashCommandInteractionEvent
Entity associated with the Event.- Returns:
- the
SlashCommandInteractionEvent
Entity.
-
getOption
Get an option from the slash command!- Parameters:
name
- The option name.- Returns:
- the
OptionMapping
of 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 theInteractionHook
from theSlashCommandInteractionEvent
.- Returns:
- the
InteractionHook
Entity.
-