@@ -8,13 +8,15 @@ data class NodeOptions private constructor(val name: String,
88 val serverUri : URI ,
99 val password : String ,
1010 val regionFilter : IRegionFilter ? ,
11- val httpTimeout : Long ) {
11+ val httpTimeout : Long ,
12+ val sessionId : String? ) {
1213 data class Builder (
1314 private var name : String? = null ,
1415 private var serverUri : URI ? = null ,
1516 private var password : String? = null ,
1617 private var regionFilter : IRegionFilter ? = null ,
1718 private var httpTimeout : Long = TIMEOUT_MS ,
19+ private var sessionId : String? = null
1820 ) {
1921 fun setName (name : String ) = apply { this .name = name }
2022
@@ -53,6 +55,14 @@ data class NodeOptions private constructor(val name: String,
5355 */
5456 fun setHttpTimeout (httpTimeout : Long ) = apply { this .httpTimeout = httpTimeout }
5557
58+ /* *
59+ * Sets the session ID that the client will use when first connecting to Lavalink. If the given session is still
60+ * running on the Lavalink server, the session will be resumed.
61+ *
62+ * Defaults to null, which means no attempt to resume will be made.
63+ */
64+ fun setSessionId (sessionId : String? ) = apply { this .sessionId = sessionId }
65+
5666 fun build (): NodeOptions {
5767 requireNotNull(name) { " name is required" }
5868 requireNotNull(serverUri) { " serverUri is required" }
@@ -63,7 +73,8 @@ data class NodeOptions private constructor(val name: String,
6373 serverUri!! ,
6474 password!! ,
6575 regionFilter,
66- httpTimeout)
76+ httpTimeout,
77+ sessionId)
6778 }
6879 }
6980}
0 commit comments