private Embed BuildRadioEmbed(RadioTrack radio, int volume, bool paused) { EmbedBuilder builder = new EmbedBuilder(); builder .WithDescription("📻 Playing radio") .WithField("Genre", radio.Genre) .WithField("Raw Stream", $"**{radio.StreamUrl}**") .WithField("Volume", $"{volume}%") .WithField("Paused", paused) .WithFooter("music player"); return(builder.Build()); }
private async Task RefreshCurrentTrack() { //Get currently playing track RadioTrack current = await GetCurrentTrack(); string currentId = current == null ? null : current.id; string previousId = _currentTrack == null ? null : _currentTrack.id; //Check if this is a new track if (currentId == previousId) { return; } //Update track ChangeTrack(current); }
public async Task <IUserMessage> PlayRadioAsync(IVoiceChannel vc, ITextChannel chan, ILavaTrack lavaTrack) { IEnergizePlayer ply = await this.ConnectAsync(vc, chan); if (ply == null) { return(null); } RadioTrack radio = new RadioTrack(lavaTrack); ply.Queue.Clear(); ply.CurrentRadio = radio; await ply.Lavalink.PlayAsync(lavaTrack); return(await this.SendPlayerAsync(ply, radio, chan)); }
public TrackData(RadioTrack clip, float clipTime) { this.clip = clip; this.clipTime = clipTime; }