Render tweets for invisible interface from template specified in config

This commit is contained in:
Manuel Cortez 2021-12-10 15:22:42 -06:00
parent a47fa31346
commit af4594f16c
No known key found for this signature in database
GPG Key ID: 9E0735CA15EFE790

View File

@ -19,7 +19,7 @@ import languageHandler
import logging import logging
from audio_services import youtube_utils from audio_services import youtube_utils
from controller.buffers.base import base 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 mysc.thread_utils import call_threaded
from tweepy.errors import TweepyException from tweepy.errors import TweepyException
from tweepy.cursor import Cursor from tweepy.cursor import Cursor
@ -100,8 +100,10 @@ class BaseBuffer(base.Buffer):
return self.get_message() return self.get_message()
def get_message(self): def get_message(self):
template = self.session.settings["templates"]["tweet"]
tweet = self.get_right_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): def get_full_tweet(self):
tweet = self.get_right_tweet() tweet = self.get_right_tweet()