using DSharpPlus.Entities; using System; using System.Collections.Generic; using System.Text; using TomatenMusic.Prompt.Option; using System.Linq; using System.Threading.Tasks; namespace TomatenMusic.Prompt.Model { class ButtonPrompt : DiscordPromptBase { public string Content { get; protected set; } = ""; public List Embeds { get; protected set; } = new List(); public ButtonPrompt(DiscordPromptBase lastPrompt = null, string content = " ", List embeds = null) : base(lastPrompt) { this.Content = content; this.Embeds = embeds == null ? new List() : embeds; } protected override Task GetComponentAsync(IPromptOption option) { var myOption = (ButtonPromptOption)option; DiscordComponent component; if (myOption.Link != null) component = new DiscordLinkButtonComponent(myOption.Link, myOption.Content, myOption.Disabled, myOption.Emoji); else component = new DiscordButtonComponent(myOption.Style, myOption.CustomID, myOption.Content, myOption.Disabled, myOption.Emoji); return Task.FromResult(component); } protected override Task GetMessageAsync() { return Task.FromResult(new DiscordMessageBuilder() .WithContent(Content) .AddEmbeds(Embeds)); } } }