Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ciscosparkbot/Spark.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def process_incoming_message(self):
# Find the command that was sent, if any
command = ""
for c in self.commands.items():
if message.text.find(c[0]) != -1:
if message.text.lower().find(c[0]) != -1:
command = c[0]
sys.stderr.write("Found command: " + command + "\n")
# If a command was found, stop looking for others
Expand Down Expand Up @@ -285,7 +285,7 @@ def add_command(self, command, help_message, callback):
:param callback: The function to run when this command is given
:return:
"""
self.commands[command] = {"help": help_message, "callback": callback}
self.commands[command.lower()] = {"help": help_message, "callback": callback}

def remove_command(self, command):
"""
Expand Down Expand Up @@ -315,7 +315,7 @@ def send_help(self, post_data):
"""
message = "Hello! "
message += "I understand the following commands: \n"
for c in self.commands.items():
for c in sorted(self.commands.items()):
if c[1]["help"][0] != "*":
message += "* **%s**: %s \n" % (c[0], c[1]["help"])
return message
Expand Down