diff --git a/src/delojza.py b/src/delojza.py index a41890a..f13a1c8 100755 --- a/src/delojza.py +++ b/src/delojza.py @@ -488,6 +488,10 @@ class DelojzaBot: file = message.voice.file_id if file is not None: + if self.markov and random.random() > .66: + sentence = self.markov.make_sentence() + if sentence: + message.reply_text(sentence) url = bot.getFile(file).file_path return self.handle([url], message, hashtag, self.download_raw, filetitle=filetitle) else: @@ -497,6 +501,11 @@ class DelojzaBot: urls = list(map(lambda e: message.parse_entity(e), filter(lambda e: e.type == 'url', message.entities))) + if len(urls) > 0 and self.markov and random.random() > .66: + sentence = self.markov.make_sentence() + if sentence: + message.reply_text(sentence) + ytdl_res = False ytdl_urls = [url for url in urls if self.ytdl_can(url)] if len(ytdl_urls) > 0: