Fixed list issues
This commit is contained in:
parent
db6c13655e
commit
1c15bf4a4e
@ -121,7 +121,7 @@ class BotFramework():
|
|||||||
if max_match == 1:
|
if max_match == 1:
|
||||||
return True
|
return True
|
||||||
if max_match != 0:
|
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
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
10
bot/main.py
10
bot/main.py
@ -428,7 +428,7 @@ class ChatBot(FW.BotFramework):
|
|||||||
try:
|
try:
|
||||||
if args[0] == "all":
|
if args[0] == "all":
|
||||||
try:
|
try:
|
||||||
return "Existing lists are: " + list(self.persistence["global"]["lists"].keys()).join(" ")
|
return "Existing lists are: " + " ".join(list(self.persistence["global"]["lists"].keys()))
|
||||||
except:
|
except:
|
||||||
return "No lists created."
|
return "No lists created."
|
||||||
if len(args) < 2:
|
if len(args) < 2:
|
||||||
@ -459,6 +459,14 @@ class ChatBot(FW.BotFramework):
|
|||||||
self.persistence["global"]["lists"][lname] += [add]
|
self.persistence["global"]["lists"][lname] += [add]
|
||||||
return "Added " + add + "."
|
return "Added " + add + "."
|
||||||
elif act == "remove":
|
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"
|
return "Not working yet"
|
||||||
except:
|
except:
|
||||||
output = "Could not handle your request. Maybe check the keys?"
|
output = "Could not handle your request. Maybe check the keys?"
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user