From 23404108f605169fd6d4e075cf7599ac644318a4 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Mon, 13 May 2019 13:38:32 -0400 Subject: [PATCH] add lower --- sopel_modules/SpiceBot_CommandsQuery/QueryCommand.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sopel_modules/SpiceBot_CommandsQuery/QueryCommand.py b/sopel_modules/SpiceBot_CommandsQuery/QueryCommand.py index 9751d75..5e05f93 100644 --- a/sopel_modules/SpiceBot_CommandsQuery/QueryCommand.py +++ b/sopel_modules/SpiceBot_CommandsQuery/QueryCommand.py @@ -44,9 +44,10 @@ def query_detection(bot, trigger): return if triggercommand not in commands_list.keys(): + dispmsg = ["Cannot find any alias commands: No valid commands match " + str(triggercommand) + "."] closestmatches = similar_list(bot, triggercommand, commands_list.keys(), 10, 'reverse') - dispmsg = ["Cannot find any alias commands: No valid commands match " + str(triggercommand) + ".", - "The following commands match " + str(triggercommand) + ": " + spicemanip.main(closestmatches, 'andlist') + "."] + if len(closestmatches): + dispmsg.append("The following commands match " + str(triggercommand) + ": " + spicemanip.main(closestmatches, 'andlist') + ".") bot.notice(dispmsg, trigger.nick) return @@ -72,7 +73,7 @@ def query_detection(bot, trigger): commandlist = [] for command in commands_list.keys(): - if command.lower().startswith(triggercommand): + if command.lower().startswith(str(triggercommand).lower()): commandlist.append(command) if not len(commandlist):