Class EventSocketWelcomedEvent
java.lang.Object
com.github.twitch4j.eventsub.socket.events.EventSocketWelcomedEvent
Fired when a
TwitchEventSocket
receives a
SocketMessageType.SESSION_WELCOME
message.
As a result, TwitchEventSocket.getWebsocketId()
will be populated,
which allows for EventSub subscriptions to be registered with Twitch's Helix API.
-
Constructor Summary
ConstructorDescriptionEventSocketWelcomedEvent
(TwitchEventSocket connection, String sessionId, boolean sessionChanged) Creates a newEventSocketWelcomedEvent
instance. -
Method Summary
-
Constructor Details
-
EventSocketWelcomedEvent
public EventSocketWelcomedEvent(TwitchEventSocket connection, String sessionId, boolean sessionChanged) Creates a newEventSocketWelcomedEvent
instance.- Parameters:
connection
- The EventSocket instance whose connection status changed.sessionId
- The ID that was assigned to the websocket upon connect.sessionChanged
- Whether the Session ID changed due to the session_welcome handshake.If false (i.e., the Session ID did not change), then the websocket simply reconnected at the request of Twitch (while preserving any subscriptions).
This field is always true upon the initial connection.
-
-
Method Details
-
getConnection
The EventSocket instance whose connection status changed. -
getSessionId
The ID that was assigned to the websocket upon connect. -
isSessionChanged
public boolean isSessionChanged()Whether the Session ID changed due to the session_welcome handshake.If false (i.e., the Session ID did not change), then the websocket simply reconnected at the request of Twitch (while preserving any subscriptions).
This field is always true upon the initial connection.
-
equals
-
hashCode
public int hashCode() -
toString
-