Fixed list issues

This commit is contained in:
Remy Moll 2021-01-13 12:34:18 +01:00
parent db6c13655e
commit 1c15bf4a4e
3 changed files with 10 additions and 2 deletions

View File

@ -121,7 +121,7 @@ class BotFramework():
if max_match == 1:
return True
if max_match != 0:
self.telegram.send_message("Did you mean <code>" + command_candidate + "</code>")
self.telegram.send_message("Did you mean <code>" + command_candidate + "</code>?")
return False

View File

@ -428,7 +428,7 @@ class ChatBot(FW.BotFramework):
try:
if args[0] == "all":
try:
return "Existing lists are: " + list(self.persistence["global"]["lists"].keys()).join(" ")
return "Existing lists are: " + " ".join(list(self.persistence["global"]["lists"].keys()))
except:
return "No lists created."
if len(args) < 2:
@ -459,6 +459,14 @@ class ChatBot(FW.BotFramework):
self.persistence["global"]["lists"][lname] += [add]
return "Added " + add + "."
elif act == "remove":
if len(args) < 3:
return "Missing paramaeter"
try:
ind = int(args[2]) - 1
item = self.persistence["global"]["lists"][lname].pop(ind)
return "Removed " + item + " from list " + lname + "."
except:
return "Couldn't remove item."
return "Not working yet"
except:
output = "Could not handle your request. Maybe check the keys?"

Binary file not shown.