public class CommandEvent
extends java.lang.Object
MessageReceivedEvent
,
CommandClient
, and String user arguments
compatible with all Command
s.
From here, developers can invoke several useful and specialized methods to assist in Command function and development. There are also "extension" methods for all methods found in MessageReceivedEvent.
Methods with "reply" in their name can be used to instantly send a Message
response to the MessageChannel
the MessageReceivedEvent was in.
All RestAction
returned by sending a response using these
methods automatically RestAction#queue()
, and no further developer
input is required.
Modifier and Type | Field and Description |
---|---|
static int |
MAX_MESSAGES |
Constructor and Description |
---|
CommandEvent(net.dv8tion.jda.core.events.message.MessageReceivedEvent event,
java.lang.String args,
CommandClient client)
Constructor for a CommandEvent.
|
Modifier and Type | Method and Description |
---|---|
void |
async(java.lang.Runnable runnable)
Uses the
client's executor
to run the provided Runnable asynchronously without blocking the thread this
is called in. |
java.lang.String |
getArgs()
Returns the user's String arguments for the command.
|
net.dv8tion.jda.core.entities.User |
getAuthor()
Gets the
User who triggered this CommandEvent. |
net.dv8tion.jda.core.entities.MessageChannel |
getChannel()
Gets the
MessageChannel that the CommandEvent
was triggered on. |
net.dv8tion.jda.core.entities.ChannelType |
getChannelType()
Gets the
ChannelType of the
MessageChannel that the CommandEvent was triggered on. |
CommandClient |
getClient()
Returns the
CommandClient
that initiated this CommandEvent. |
net.dv8tion.jda.core.events.message.MessageReceivedEvent |
getEvent()
Returns the underlying
MessageReceivedEvent
for this CommandEvent. |
net.dv8tion.jda.client.entities.Group |
getGroup()
Gets the
Group that this CommandEvent
was triggered in. |
net.dv8tion.jda.core.entities.Guild |
getGuild()
Gets the
Guild that this CommandEvent
was triggered on. |
net.dv8tion.jda.core.JDA |
getJDA()
Gets the instance of
JDA that this CommandEvent
was caught by. |
net.dv8tion.jda.core.entities.Member |
getMember()
Gets the
Member that triggered this CommandEvent. |
net.dv8tion.jda.core.entities.Message |
getMessage()
Gets the
Message responsible for triggering
this CommandEvent. |
net.dv8tion.jda.core.entities.PrivateChannel |
getPrivateChannel()
Gets the
PrivateChannel that this CommandEvent
may have taken place on, or null if it didn't happen on a PrivateChannel. |
long |
getResponseNumber()
Gets the response number for the
MessageReceivedEvent . |
net.dv8tion.jda.core.entities.Member |
getSelfMember()
Gets a
Member representing the bot, or null
if the event does not take place on a Guild . |
net.dv8tion.jda.core.entities.SelfUser |
getSelfUser()
Gets a
SelfUser representing the bot. |
net.dv8tion.jda.core.entities.TextChannel |
getTextChannel()
Gets the
TextChannel that this CommandEvent
may have taken place on, or null if it didn't happen on a TextChannel. |
boolean |
isFromType(net.dv8tion.jda.core.entities.ChannelType channelType)
Compares a provided
ChannelType with the one this
CommandEvent occurred on, returning true if they are the same ChannelType. |
boolean |
isOwner()
Tests whether or not the
User who triggered this
event is an owner of the bot. |
void |
linkId(net.dv8tion.jda.core.entities.Message message)
Links a
Message with the calling Message
contained by this CommandEvent. |
void |
reactError()
Adds an error reaction to the calling
Message . |
void |
reactSuccess()
Adds a success reaction to the calling
Message . |
void |
reactWarning()
Adds a warning reaction to the calling
Message . |
void |
reply(java.io.File file,
java.lang.String filename)
Replies with a
File with the provided name, or a default name
if left null. |
void |
reply(net.dv8tion.jda.core.entities.Message message)
Replies with a
Message . |
void |
reply(net.dv8tion.jda.core.entities.Message message,
java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success)
Replies with a
Message and then
queues a Consumer . |
void |
reply(net.dv8tion.jda.core.entities.Message message,
java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success,
java.util.function.Consumer<java.lang.Throwable> failure)
Replies with a
Message and then
queues a Consumer . |
void |
reply(net.dv8tion.jda.core.entities.MessageEmbed embed)
Replies with a
MessageEmbed . |
void |
reply(net.dv8tion.jda.core.entities.MessageEmbed embed,
java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success)
Replies with a
MessageEmbed
and then queues a Consumer . |
void |
reply(net.dv8tion.jda.core.entities.MessageEmbed embed,
java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success,
java.util.function.Consumer<java.lang.Throwable> failure)
Replies with a
MessageEmbed
and then queues a Consumer . |
void |
reply(java.lang.String message)
Replies with a String message.
|
void |
reply(java.lang.String message,
java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success)
Replies with a String message and then queues a
Consumer . |
void |
reply(java.lang.String message,
java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success,
java.util.function.Consumer<java.lang.Throwable> failure)
Replies with a String message and then queues a
Consumer . |
void |
reply(java.lang.String message,
java.io.File file,
java.lang.String filename)
Replies with a String message and a
File with the provided name, or a default
name if left null. |
void |
replyError(java.lang.String message)
Replies with a String message and a prefixed error emoji.
|
void |
replyError(java.lang.String message,
java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> queue)
Replies with a String message and a prefixed error emoji and then
queues a
Consumer . |
void |
replyFormatted(java.lang.String format,
java.lang.Object... args)
Replies with a formatted String message using the provided arguments.
|
void |
replyInDm(net.dv8tion.jda.core.entities.Message message)
Replies with a
Message sent to the
calling User 's PrivateChannel . |
void |
replyInDm(net.dv8tion.jda.core.entities.Message message,
java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success)
Replies with a
Message sent to the
calling User 's PrivateChannel . |
void |
replyInDm(net.dv8tion.jda.core.entities.Message message,
java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success,
java.util.function.Consumer<java.lang.Throwable> failure)
Replies with a
Message sent to the
calling User 's PrivateChannel . |
void |
replyInDm(net.dv8tion.jda.core.entities.MessageEmbed embed)
Replies with a
MessageEmbed sent to the
calling User 's PrivateChannel . |
void |
replyInDm(net.dv8tion.jda.core.entities.MessageEmbed embed,
java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success)
Replies with a
MessageEmbed sent to the
calling User 's PrivateChannel . |
void |
replyInDm(net.dv8tion.jda.core.entities.MessageEmbed embed,
java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success,
java.util.function.Consumer<java.lang.Throwable> failure)
Replies with a
MessageEmbed sent to the
calling User 's PrivateChannel . |
void |
replyInDm(java.lang.String message)
Replies with a String message sent to the calling
User 's
PrivateChannel . |
void |
replyInDm(java.lang.String message,
java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success)
Replies with a String message sent to the calling
User 's
PrivateChannel . |
void |
replyInDm(java.lang.String message,
java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success,
java.util.function.Consumer<java.lang.Throwable> failure)
Replies with a String message sent to the calling
User 's
PrivateChannel . |
void |
replyInDm(java.lang.String message,
java.io.File file,
java.lang.String filename)
Replies with a String message and a
File with the provided name, or a default
name if left null, and sent to the calling User 's
PrivateChannel . |
void |
replyOrAlternate(net.dv8tion.jda.core.entities.MessageEmbed embed,
java.lang.String alternateMessage)
Replies with a
MessageEmbed if possible,
or just a String message if it cannot send the embed. |
void |
replyOrAlternate(java.lang.String message,
java.io.File file,
java.lang.String filename,
java.lang.String alternateMessage)
Replies with a String message and a
File with the provided name, or a default
name if left null. |
void |
replySuccess(java.lang.String message)
Replies with a String message, and a prefixed success emoji.
|
void |
replySuccess(java.lang.String message,
java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> queue)
Replies with a String message and a prefixed success emoji and then
queues a
Consumer . |
void |
replyWarning(java.lang.String message)
Replies with a String message, and a prefixed warning emoji.
|
void |
replyWarning(java.lang.String message,
java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> queue)
Replies with a String message and a prefixed warning emoji and then
queues a
Consumer . |
static java.util.ArrayList<java.lang.String> |
splitMessage(java.lang.String stringtoSend)
Splits a String into one or more Strings who's length does not exceed 2000 characters.
|
public CommandEvent(net.dv8tion.jda.core.events.message.MessageReceivedEvent event, java.lang.String args, CommandClient client)
You should not call this!
It is a generated wrapper for a MessageReceivedEvent
.
event
- The initial MessageReceivedEventargs
- The String arguments after the command callclient
- The CommandClient
public java.lang.String getArgs()
public net.dv8tion.jda.core.events.message.MessageReceivedEvent getEvent()
MessageReceivedEvent
for this CommandEvent.public CommandClient getClient()
CommandClient
that initiated this CommandEvent.public void linkId(net.dv8tion.jda.core.entities.Message message)
Message
with the calling Message
contained by this CommandEvent.
This method is exposed for those who wish to use linked deletion but may require usage of
MessageChannel#sendMessage()
or for other reasons cannot use the standard reply()
methods.
If the Message provided is not from the bot (IE: SelfUser
),
an IllegalArgumentException
will be thrown.
message
- The Message to add, must be from the SelfUser while linked deletion is being used.java.lang.IllegalArgumentException
- If the Message provided is not from the bot.public void reply(java.lang.String message)
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
.
NOTE: This message can exceed the 2000 character cap, and will be sent in two split Messages.
message
- A String message to reply withpublic void reply(java.lang.String message, java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success)
Consumer
.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
with the provided Consumer as it's success callback.
NOTE: This message can exceed the 2000 character cap, and will be sent in
two split Messages.
The Consumer will be applied to the last message sent if this occurs.
message
- A String message to reply withsuccess
- The Consumer to queue after sending the Message is sent.public void reply(java.lang.String message, java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success, java.util.function.Consumer<java.lang.Throwable> failure)
Consumer
.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
with the first Consumer as it's success callback and the second Consumer as the failure callback.
NOTE: This message can exceed the 2000 character cap, and will be sent in
two split Messages.
Either Consumer will be applied to the last message sent if this occurs.
message
- A String message to reply withsuccess
- The Consumer to queue after sending the Message is sent.failure
- The Consumer to run if an error occurs when sending the Message.public void reply(net.dv8tion.jda.core.entities.MessageEmbed embed)
MessageEmbed
.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
.
embed
- The MessageEmbed to reply withpublic void reply(net.dv8tion.jda.core.entities.MessageEmbed embed, java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success)
MessageEmbed
and then queues a Consumer
.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
with the provided Consumer as it's success callback.
embed
- The MessageEmbed to reply withsuccess
- The Consumer to queue after sending the Message is sent.public void reply(net.dv8tion.jda.core.entities.MessageEmbed embed, java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success, java.util.function.Consumer<java.lang.Throwable> failure)
MessageEmbed
and then queues a Consumer
.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
with the first Consumer as it's success callback and the second Consumer as the failure callback.
embed
- The MessageEmbed to reply withsuccess
- The Consumer to queue after sending the Message is sent.failure
- The Consumer to run if an error occurs when sending the Message.public void reply(net.dv8tion.jda.core.entities.Message message)
Message
.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
.
message
- The Message to reply withpublic void reply(net.dv8tion.jda.core.entities.Message message, java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success)
Message
and then
queues a Consumer
.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#success()
with the provided Consumer as it's success callback.
message
- The Message to reply withsuccess
- The Consumer to success after sending the Message is sent.public void reply(net.dv8tion.jda.core.entities.Message message, java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success, java.util.function.Consumer<java.lang.Throwable> failure)
Message
and then
queues a Consumer
.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
with the first Consumer as it's success callback and the second Consumer as the failure callback.
message
- The Message to reply withsuccess
- The Consumer to queue after sending the Message is sent.failure
- The Consumer to run if an error occurs when sending the Message.public void reply(java.io.File file, java.lang.String filename)
File
with the provided name, or a default name
if left null.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
.
This method uses MessageChannel#sendFile(File, String, Message)
to send the File. For more information on what a bot may send using this, you may find the info in that method.
file
- The File to reply withfilename
- The filename that Discord should display (null for default).public void reply(java.lang.String message, java.io.File file, java.lang.String filename)
File
with the provided name, or a default
name if left null.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
.
This method uses MessageChannel#sendFile(File, String, Message)
to send the File. For more information on what a bot may send using this, you may find the info in that method.
message
- A String message to reply withfile
- The File to reply withfilename
- The filename that Discord should display (null for default).public void replyFormatted(java.lang.String format, java.lang.Object... args)
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
.
NOTE: This message can exceed the 2000 character cap, and will be sent in two split Messages.
format
- A formatted Stringargs
- The arguments to use with the formatpublic void replyOrAlternate(net.dv8tion.jda.core.entities.MessageEmbed embed, java.lang.String alternateMessage)
MessageEmbed
if possible,
or just a String message if it cannot send the embed.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
.
NOTE: This alternate String message can exceed the 2000 character cap, and will be sent in two split Messages.
embed
- The MessageEmbed to reply withalternateMessage
- A String message to reply with if the provided MessageEmbed cannot be sentpublic void replyOrAlternate(java.lang.String message, java.io.File file, java.lang.String filename, java.lang.String alternateMessage)
File
with the provided name, or a default
name if left null.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
.
This method uses MessageChannel#sendFile(File, String, Message)
to send the File. For more information on what a bot may send using this, you may find the info in that method.
NOTE: This alternate String message can exceed the 2000 character cap, and will be sent in two split Messages.
It is also worth noting that unlike CommandEvent#reply(File, String)
and CommandEvent#reply(String, File, String)
,
this method does not throw a IOException
. This is because the cause of the alternate String message being sent comes directly from a
thrown Exception
, and thus a thrown IOException is grounds for the sending of the alternate message.
message
- A String message to reply withfile
- The File to reply withfilename
- The filename that Discord should display (null for default).alternateMessage
- A String message to reply with if the file cannot be uploaded, or an IOException
is thrownpublic void replyInDm(java.lang.String message)
User
's
PrivateChannel
.
If the User to be Direct Messaged does not already have a PrivateChannel open to send messages to, this method will automatically open one.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
.
NOTE: This alternate String message can exceed the 2000 character cap, and will be sent in two split Messages.
message
- A String message to reply withpublic void replyInDm(java.lang.String message, java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success)
User
's
PrivateChannel
.
If the User to be Direct Messaged does not already have a PrivateChannel open to send messages to, this method will automatically open one.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
with the provided Consumer as it's success callback.
NOTE: This alternate String message can exceed the 2000 character cap, and will be sent in two split Messages.
message
- A String message to reply withsuccess
- The Consumer to queue after sending the Message is sent.public void replyInDm(java.lang.String message, java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success, java.util.function.Consumer<java.lang.Throwable> failure)
User
's
PrivateChannel
.
If the User to be Direct Messaged does not already have a PrivateChannel open to send messages to, this method will automatically open one.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
with the first Consumer as it's success callback and the second Consumer as the failure callback.
NOTE: This alternate String message can exceed the 2000 character cap, and will be sent in two split Messages.
message
- A String message to reply withsuccess
- The Consumer to queue after sending the Message is sent.failure
- The Consumer to run if an error occurs when sending the Message.public void replyInDm(net.dv8tion.jda.core.entities.MessageEmbed embed)
MessageEmbed
sent to the
calling User
's PrivateChannel
.
If the User to be Direct Messaged does not already have a PrivateChannel open to send messages to, this method will automatically open one.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
.
embed
- The MessageEmbed to reply withpublic void replyInDm(net.dv8tion.jda.core.entities.MessageEmbed embed, java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success)
MessageEmbed
sent to the
calling User
's PrivateChannel
.
If the User to be Direct Messaged does not already have a PrivateChannel open to send messages to, this method will automatically open one.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
with the provided Consumer as it's success callback.
embed
- The MessageEmbed to reply withsuccess
- The Consumer to queue after sending the Message is sent.public void replyInDm(net.dv8tion.jda.core.entities.MessageEmbed embed, java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success, java.util.function.Consumer<java.lang.Throwable> failure)
MessageEmbed
sent to the
calling User
's PrivateChannel
.
If the User to be Direct Messaged does not already have a PrivateChannel open to send messages to, this method will automatically open one.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
with the first Consumer as it's success callback and the second Consumer as the failure callback.
embed
- The MessageEmbed to reply withsuccess
- The Consumer to queue after sending the Message is sent.failure
- The Consumer to run if an error occurs when sending the Message.public void replyInDm(net.dv8tion.jda.core.entities.Message message)
Message
sent to the
calling User
's PrivateChannel
.
If the User to be Direct Messaged does not already have a PrivateChannel open to send messages to, this method will automatically open one.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
.
message
- The Message to reply withpublic void replyInDm(net.dv8tion.jda.core.entities.Message message, java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success)
Message
sent to the
calling User
's PrivateChannel
.
If the User to be Direct Messaged does not already have a PrivateChannel open to send messages to, this method will automatically open one.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
with the provided Consumer as it's success callback.
message
- The Message to reply withsuccess
- The Consumer to queue after sending the Message is sent.public void replyInDm(net.dv8tion.jda.core.entities.Message message, java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> success, java.util.function.Consumer<java.lang.Throwable> failure)
Message
sent to the
calling User
's PrivateChannel
.
If the User to be Direct Messaged does not already have a PrivateChannel open to send messages to, this method will automatically open one.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
with the first Consumer as it's success callback and the second Consumer as the failure callback.
message
- The Message to reply withsuccess
- The Consumer to queue after sending the Message is sent.failure
- The Consumer to run if an error occurs when sending the Message.public void replyInDm(java.lang.String message, java.io.File file, java.lang.String filename)
File
with the provided name, or a default
name if left null, and sent to the calling User
's
PrivateChannel
.
If the User to be Direct Messaged does not already have a PrivateChannel open to send messages to, this method will automatically open one.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
.
This method uses MessageChannel#sendFile(File, String, Message)
to send the File. For more information on what a bot may send using this, you may find the info in that method.
message
- A String message to reply withfile
- The File
to reply withfilename
- The filename that Discord should display (null for default).public void replySuccess(java.lang.String message)
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
.
NOTE: This message can exceed the 2000 character cap, and will be sent in two split Messages.
message
- A String message to reply withpublic void replySuccess(java.lang.String message, java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> queue)
Consumer
.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
with the provided Consumer as it's success callback.
NOTE: This message can exceed the 2000 character cap, and will be sent in two split Messages.
message
- A String message to reply withqueue
- The Consumer to queue after sending the Message is sent.public void replyWarning(java.lang.String message)
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
.
NOTE: This message can exceed the 2000 character cap, and will be sent in two split Messages.
message
- A String message to reply withpublic void replyWarning(java.lang.String message, java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> queue)
Consumer
.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
with the provided Consumer as it's success callback.
NOTE: This message can exceed the 2000 character cap, and will be sent in two split Messages.
message
- A String message to reply withqueue
- The Consumer to queue after sending the Message is sent.public void replyError(java.lang.String message)
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
.
NOTE: This message can exceed the 2000 character cap, and will be sent in two split Messages.
message
- A String message to reply withpublic void replyError(java.lang.String message, java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> queue)
Consumer
.
The RestAction
returned by
sending the response as a Message
automatically does RestAction#queue()
with the provided Consumer as it's success callback.
NOTE: This message can exceed the 2000 character cap, and will be sent in two split Messages.
message
- A String message to reply withqueue
- The Consumer to queue after sending the Message is sent.public void reactSuccess()
Message
.public void reactWarning()
Message
.public void reactError()
Message
.public void async(java.lang.Runnable runnable)
client's executor
to run the provided Runnable
asynchronously without blocking the thread this
is called in.
The ScheduledExecutorService this runs on can be configured using
CommandClientBuilder#setScheduleExecutor(ScheduledExecutorService)
.
runnable
- The runnable to run asyncpublic static java.util.ArrayList<java.lang.String> splitMessage(java.lang.String stringtoSend)
@here
and @everyone
so that they do not mention anyone.
Message
at maximum potential length.stringtoSend
- The String to split and sendArrayList
containing one or more Strings, with nullified
occurrences of @here
and @everyone
, and that do not exceed 2000 characters
in lengthpublic net.dv8tion.jda.core.entities.SelfUser getSelfUser()
SelfUser
representing the bot.
event.getJDA().getSelfUser()
.public net.dv8tion.jda.core.entities.Member getSelfMember()
Member
representing the bot, or null
if the event does not take place on a Guild
.
event.getGuild().getSelfMember()
.public boolean isOwner()
User
who triggered this
event is an owner of the bot.true
if the User is the Owner, else false
public net.dv8tion.jda.core.entities.User getAuthor()
User
who triggered this CommandEvent.public net.dv8tion.jda.core.entities.MessageChannel getChannel()
MessageChannel
that the CommandEvent
was triggered on.public net.dv8tion.jda.core.entities.ChannelType getChannelType()
ChannelType
of the
MessageChannel
that the CommandEvent was triggered on.public net.dv8tion.jda.client.entities.Group getGroup()
Group
that this CommandEvent
was triggered in.public net.dv8tion.jda.core.entities.Guild getGuild()
Guild
that this CommandEvent
was triggered on.public net.dv8tion.jda.core.JDA getJDA()
JDA
that this CommandEvent
was caught by.public net.dv8tion.jda.core.entities.Member getMember()
Member
that triggered this CommandEvent.public net.dv8tion.jda.core.entities.Message getMessage()
Message
responsible for triggering
this CommandEvent.public net.dv8tion.jda.core.entities.PrivateChannel getPrivateChannel()
PrivateChannel
that this CommandEvent
may have taken place on, or null
if it didn't happen on a PrivateChannel.public long getResponseNumber()
MessageReceivedEvent
.public net.dv8tion.jda.core.entities.TextChannel getTextChannel()
TextChannel
that this CommandEvent
may have taken place on, or null
if it didn't happen on a TextChannel.public boolean isFromType(net.dv8tion.jda.core.entities.ChannelType channelType)
ChannelType
with the one this
CommandEvent occurred on, returning true
if they are the same ChannelType.channelType
- The ChannelType to comparetrue
if the CommandEvent originated from a MessageChannel
of the provided ChannelType, otherwise false
.