async connect() {
    if (this.status !== Status.RECONNECTING) this.status = Status.CONNECTING;
    if (this.connected) {
      this.ws?.close(1012);
      delete this.ws;
    }
    const headers = new Headers();
    headers.append("authorization", this.password);
    headers.append("num-shards", this.manager.options.shards.toString());
    headers.append("user-id", this.manager.userId);
    if (this.resumeKey) headers.append("resume-key", this.resumeKey);
    try {
      this.ws = await connectWebSocket(
        `ws${this.secure ? "s" : ""}://${this.address}`,
        headers,
      );
      await this._open();
    } catch (e) {
      this.manager.emit("socketError", this, e);
    }
  }
/**
   * Connects to the lavalink node.
   * @since 1.0.0
   */
Connects to the lavalink node.
Connects to the lavalink node .
async connect() {
    if (this.status !== Status.RECONNECTING) this.status = Status.CONNECTING;
    if (this.connected) {
      this.ws?.close(1012);
      delete this.ws;
    }
    const headers = new Headers();
    headers.append("authorization", this.password);
    headers.append("num-shards", this.manager.options.shards.toString());
    headers.append("user-id", this.manager.userId);
    if (this.resumeKey) headers.append("resume-key", this.resumeKey);
    try {
      this.ws = await connectWebSocket(
        `ws${this.secure ? "s" : ""}://${this.address}`,
        headers,
      );
      await this._open();
    } catch (e) {
      this.manager.emit("socketError", this, e);
    }
  }
async connect ( ) { if ( this . status !== Status . RECONNECTING ) this . status = Status . CONNECTING ; if ( this . connected ) { this . ws ?. close ( 1012 ) ; delete this . ws ; } const headers = new Headers ( ) ; headers . append ( "authorization" , this . password ) ; headers . append ( "num-shards" , this . manager . options . shards . toString ( ) ) ; headers . append ( "user-id" , this . manager . userId ) ; if ( this . resumeKey ) headers . append ( "resume-key" , this . resumeKey ) ; try { this . ws = await connectWebSocket ( ` ${ this . secure ? "s" : "" } ${ this . address } ` , headers , ) ; await this . _open ( ) ; } catch ( e ) { this . manager . emit ( "socketError" , this , e ) ; } }
Connects to the lavalink node.
Connects to the lavalink node .