From 5ff7622830408c1186466f70ebf1486526447ce2 Mon Sep 17 00:00:00 2001 From: Someone Date: Mon, 5 Sep 2022 21:27:01 +0200 Subject: [PATCH] modules/CommandRoom.py --- modules/CommandRoom.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/CommandRoom.py b/modules/CommandRoom.py index 834a9c1..3c1fb65 100644 --- a/modules/CommandRoom.py +++ b/modules/CommandRoom.py @@ -30,12 +30,12 @@ class CommandRoom(AbstractCommand): send_to_chan = True if not search or search == "--chan": - request.cmd_respond_text_temp("You did not provide a room name.\n``/"+self.TRIGGER+" "+data["text"]+"``") + request.respond_cmd_err("``/"+self.TRIGGER+"`` you did not provide a room name. :(") return r = requests.get(self.toss_url_api_search+"?q="+requests.utils.quote(search)) if r.status_code != 200: - request.cmd_respond_text_temp(":stop_sign: TOSS-query failed. :(\n"+str(repr(r))+"\n``/"+self.TRIGGER+" "+data["text"]+"``") + request.respond_cmd_err("``/"+self.TRIGGER+"`` TOSS-query failed. :(\n"+str(repr(r))+"\n``/"+self.TRIGGER+" "+data["text"]+"``") return msg = "#### ** [:toss: ``Results``](https://toss.fsinf.at/?q="+requests.utils.quote(search)+") ``(max 5)``**" @@ -47,15 +47,15 @@ class CommandRoom(AbstractCommand): break msg += "\n#### "+entry["name"]+" ("+entry["code"]+")\n" - if entry["address"]: + if "address" in entry: msg += ":world_map:[``"+entry["address"]+"``](https://www.google.com/maps/search/"+requests.utils.quote(entry["address"].split(";")[0])+")" - if entry["description"]: + if "description" in entry: msg += "\n"+entry["description"] msg += "\n\n----\n\n" if cnt == 0: - request.cmd_respond_text_temp("#### **``No`` :toss: ``Results``** :(\n``/"+self.TRIGGER+" "+data["text"]+"``") + request.respond_cmd_err("#### **``No`` :toss: ``Results``** :(\n``/"+self.TRIGGER+" "+data["text"]+"``") elif not send_to_chan: - request.cmd_respond_text_temp(msg+"\n``/"+self.TRIGGER+" "+data["text"]+"``") + request.respond_cmd_temp(msg+"\n``/"+self.TRIGGER+" "+data["text"]+"``") else: - request.cmd_respond_text_chan(msg+"\n``/"+self.TRIGGER+" "+data["text"]+"``") + request.respond_cmd_chan(msg+"\n``/"+self.TRIGGER+" "+data["text"]+"``") -- 2.43.0