From af4594f16c5d4e95d524fb0bb0ca3c35f7146dd6 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Fri, 10 Dec 2021 15:22:42 -0600 Subject: [PATCH] Render tweets for invisible interface from template specified in config --- src/controller/buffers/twitter/base.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/controller/buffers/twitter/base.py b/src/controller/buffers/twitter/base.py index 3ad5b77c..3d7c1767 100644 --- a/src/controller/buffers/twitter/base.py +++ b/src/controller/buffers/twitter/base.py @@ -19,7 +19,7 @@ import languageHandler import logging from audio_services import youtube_utils from controller.buffers.base import base -from sessions.twitter import compose, utils, reduce +from sessions.twitter import compose, utils, reduce, templates from mysc.thread_utils import call_threaded from tweepy.errors import TweepyException from tweepy.cursor import Cursor @@ -100,8 +100,10 @@ class BaseBuffer(base.Buffer): return self.get_message() def get_message(self): + template = self.session.settings["templates"]["tweet"] tweet = self.get_right_tweet() - return " ".join(self.compose_function(tweet, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"], self.session)) + t = templates.render_tweet(tweet, template, self.session, relative_times=self.session.settings["general"]["relative_times"], offset_seconds=self.session.db["utc_offset"]) + return t def get_full_tweet(self): tweet = self.get_right_tweet()