Пример #1
0
 public UserFlairContextFactory(BerbotConnectionFactory connectionFactory)
 {
     this.connectionFactory = connectionFactory;
     this.auditClient       = connectionFactory.CreateAuditClient();
     this.modRedditClient   = connectionFactory.CreateModRedditClient();
     this.subreddit         = modRedditClient.Subreddit(BerbotConfiguration.RedditSubredditName);
 }
Пример #2
0
        public void BeginMonitoring()
        {
            var client    = connectionFactory.CreateModRedditClient();
            var subreddit = client.Subreddit(BerbotConfiguration.RedditSubredditName);

            subreddit.Comments.NewUpdated += (_, e) => {
                foreach (var c in e.Added)
                {
                    HandleCommentAdded(c, false);
                }
            };
            subreddit.Comments.MonitorNew();
            subreddit.Posts.NewUpdated += (_, e) => {
                foreach (var p in e.Added)
                {
                    HandlePostAdded(p, false);
                }
            };
            subreddit.Posts.MonitorNew();
        }
Пример #3
0
 public UserHistoryCache(ILog log, BerbotConnectionFactory connectionFactory)
 {
     this.log          = log;
     this.dbClient     = connectionFactory.CreateDbClient();
     this.redditClient = connectionFactory.CreateModRedditClient();
 }