Ejemplo n.º 1
0
        /// <inheritdoc />
        public EmbedBuilder BuildQuoteEmbed(IMessage message, IUser executingUser)
        {
            if (IsQuote(message))
            {
                return(null);
            }

            var embed = new EmbedBuilder();

            if (TryAddRichEmbed(message, executingUser, ref embed))
            {
                return(embed);
            }

            if (message.Attachments.Any(x => x.IsSpoiler()) ||
                message.Embeds.Any() && FormatUtilities.ContainsSpoiler(message.Content))
            {
                embed.AddField("Spoiler warning", "The quoted message contains spoilered content.");
            }
            else if (!TryAddImageAttachment(message, embed))
            {
                if (!TryAddImageEmbed(message, embed))
                {
                    if (!TryAddThumbnailEmbed(message, embed))
                    {
                        TryAddOtherAttachment(message, embed);
                    }
                }
            }

            AddContent(message, embed);
            AddOtherEmbed(message, embed);
            AddActivity(message, embed);
            AddMeta(message, executingUser, embed);

            return(embed);
        }