Esempio n. 1
0
        private void OnCommitComment(CommitCommentEvent.RootObject obj)
        {
            //https://developer.github.com/v3/activity/events/types/#commitcommentevent
            if (obj == null)
            {
                return;
            }

            SendEventMessage(DiscordMessageFormatter.GetOnCommitCommentMessage(obj));
        }
Esempio n. 2
0
        public static EmbedBuilder GetOnCommitCommentMessage(CommitCommentEvent.RootObject obj)
        {
            var builder = new EmbedBuilder()
            {
                Color       = Const.DISCORD_EMBED_COLOR,
                Description = $"{obj.sender.login} {obj.action} a comment on commit {obj.comment.commit_id} for {obj.repository.full_name}"
            };

            builder.AddField(x =>
            {
                x.Name     = "Comment";
                x.Value    = obj.comment.body;
                x.IsInline = false;
            });

            builder.AddField(x =>
            {
                x.Name     = "Url";
                x.Value    = obj.comment.html_url;
                x.IsInline = false;
            });

            return(builder);
        }