Record Class ChatMessageReceiveEvent
java.lang.Object
java.lang.Record
com.soulfiremc.server.api.event.bot.ChatMessageReceiveEvent
- Record Components:
connection
- The bot connection instance.timestamp
- The timestamp when the message was received.message
- The message that was received.
- All Implemented Interfaces:
SoulFireBotEvent
,SoulFireEvent
,SoulFireGlobalEvent
,SoulFireInstanceEvent
public record ChatMessageReceiveEvent(BotConnection connection, long timestamp, net.kyori.adventure.text.Component message)
extends Record
implements SoulFireBotEvent
This event is called when a chat message is received from the server.
-
Constructor Summary
ConstructorsConstructorDescriptionChatMessageReceiveEvent
(BotConnection connection, long timestamp, net.kyori.adventure.text.Component message) Creates an instance of aChatMessageReceiveEvent
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconnection
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.net.kyori.adventure.text.Component
message()
Returns the value of themessage
record component.long
Returns the value of thetimestamp
record component.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.soulfiremc.server.api.event.SoulFireBotEvent
instanceManager
Methods inherited from interface com.soulfiremc.server.api.event.SoulFireInstanceEvent
soulFireServer
-
Constructor Details
-
ChatMessageReceiveEvent
public ChatMessageReceiveEvent(BotConnection connection, long timestamp, net.kyori.adventure.text.Component message) Creates an instance of aChatMessageReceiveEvent
record class.- Parameters:
connection
- the value for theconnection
record componenttimestamp
- the value for thetimestamp
record componentmessage
- the value for themessage
record component
-
-
Method Details
-
parseToPlainText
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
connection
Returns the value of theconnection
record component.- Specified by:
connection
in interfaceSoulFireBotEvent
- Returns:
- the value of the
connection
record component
-
timestamp
public long timestamp()Returns the value of thetimestamp
record component.- Returns:
- the value of the
timestamp
record component
-
message
public net.kyori.adventure.text.Component message()Returns the value of themessage
record component.- Returns:
- the value of the
message
record component
-