Class MessageDeleteEvent
- java.lang.Object
-
- discord4j.core.event.domain.Event
-
- discord4j.core.event.domain.message.MessageEvent
-
- discord4j.core.event.domain.message.MessageDeleteEvent
-
public class MessageDeleteEvent extends MessageEvent
Dispatched when a message is deleted.The deleted message may not be present if messages are not stored.
This event is dispatched by Discord.
- See Also:
- Message Delete
-
-
Constructor Summary
Constructors Constructor Description MessageDeleteEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, long messageId, long channelId, Long guildId, Message message)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<MessageChannel>getChannel()Requests to retrieve theMessageChanneltheMessagewas deleted from.SnowflakegetChannelId()Mono<Guild>getGuild()Optional<Snowflake>getGuildId()Optional<Message>getMessage()Gets theMessagethat was deleted in this event, if present.SnowflakegetMessageId()StringtoString()-
Methods inherited from class discord4j.core.event.domain.Event
getClient, getShardInfo
-
-
-
-
Method Detail
-
getMessage
public Optional<Message> getMessage()
Gets theMessagethat was deleted in this event, if present. This may not be available ifMessagesare not stored.- Returns:
- The deleted
Message, if present.
-
getChannelId
public Snowflake getChannelId()
- Returns:
- The ID of the
MessageChannelthat theMessagewas deleted from.
-
getChannel
public Mono<MessageChannel> getChannel()
Requests to retrieve theMessageChanneltheMessagewas deleted from.- Returns:
- A
Monowhere, upon successful completion, emits theMessageChanneltheMessagewas deleted in. If an error is received, it is emitted through theMono.
-
getGuildId
public Optional<Snowflake> getGuildId()
Gets theSnowflakeID of theGuildtheMessagewas deleted from, if present. This may not be available if the deletedMessagewas from a private channel.- Returns:
- The ID of the
Guildinvolved, if present.
-
-