Package org.javacord.core.event.message
Class MessageEventImpl
- java.lang.Object
-
- org.javacord.core.event.EventImpl
-
- org.javacord.core.event.message.MessageEventImpl
-
- All Implemented Interfaces:
ChannelEvent
,TextChannelEvent
,Event
,MessageEvent
- Direct Known Subclasses:
CertainMessageEventImpl
,OptionalMessageEventImpl
public abstract class MessageEventImpl extends EventImpl implements MessageEvent
The implementation ofMessageEvent
.
-
-
Constructor Summary
Constructors Constructor Description MessageEventImpl(DiscordApi api, long messageId, TextChannel channel)
Creates a new message event.MessageEventImpl(Message message)
Creates a new message event.
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.javacord.api.event.channel.TextChannelEvent
getGroupChannel, getPrivateChannel, getServerTextChannel
-
-
-
-
Constructor Detail
-
MessageEventImpl
public MessageEventImpl(Message message)
Creates a new message event.- Parameters:
message
- The message.
-
MessageEventImpl
public MessageEventImpl(DiscordApi api, long messageId, TextChannel channel)
Creates a new message event.- Parameters:
api
- The discord api instance.messageId
- The id of the message.channel
- The text channel in which the message was sent.
-
-
Method Detail
-
getMessageId
public long getMessageId()
- Specified by:
getMessageId
in interfaceMessageEvent
-
getChannel
public TextChannel getChannel()
- Specified by:
getChannel
in interfaceChannelEvent
- Specified by:
getChannel
in interfaceTextChannelEvent
-
getServer
public Optional<Server> getServer()
- Specified by:
getServer
in interfaceMessageEvent
-
deleteMessage
public CompletableFuture<Void> deleteMessage()
- Specified by:
deleteMessage
in interfaceMessageEvent
-
deleteMessage
public CompletableFuture<Void> deleteMessage(String reason)
- Specified by:
deleteMessage
in interfaceMessageEvent
-
editMessage
public CompletableFuture<Void> editMessage(String content)
- Specified by:
editMessage
in interfaceMessageEvent
-
editMessage
public CompletableFuture<Void> editMessage(EmbedBuilder embed)
- Specified by:
editMessage
in interfaceMessageEvent
-
editMessage
public CompletableFuture<Void> editMessage(String content, EmbedBuilder embed)
- Specified by:
editMessage
in interfaceMessageEvent
-
addReactionToMessage
public CompletableFuture<Void> addReactionToMessage(String unicodeEmoji)
- Specified by:
addReactionToMessage
in interfaceMessageEvent
-
addReactionToMessage
public CompletableFuture<Void> addReactionToMessage(Emoji emoji)
- Specified by:
addReactionToMessage
in interfaceMessageEvent
-
addReactionsToMessage
public CompletableFuture<Void> addReactionsToMessage(Emoji... emojis)
- Specified by:
addReactionsToMessage
in interfaceMessageEvent
-
addReactionsToMessage
public CompletableFuture<Void> addReactionsToMessage(String... unicodeEmojis)
- Specified by:
addReactionsToMessage
in interfaceMessageEvent
-
removeAllReactionsFromMessage
public CompletableFuture<Void> removeAllReactionsFromMessage()
- Specified by:
removeAllReactionsFromMessage
in interfaceMessageEvent
-
removeReactionByEmojiFromMessage
public CompletableFuture<Void> removeReactionByEmojiFromMessage(User user, Emoji emoji)
- Specified by:
removeReactionByEmojiFromMessage
in interfaceMessageEvent
-
removeReactionByEmojiFromMessage
public CompletableFuture<Void> removeReactionByEmojiFromMessage(User user, String unicodeEmoji)
- Specified by:
removeReactionByEmojiFromMessage
in interfaceMessageEvent
-
removeReactionByEmojiFromMessage
public CompletableFuture<Void> removeReactionByEmojiFromMessage(Emoji emoji)
- Specified by:
removeReactionByEmojiFromMessage
in interfaceMessageEvent
-
removeReactionByEmojiFromMessage
public CompletableFuture<Void> removeReactionByEmojiFromMessage(String unicodeEmoji)
- Specified by:
removeReactionByEmojiFromMessage
in interfaceMessageEvent
-
removeReactionsByEmojiFromMessage
public CompletableFuture<Void> removeReactionsByEmojiFromMessage(User user, Emoji... emojis)
- Specified by:
removeReactionsByEmojiFromMessage
in interfaceMessageEvent
-
removeReactionsByEmojiFromMessage
public CompletableFuture<Void> removeReactionsByEmojiFromMessage(User user, String... unicodeEmojis)
- Specified by:
removeReactionsByEmojiFromMessage
in interfaceMessageEvent
-
removeReactionsByEmojiFromMessage
public CompletableFuture<Void> removeReactionsByEmojiFromMessage(Emoji... emojis)
- Specified by:
removeReactionsByEmojiFromMessage
in interfaceMessageEvent
-
removeReactionsByEmojiFromMessage
public CompletableFuture<Void> removeReactionsByEmojiFromMessage(String... unicodeEmojis)
- Specified by:
removeReactionsByEmojiFromMessage
in interfaceMessageEvent
-
removeOwnReactionByEmojiFromMessage
public CompletableFuture<Void> removeOwnReactionByEmojiFromMessage(Emoji emoji)
- Specified by:
removeOwnReactionByEmojiFromMessage
in interfaceMessageEvent
-
removeOwnReactionByEmojiFromMessage
public CompletableFuture<Void> removeOwnReactionByEmojiFromMessage(String unicodeEmoji)
- Specified by:
removeOwnReactionByEmojiFromMessage
in interfaceMessageEvent
-
removeOwnReactionsByEmojiFromMessage
public CompletableFuture<Void> removeOwnReactionsByEmojiFromMessage(Emoji... emojis)
- Specified by:
removeOwnReactionsByEmojiFromMessage
in interfaceMessageEvent
-
removeOwnReactionsByEmojiFromMessage
public CompletableFuture<Void> removeOwnReactionsByEmojiFromMessage(String... unicodeEmojis)
- Specified by:
removeOwnReactionsByEmojiFromMessage
in interfaceMessageEvent
-
pinMessage
public CompletableFuture<Void> pinMessage()
- Specified by:
pinMessage
in interfaceMessageEvent
-
unpinMessage
public CompletableFuture<Void> unpinMessage()
- Specified by:
unpinMessage
in interfaceMessageEvent
-
-