From ea6ba7464c2ae7dfb95d24d6538880fbadee2444 Mon Sep 17 00:00:00 2001 From: svitvojimilioni Date: Wed, 7 Feb 2024 19:57:36 -0500 Subject: [PATCH] Dodao frontende za vise servisa - frontendi su u frontends.py fajlu - ima vise instanci da ne bi stalno slao na jednu, da nema centralizacije ;) --- functions.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/functions.py b/functions.py index 6d5a17b..e1bc07e 100644 --- a/functions.py +++ b/functions.py @@ -1,13 +1,16 @@ import ollama import scraper_functions as sf +import random +from frontends import FRONTENDS def processmsg(msg, rcpt): - if "youtube.com/watch" in msg: - return msg.replace("youtube.com", "iv.datura.network") - elif msg.startswith("!"): + if msg.startswith("!"): return command(msg, "") elif "good bot" in msg: return "^_^" + for big_tech_site in FRONTENDS: + if big_tech_site in msg: + return "libre link: " + msg.replace(big_tech_site, random.choice(FRONTENDS[big_tech_site])) def command(msg, rcpt): if msg.startswith("!help"):