From 0e21f0d26dfe1523e14a05a6354c5cf304cfd9e4 Mon Sep 17 00:00:00 2001
From: Loris TICHADOU <loris.tichadou@ensiie.fr>
Date: Sat, 31 Jul 2021 08:28:51 +0000
Subject: [PATCH] Update nardco.py

---
 nardco.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/nardco.py b/nardco.py
index 5cd1dd0..efe30b8 100755
--- a/nardco.py
+++ b/nardco.py
@@ -162,7 +162,7 @@ class Boooob(ircbot.SingleServerIRCBot):
         if personne == "Senseo" : 
             serv.privmsg(canal, "<" + no_hl("Senseo") + "> : " + message)
 
-
+        originalMessage = message
         message = message.lower()  # Passe le message en minuscules
         split = message.split(" ")
         if "op pls" in message or "op plz" in message:
@@ -270,6 +270,7 @@ class Boooob(ircbot.SingleServerIRCBot):
         if isCommande(message):
             serv.privmsg("Titch", "{0} : {1}".format(personne, message))
             args = message[1:].split(" ")
+            originalArgs = originalMessage[1:].split(" ")
             cmd = args[0]
             if cmd == "$$" and last_args and last_cmd:
                 args = last_args
@@ -449,12 +450,12 @@ class Boooob(ircbot.SingleServerIRCBot):
                     serv.privmsg(canal, kohlanta.kohlanta(args[1], canal))
 
             elif cmd == "new":
-                if len(args) > 1:
+                if len(originalArgs) > 1:
                     if args[1] in personnalizedCmd.keys():
                         serv.privmsg(canal, 'commande deja existante')
                     else:
                         newCmd = {}
-                        newCmd['result'] = ' '.join(args[2:])
+                        newCmd['result'] = ' '.join(originalArgs[2:])
                         newCmd['author'] = personne
                         newCmd['channel'] = canal
                         personnalizedCmd[args[1]] = newCmd
-- 
GitLab