public void WriteHistory(ReplyHistory history) { using (var file = streamFactory.GetWriter(this.CommentIdFilePath)) { foreach (string commentId in history) { file.Write(" {0}", commentId); } } }
public RedditCommentReplyBot(BotConfig config, Gatekeeper gatekeeper, SubredditDirectory directory, Historian historian, ICommentReplyGenerator replyGenerator, IRedditAPI reddit) { this.config = config; this.replyGenerator = replyGenerator; this.reddit = reddit; this.gatekeeper = gatekeeper; this.directory = directory; this.historian = historian; history = historian.ReadHistory(); }
public ReplyHistory ReadHistory() { ReplyHistory history = new ReplyHistory(); string commentIDsString = ReadStringFromFile(); if (commentIDsString == null) { return(history); } var commentList = commentIDsString.Split(' ').ToList(); foreach (var comment in commentList) { history.AddToLog(comment); } return(history); }