From 0694746aa2671ddba501f3e227cc0eb211f6ace9 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 3 Oct 2016 09:41:09 +0200 Subject: [PATCH] Sistemati casi improbabili in /match --- bot.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/bot.py b/bot.py index 3d42f80c..f42836da 100644 --- a/bot.py +++ b/bot.py @@ -519,14 +519,17 @@ def match(): tobematched.append(royalgames[name.lower()]["steam"]) if len(tobematched) > 1: m = list(steammatch.compare(tobematched)) - # Prepara il messaggio - tosend = str() - for game in m: - tosend += "- {game}\n".format(game=game) - # Manda il messaggio - telegram.sendmessage(tosend, sentin, source) + if len(m) > 0: + # Prepara il messaggio + tosend = "*Giochi in comune tra questi utenti:*\n" + for game in m: + tosend += "- {game}\n".format(game=game) + # Manda il messaggio + telegram.sendmessage(tosend, sentin, source) + else: + telegram.sendmessage("*Giochi in comune tra questi utenti:*\n_nessuno_", sentin, source) else: - telegram.sendmessage(chr(9888) + "Non sono stati specificati abbastanza utenti per eseguire l'intersezione.", + telegram.sendmessage(chr(9888) + "Non sono stati specificati abbastanza utenti per eseguire l'azione.", sentin, source)