Fixed list issues
This commit is contained in:
parent
db6c13655e
commit
1c15bf4a4e
@ -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
|
||||
|
||||
|
||||
|
10
bot/main.py
10
bot/main.py
@ -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.
Loading…
x
Reference in New Issue
Block a user