From b416e04a9af52c3eee5d60a3d86cf50aabde8210 Mon Sep 17 00:00:00 2001 From: fram3d Date: Mon, 4 Mar 2024 11:28:32 +0100 Subject: [PATCH] fix !vreme issue with wrong number of arguments --- functions.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/functions.py b/functions.py index e1bc07e..b2f27d1 100644 --- a/functions.py +++ b/functions.py @@ -32,6 +32,9 @@ def command(msg, rcpt): content = sf.getDmzTasks("https://todo.dmz.rs/") return content elif msg.startswith("!vreme") or msg.startswith("!prognoza") or msg.startswith("!weather"): - _, query = msg.split(" ", 1) - return sf.get_weather(query) - + commandsplit = msg.split(" ", 1) + if len(commandsplit) = 1: + return sf.get_weather("Beograd") + else: + query = commandsplit[1] + return sf.get_weather(query)