Class JavacordCommandSender
- java.lang.Object
-
- cloud.commandframework.javacord.sender.JavacordCommandSender
-
- Direct Known Subclasses:
JavacordPrivateSender
,JavacordServerSender
public class JavacordCommandSender extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description JavacordCommandSender(@NonNull org.javacord.api.event.message.MessageCreateEvent event)
Commandsender used for all javacord commands executed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NonNull org.javacord.api.entity.message.MessageAuthor
getAuthor()
Gets the author of themessage
which triggered the event@NonNull org.javacord.api.event.message.MessageCreateEvent
getEvent()
Gets the event which triggered the command@NonNull org.javacord.api.entity.message.Message
getMessage()
Gets the message of the event.@NonNull org.javacord.api.entity.channel.TextChannel
getTextChannel()
Gets the textchannel themessage
was sent in@NonNull java.util.concurrent.CompletableFuture<org.javacord.api.entity.message.Message>
sendErrorMessage(@Nullable java.lang.String message)
Sends an error message to the executor of the command@NonNull java.util.concurrent.CompletableFuture<org.javacord.api.entity.message.Message>
sendMessage(@Nullable java.lang.String message)
Sends a message to the executor of the command@NonNull java.util.concurrent.CompletableFuture<org.javacord.api.entity.message.Message>
sendSuccessMessage(@Nullable java.lang.String message)
Sends a success message to the executor of the command
-
-
-
Method Detail
-
getAuthor
public @NonNull org.javacord.api.entity.message.MessageAuthor getAuthor()
Gets the author of themessage
which triggered the event- Returns:
- The author of the message
-
getMessage
public @NonNull org.javacord.api.entity.message.Message getMessage()
Gets the message of the event.- Returns:
- The message of the event.
-
getTextChannel
public @NonNull org.javacord.api.entity.channel.TextChannel getTextChannel()
Gets the textchannel themessage
was sent in- Returns:
- The textchannel of the event
-
getEvent
public @NonNull org.javacord.api.event.message.MessageCreateEvent getEvent()
Gets the event which triggered the command- Returns:
- The event of the command
-
sendMessage
public @NonNull java.util.concurrent.CompletableFuture<org.javacord.api.entity.message.Message> sendMessage(@Nullable java.lang.String message)
Sends a message to the executor of the command- Parameters:
message
- message which should be sent- Returns:
- The sent message
-
sendErrorMessage
public @NonNull java.util.concurrent.CompletableFuture<org.javacord.api.entity.message.Message> sendErrorMessage(@Nullable java.lang.String message)
Sends an error message to the executor of the command- Parameters:
message
- message which should be sent- Returns:
- The sent message
-
sendSuccessMessage
public @NonNull java.util.concurrent.CompletableFuture<org.javacord.api.entity.message.Message> sendSuccessMessage(@Nullable java.lang.String message)
Sends a success message to the executor of the command- Parameters:
message
- message which should be sent- Returns:
- The sent message
-
-