From d120f7e261db6f6bf174cab3cf53b606a7e610c5 Mon Sep 17 00:00:00 2001 From: Loris TICHADOU <loris.tichadou@ensiie.fr> Date: Tue, 1 Dec 2020 11:37:44 +0100 Subject: [PATCH] Update nardco.py --- nardco.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/nardco.py b/nardco.py index 3899178..02fb688 100755 --- a/nardco.py +++ b/nardco.py @@ -245,10 +245,10 @@ class Boooob(ircbot.SingleServerIRCBot): serv.privmsg("Titch", "{0} : {1}".format(personne, message)) args = message[1:].split(" ") cmd = args[0] - if cmd == "!!" and last_args and last_cmd: + if cmd == "$$" and last_args and last_cmd: args = last_args cmd = last_cmd - if cmd == "!" and last_cmd: + if cmd == "$" and last_cmd: cmd = last_cmd if len(args) > 1 and args[1] == "!": @@ -257,8 +257,11 @@ class Boooob(ircbot.SingleServerIRCBot): last_args = args last_cmd = cmd - cmds = ['help', 'bdsm', 'haddock', 'useless', 'quizz', 'ecole', 'ffs', 'thanos', 'chuck', 'roll', 'rateau', 'viieux', - 'kohlanta', 'new', 'del', 'get', 'debat', 'pipo', 'np', 'commit', 'zertyu', 'getsub', 'sub', 'delsub', 'addsub', 'reddit'] + cmds = [ + 'help', 'bdsm', 'haddock', 'useless', 'quizz', 'ecole', 'ffs', 'thanos', 'chuck', 'roll', 'rateau', 'viieux', + 'kohlanta', 'new', 'del', 'get', 'debat', 'pipo', 'np', 'commit', 'zertyu', 'getsub', 'sub', 'delsub', + 'addsub', 'reddit', "gratuit" + ] most_likely = (cmd, 0) if cmd not in cmds: @@ -268,6 +271,14 @@ class Boooob(ircbot.SingleServerIRCBot): if ratio > 60 and ratio > most_likely[1]: most_likely = (f, ratio) cmd = most_likely[0] + + if 'gratuit' in cmd : + canal2 = self.channels[canal] + serv.privmsg(canal, "Et hop, on hl tout le monde !") + result = "" + for user in canal2.users() : + result = "{0}, {1}".format(result, user) + serv.privmsg(canal, result) if 'spoil' in args or 'spoil' in cmd: serv.privmsg(canal, "Le risque de spoil est present. je fais pas ça.") -- GitLab