From 544f8052e91fc887e273ebdcf6650c1fd0930ca8 Mon Sep 17 00:00:00 2001 From: fram3d Date: Tue, 6 Feb 2024 20:48:08 +0100 Subject: [PATCH] fix wiki placing it into command functions --- functions.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/functions.py b/functions.py index fb47583..57fd81a 100644 --- a/functions.py +++ b/functions.py @@ -4,8 +4,8 @@ import scraper_functions as sf def processmsg(msg, rcpt): if "youtube.com/watch" in msg: return msg.replace("youtube.com", "iv.datura.network") - elif msg.startswith("!wiki"): - return sf.query_external_website("https://en.wikipedia.org/wiki/", msg.split(" ")[1]) + elif msg.startswith("!"): + return command(msg) elif "good bot" in msg: return "^_^" @@ -20,4 +20,6 @@ def command(msg, rcpt): client = ollama.Client(host='https://ollama.krov.dmz.rs') response = client.chat(model='llama2-uncensored:latest', messages=[{'role':'user','content':f'{msg[4:]}'}]) return(response['message']['content']) + elif msg.startswith("!wiki"): + return sf.query_external_website("https://en.wikipedia.org/wiki/", msg.split(" ")[1])