From 7986fb1f3eadbe9b5b28db5fb2e2a78b1e363e98 Mon Sep 17 00:00:00 2001 From: CMDR furrycat Date: Sun, 6 Nov 2016 21:51:12 +0000 Subject: [PATCH] Accept multiple matches if the first matches exactly. --- plugin/shopping/shopping.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugin/shopping/shopping.py b/plugin/shopping/shopping.py index a228120..c5f6a42 100644 --- a/plugin/shopping/shopping.py +++ b/plugin/shopping/shopping.py @@ -310,9 +310,10 @@ class Shopping(object): if system is not None: systems = list(self.find_system(system)) if len(systems) > 1: - log.warning('More than one system matched {}.'.format(system)) - yield from bot.say(message.channel, 'Which system? {}', ','.join([s['name'] for s in systems])) - return False + if systems[0]['name'].lower() != system.lower(): + log.warning('More than one system matched {}.'.format(system)) + yield from bot.say(message.channel, 'Which system? {}', ','.join([s['name'] for s in systems])) + return False elif not len(systems): log.warning('No system matched {}.'.format(system)) yield from bot.say(message.channel, 'Where is {}?'.format(system)) -- 2.7.4