using System;
using System.Collections.Generic;
using Discord;

namespace SagiriBot.Objects.Nsfw
{
    internal static class NsfwUtil
    {
        internal static Embed ConstructEmbed(this INsfwImage _img, IEnumerable<string> _searchTags)
        {
            string _description = $"You searched for `{string.Join("`, `", _searchTags)}`";
            if (_img.FileUrl is null)
                _description += "\n**Nothing was found for your search request!**";

            Color _color = _img.Rating == "s" ? new Color(0, 255, 0) : new Color(255, 0, 0);

            EmbedBuilder _builder = new EmbedBuilder();
            _builder.Title = _img.Type;
            _builder.Description = _description;
            _builder.Color = _color;
            if (!(_img.FileUrl is null))
                _builder.ImageUrl = _img.FileUrl;
            
            return _builder;
        }
    }
}