Class MessageSendEvent
java.lang.Object
me.remigio07.chatplugin.api.common.event.telegram.MessageSendEvent
- All Implemented Interfaces:
CancellableEvent
,ChatPluginEvent
Represents the event called just before a
message is sent through the
TelegramBot
.-
Constructor Summary
ConstructorDescriptionMessageSendEvent
(long chatID, String message) Constructs a new message send event. -
Method Summary
Modifier and TypeMethodDescriptionlong
Gets the ID of the chat the message has been sent through.Gets this event's message.boolean
Checks if this event has been cancelled and will not be executed.void
setCancelled
(boolean cancelled) Sets the cancellation state of this event.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface me.remigio07.chatplugin.api.common.event.ChatPluginEvent
call
-
Constructor Details
-
MessageSendEvent
Constructs a new message send event.- Parameters:
chatID
- Event's chat's IDmessage
- Message involved
-
-
Method Details
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableEvent
Checks if this event has been cancelled and will not be executed.- Specified by:
isCancelled
in interfaceCancellableEvent
- Returns:
- Whether this event is cancelled
-
setCancelled
public void setCancelled(boolean cancelled) Description copied from interface:CancellableEvent
Sets the cancellation state of this event.It will be passed through other registered listeners even if it is cancelled, but it will not be executed.
- Specified by:
setCancelled
in interfaceCancellableEvent
- Parameters:
cancelled
- Whether this event should be cancelled
-
getChatID
public long getChatID()Gets the ID of the chat the message has been sent through.- Returns:
- Event's chat's ID
-
getMessage
Gets this event's message.- Returns:
- Message involved
-