queue method

void queue()

Puts the track on the queue and starts playing if necessary

Implementation

void queue() {
  final player = _node._players[this.guildId];

  if (player == null) {
    return;
  }

  final queuedTrack = QueuedTrack._new(this.track, this.startTime, this.endTime, this.requester, this.channelId);

  // Whether if the node should start playing the track
  final shouldPlay = player.nowPlaying == null && player.queue.isEmpty;
  player.queue.add(queuedTrack);

  if (shouldPlay) {
    this._node._playNext(this.guildId);
  }
}