fix !vreme issue with wrong number of arguments

This commit is contained in:
fram3d 2024-03-04 11:28:32 +01:00
parent f2b288fa30
commit b416e04a9a
Signed by: fram3d
GPG Key ID: 938920E709EEA32A
1 changed files with 6 additions and 3 deletions

View File

@ -32,6 +32,9 @@ def command(msg, rcpt):
content = sf.getDmzTasks("https://todo.dmz.rs/") content = sf.getDmzTasks("https://todo.dmz.rs/")
return content return content
elif msg.startswith("!vreme") or msg.startswith("!prognoza") or msg.startswith("!weather"): elif msg.startswith("!vreme") or msg.startswith("!prognoza") or msg.startswith("!weather"):
_, query = msg.split(" ", 1) commandsplit = msg.split(" ", 1)
if len(commandsplit) = 1:
return sf.get_weather("Beograd")
else:
query = commandsplit[1]
return sf.get_weather(query) return sf.get_weather(query)