diff --git a/nardco.py b/nardco.py index efe30b8cce4cc9eb321b626587c725a9da0f00e9..f67996938282dfcc3b6f4b8cd146ba4923a00550 100755 --- a/nardco.py +++ b/nardco.py @@ -266,6 +266,15 @@ class Boooob(ircbot.SingleServerIRCBot): if not is_l_heure_de_manger() and should_ban(message): serv.privmsg(canal, "PUTAIN ON A DIT NON") + if "di" in message : + const splt = message.split('di') + if len(splt) > 1 : + reponse = splt[1] + if reponse[0:1] == "s " : + reponse = reponse[2:] + + serv.privmsg(reponse) + # REDDIT // A COMPLETER if isCommande(message): serv.privmsg("Titch", "{0} : {1}".format(personne, message)) @@ -286,8 +295,7 @@ class Boooob(ircbot.SingleServerIRCBot): 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", "pacho" + 'kohlanta', 'new', 'del', 'get', 'debat', 'pipo', 'np', 'commit', 'zertyu', 'getsub', 'reddit', "gratuit", "pacho" ] most_likely = (cmd, 0) @@ -494,79 +502,6 @@ class Boooob(ircbot.SingleServerIRCBot): elif args[1] == "decode": serv.privmsg(canal, codage.decode(" ".join(args[2:]))) - elif cmd == "getsub": - res = red.get_new(self.fichier_reddit, canal) - for f in res: - serv.privmsg(canal, f) - - elif cmd == "sub": - bd = open(self.fichier_reddit, "r") - for f in bd: - try: - if canal == f.split("|")[0]: - serv.privmsg(canal, "Liste des subs pour " + - canal + " : " + f.split("|")[1]) - except: - pass - - elif cmd == "delsub": - sub = message.split(" ")[1] - bd = open(self.fichier_reddit, "r") - rem = 0 - tmp = [] - for f in bd: - tmp.append(f) - try: - if sub in f.split("|")[1] and canal == f.split("|")[0]: - rem = 1 - except: - pass - bd.close() - if rem == 1: - bd = open(self.fichier_reddit, "w") - for f in tmp: - if canal == f.split("|")[0]: - h = f.split("|")[1] - h = h.split(",") - h.remove(sub) - g = f.split("|")[0] + "|" + ",".join(h) - else: - g = f - bd.write(g) - serv.privmsg(canal, "sub : " + sub + " enlevé de la bd pour " + canal) - else: - serv.privmsg(canal, "Erreur, le sub n'est pas dans la bd") - - elif cmd == "addsub": - sub = message.split(" ")[1] - bd = open(self.fichier_reddit, "r") - add = 1 - tmp = [] - for f in bd: - tmp.append(f) # On ajoute la ligne -> tmpt est une image de la bd - try: - if sub in f.split("|")[1] and canal == f.split("|")[0]: - add = 0 - except: - pass - bd.close() - if add == 1: - canalok = 0 - bd = open(self.fichier_reddit, "w") - for f in tmp: - if canal == f.split("|")[0]: - g = f + sub + "," - canalok = 1 - else: - g = f - bd.write(g) - if canalok == 0: - bd.write("\n" + canal + "|" + sub + ",") - bd.close() - serv.privmsg(canal, "Subreddit : " + sub + " ajouté a la bd pour " + canal) - else: - serv.privmsg(canal, "Subreddit deja dans la bd...") - elif cmd == "reddit": full = False if len(args) > 1: