Пример #1
0
        private EmbedReference SingleUpdate()
        {
            if (UpdatedRefs == null || UpdatedRefs.Count() != 1)
            {
                return(null);
            }

            if ((CreatedRefs?.Any() ?? false) ||
                (DeletedRefs?.Any() ?? false) ||
                (MissingRefs?.Any() ?? false) ||
                (SkippedRefs?.Any() ?? false) ||
                (GlobalRefs?.Any() ?? false) ||
                (LockedRefs?.Any() ?? false))
            {
                return(null);
            }

            return(UpdatedRefs.First());
        }
Пример #2
0
        private Embed ReportEmbed()
        {
            var fields = new List <EmbedFieldBuilder>();

            if (CreatedRefs?.Any() ?? false)
            {
                fields.Add(ListField("I created", CreatedRefs.Select(RefLabel)));
            }

            if (DeletedRefs?.Any() ?? false)
            {
                fields.Add(ListField("I deleted", DeletedRefs.Select(RefLabel)));
            }

            if (UpdatedRefs?.Any() ?? false)
            {
                fields.Add(ListField("I updated", UpdatedRefs.Select(RefLabel)));
            }

            if (GlobalRefs?.Any() ?? false)
            {
                fields.Add(ListField("These are global", GlobalRefs.Select(RefLabel)));
            }

            if (LockedRefs?.Any() ?? false)
            {
                fields.Add(ListField("These are locked", LockedRefs.Select(RefLabel)));
            }

            if (MissingRefs?.Any() ?? false)
            {
                fields.Add(ListField("These didn't exist", MissingRefs.Select(RefLabel)));
            }

            if (SkippedRefs?.Any() ?? false)
            {
                fields.Add(ListField("I skipped these", SkippedRefs.Select(RefLabel)));
            }

            return(new EmbedBuilder().WithFields(fields).Build());
        }