public void EditReply(DB4Thing commentToEdit, DB4Comment db4Comment) { string replyMessage = getReplyMessage(db4Comment); _redditService.EditComment(commentToEdit, replyMessage); _logger.Info($"DeltaBot edited a reply -> result: {db4Comment.CommentType.ToString()} link: {commentToEdit.Shortlink}"); }
public void Reply(DB4Thing thing, DB4Comment db4Comment, bool isSticky = false) { string replyMessage = getReplyMessage(db4Comment); _redditService.ReplyToThing(thing, replyMessage, isSticky); _logger.Info($"DeltaBot replied -> result: {db4Comment.CommentType.ToString()} link: {thing.Shortlink}"); }
private string getReplyMessage(DB4Comment db4Comment) { if (string.IsNullOrEmpty(_replyTemplate)) { // Load reply template _replyTemplate = File.ReadAllText(_appConfiguration.TemplateFiles.DB4CommentTemplateFile) .Replace(Environment.NewLine, "\n"); } return(_replyTemplate .Replace(_appConfiguration.ReplaceTokens.DB4ReplyToken, db4Comment.CommentBody) .Replace(_appConfiguration.ReplaceTokens.SubredditToken, _appConfiguration.SubredditName)); }