From 4e58ee1fc626ed3af3f216b1105885e8b4a43cdd Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Wed, 27 Nov 2019 22:36:29 +0300 Subject: [PATCH] fix mtg --- bots/modules/_mtg.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bots/modules/_mtg.py b/bots/modules/_mtg.py index f390c55..2dcb5ec 100644 --- a/bots/modules/_mtg.py +++ b/bots/modules/_mtg.py @@ -49,9 +49,10 @@ class MTG(object): if second_word is not None: return first_word, second_word elif first_word is not None: - if len(self.MC['.' + '+' + first_word]) != 0: + if ('.' + '+' + first_word in self.MC) and len(self.MC['.' + '+' + first_word]) != 0: second_word = random.choice(self.MC['.' + '+' + first_word]) - elif len(self.MC['.' + '+' + first_word.capitalize()]) != 0: + elif ('.' + '+' + first_word.capitalize() in self.MC) and \ + len(self.MC['.' + '+' + first_word.capitalize()]) != 0: second_word = random.choice(self.MC['.' + '+' + first_word.capitalize()]) else: return self.choose_start_words()