- All Implemented Interfaces:
public class MessageReceivedEvent extends GenericMessageEvent
Indicates that a Message was received in a
Can be used to detect that a Message is received in either a guild- or private channel. Providing a MessageChannel and Message.
This event requires at least one of the following intents (Will not fire at all if neither is enabled):
GUILD_MESSAGESto work in guild text channels
DIRECT_MESSAGESto work in private channels
(JDA api, long responseNumber, Message message)
Method SummaryModifier and TypeMethodDescriptionThe Author of the Message received as
Userobject.The Author of the Message received as
booleanWhether or not the Message received was sent via a Webhook.
Methods inherited from class net.dv8tion.jda.api.events.message.GenericMessageEvent
getChannel, getChannelType, getGuild, getGuildChannel, getJumpUrl, getMessageId, getMessageIdLong, isFromGuild, isFromThread, isFromType
Methods inherited from class net.dv8tion.jda.api.events.Event
getJDA, getRawData, getResponseNumber, toString
- The received
getAuthorThe Author of the Message received as
This will be never-null but might be a fake user if Message was sent via Webhook (Guild only). See
- The Author of the Message.
- See Also:
getMemberThe Author of the Message received as
This will be
nullin case of Message being received in a
- The Author of the Message as null-able Member object.
- See Also:
isWebhookMessagepublic boolean isWebhookMessage()Whether or not the Message received was sent via a Webhook.
This is a shortcut for
- True, if the Message was sent via Webhook