From 8db0abf31841579f52667692a05f0fe9c9252a7f Mon Sep 17 00:00:00 2001 From: Shikhir Arora Date: Thu, 16 Nov 2017 09:56:39 -0500 Subject: [PATCH] Allow for "titleurl" parameter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit { "title":"Something", "titleurl":"https://google.com" } “titleurl” is optional and if included will make the title field act like Markdown as it should: [title][http://google.com) to render this clickable on iOS Devices --- NadekoBot.Core/Common/CREmbed.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NadekoBot.Core/Common/CREmbed.cs b/NadekoBot.Core/Common/CREmbed.cs index 8ef9d30d..1dd31996 100644 --- a/NadekoBot.Core/Common/CREmbed.cs +++ b/NadekoBot.Core/Common/CREmbed.cs @@ -1,4 +1,4 @@ -using System; +using System; using Discord; using NadekoBot.Extensions; using Newtonsoft.Json; @@ -12,6 +12,7 @@ namespace NadekoBot.Common public string PlainText { get; set; } public string Title { get; set; } public string Description { get; set; } + public string TitleURL { get; set; } public CREmbedFooter Footer { get; set; } public string Thumbnail { get; set; } public string Image { get; set; } @@ -26,6 +27,7 @@ namespace NadekoBot.Common public bool IsValid => !string.IsNullOrWhiteSpace(Title) || !string.IsNullOrWhiteSpace(Description) || + !string.IsNullOrWhiteSpace(TitleURL) || !string.IsNullOrWhiteSpace(Thumbnail) || !string.IsNullOrWhiteSpace(Image) || (Footer != null && (!string.IsNullOrWhiteSpace(Footer.Text) || !string.IsNullOrWhiteSpace(Footer.IconUrl))) || @@ -39,6 +41,8 @@ namespace NadekoBot.Common embed.WithTitle(Title); if (!string.IsNullOrWhiteSpace(Description)) embed.WithDescription(Description); + if (!string.IsNullOrWhiteSpace(TitleURL)) + embed.WithUrl(TitleURL); embed.WithColor(new Discord.Color(Color)); if (Footer != null) embed.WithFooter(efb =>