public class MessageReceivedEvent extends GenericMessageEvent
MessageChannel
.
TextChannel
,
PrivateChannel
and Group
!
Use: This event indicates that a Message is received in either a guild, private channel or group. Providing a MessageChannel and Message.
Constructor | Description |
---|---|
MessageReceivedEvent(JDA api,
long responseNumber,
Message message) |
Modifier and Type | Method | Description |
---|---|---|
User |
getAuthor() |
Returns the Author of the Message received as
User object. |
Group |
getGroup() |
Returns the
Group the Message was received in. |
Guild |
getGuild() |
Returns the
Guild the Message was received in. |
Member |
getMember() |
Returns the Author of the Message received as
Member object. |
Message |
getMessage() |
Returns the received
Message object. |
PrivateChannel |
getPrivateChannel() |
Returns the
PrivateChannel the Message was received in. |
TextChannel |
getTextChannel() |
Returns the
TextChannel the Message was received in. |
boolean |
isWebhookMessage() |
Returns whether or not the Message received was sent via a Webhook.
|
getJDA, getResponseNumber
getChannel, getChannelType, getMessageId, getMessageIdLong, isFromType
public Message getMessage()
Message
object.Message
object.public User getAuthor()
User
object.
isWebhookMessage()
,
IFakeable.isFake()
public Member getMember()
Member
object.
null
in case of Message being received in
a PrivateChannel
,
a Group
or isWebhookMessage()
returning true
.isWebhookMessage()
public PrivateChannel getPrivateChannel()
PrivateChannel
the Message was received in.
PrivateChannel
,
this will return null
.GenericMessageEvent.isFromType(ChannelType)
public Group getGroup()
Group
the Message was received in.
Group
,
this will return null
.GenericMessageEvent.isFromType(ChannelType)
public TextChannel getTextChannel()
TextChannel
the Message was received in.
TextChannel
,
this will return null
.GenericMessageEvent.isFromType(ChannelType)
public Guild getGuild()
Guild
the Message was received in.
TextChannel
,
this will return null
.GenericMessageEvent.isFromType(ChannelType)
public boolean isWebhookMessage()
getMessage().isWebhookMessage()
.