Record Class ScriptCrashedEvent
java.lang.Object
java.lang.Record
com.botwithus.bot.api.event.ScriptCrashedEvent
- Record Components:
scriptName- the script's manifest name (or class simple name)connectionName- the originating connection, ornullfor runners not yet bound to a connectioncrash- the structured crash descriptiontimestamp- event creation time in milliseconds since epoch
- All Implemented Interfaces:
GameEvent
public record ScriptCrashedEvent(String scriptName, String connectionName, LastCrash crash, long timestamp)
extends Record
implements GameEvent
Fired by the runtime when a script's lifecycle hook throws. The producer
(the
ScriptRunner) builds the LastCrash payload describing
which phase failed and the underlying throwable, then publishes this event
once via the per-connection EventBus.-
Constructor Summary
ConstructorsConstructorDescriptionScriptCrashedEvent(String scriptName, String connectionName, LastCrash crash) ScriptCrashedEvent(String scriptName, String connectionName, LastCrash crash, long timestamp) Creates an instance of aScriptCrashedEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconnectionNamerecord component.crash()Returns the value of thecrashrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thescriptNamerecord component.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ScriptCrashedEvent
-
ScriptCrashedEvent
public ScriptCrashedEvent(String scriptName, String connectionName, LastCrash crash, long timestamp) Creates an instance of aScriptCrashedEventrecord class.- Parameters:
scriptName- the value for thescriptNamerecord componentconnectionName- the value for theconnectionNamerecord componentcrash- the value for thecrashrecord componenttimestamp- the value for thetimestamprecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
scriptName
Returns the value of thescriptNamerecord component.- Returns:
- the value of the
scriptNamerecord component
-
connectionName
Returns the value of theconnectionNamerecord component.- Returns:
- the value of the
connectionNamerecord component
-
crash
-
timestamp
-