예제 #1
0
        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);
            }
        }
예제 #2
0
 private bool UrlAllowsLinking(DanbooruImage image)
 {
     return(false == image.FileUrl.Contains("safebooru.donmai"));
 }
예제 #3
0
 private bool UrlIsEmpty(DanbooruImage image)
 {
     return(string.IsNullOrEmpty(image.FileUrl));
 }