From d3edca832c1da475590ab1cec08f605dbb28da0d Mon Sep 17 00:00:00 2001
From: Loris TICHADOU <loris.tichadou@ensiie.fr>
Date: Thu, 18 Apr 2019 17:39:55 +0200
Subject: [PATCH] Update nardco.py

---
 nardco.py | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/nardco.py b/nardco.py
index c9edaa9..455395e 100755
--- a/nardco.py
+++ b/nardco.py
@@ -217,12 +217,13 @@ class Boooob(ircbot.SingleServerIRCBot):
             cmds = ['help', 'ffs', 'thanos', 'chuck', 'roll', 'rateau', 'viieux', 'kohlanta', 'new', 'del', 'get', 'debat', 'pipo', 'np', 'commit', 'zertyy', 'getsub', 'sub', 'delsub', 'addsub', 'reddit']
 
             most_likely = (cmd, 0)
-            for f in cmds : 
-                ratio = fuzz.ratio(cmd, f)
-                if ratio > 60 and ratio > most_likely[1] : 
-                    most_likely = (f, ratio)
-            
-            cmd = most_likely[0]
+            if cmd not in cmds : 
+
+                for f in cmds : 
+                    ratio = fuzz.ratio(cmd, f)
+                    if ratio > 60 and ratio > most_likely[1] : 
+                        most_likely = (f, ratio)
+                cmd = most_likely[0]
 
 
             if cmd == "help":
@@ -239,10 +240,7 @@ class Boooob(ircbot.SingleServerIRCBot):
                             "tous les subs enregistrés pour le chann) ").format(cmdCarac))
                 else:
                     serv.privmsg(canal,
-                                 ("Commandes disponibles :"
-                                 "{0}help reddit , "
-                                 "{0}rateau,"
-                                 "sinon, tentez de dire 'op plz' ...").format(cmdCarac))
+                                 ("Commandes disponibles :{0}").format(', '.join(cmds)))
 
             elif cmd == "ffs" :
                 serv.privmsg(canal, "Nom de Dieu de putain de bordel de merde de saloperie de connard d'enculé de ta mère")
-- 
GitLab