TomatenMusic-V2/TomatenMusicCore/Prompt/Implementation/SongActionPrompt.cs

36 lines
1.1 KiB
C#
Raw Normal View History

2022-03-29 22:12:22 +02:00
using DSharpPlus.Entities;
using Lavalink4NET.Player;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using TomatenMusic.Music.Entitites;
using TomatenMusic.Prompt.Buttons;
using TomatenMusic.Prompt.Model;
using TomatenMusic.Util;
using TomatenMusicCore.Music;
using TomatenMusicCore.Music.Entities;
using TomatenMusicCore.Prompt.Buttons;
namespace TomatenMusic.Prompt.Implementation
{
class SongActionPrompt : ButtonPrompt
{
public LavalinkTrack Track { get; set; }
public SongActionPrompt(TomatenMusicTrack track, DiscordMember requestMember, List<DiscordEmbed> embeds = null)
{
Embeds = embeds == null ? new List<DiscordEmbed>() : embeds;
Track = track;
AddOption(new AddToQueueButton(new TrackList() { track }, 1, requestMember));
AddOption(new PlayNowButton(new TrackList() { track }, 1, requestMember));
}
protected async override Task<DiscordMessageBuilder> GetMessageAsync()
{
return new DiscordMessageBuilder().AddEmbed(Common.AsEmbed(Track)).AddEmbeds(Embeds);
}
}
}