public static object GetMessage(this DanbooruImage image, ICommandContext context, bool forceString = false) { string message = $"`Score: {image.Score}` <{image.PostUrl}>"; if (!image.ImageUrl.IsVideoFile()) { if (forceString) { message += $"\n{image.ImageUrl}"; } } else { message += $"\n{image.ImageUrl} (Video)"; } if (!image.ImageUrl.IsVideoFile() && !forceString) { return (EmbedExtensions.FromImage(image.ImageUrl, EmbedExtensions.RandomEmbedColor(), context) .WithDescription(message)); } else { return(message); } }
private bool UrlAllowsLinking(DanbooruImage image) { return(false == image.FileUrl.Contains("safebooru.donmai")); }
private bool UrlIsEmpty(DanbooruImage image) { return(string.IsNullOrEmpty(image.FileUrl)); }