From 5bde82262353b3d03c8d250243fa5dfaf6e328ca Mon Sep 17 00:00:00 2001 From: Klafyvel Date: Thu, 2 Aug 2018 14:40:42 +0200 Subject: [PATCH] Ajout des fichiers --- README.md | 3 + bots.yaml | 46 ++++ install.sh | 7 + klafirc.service | 14 + klafirc/__init__.py | 7 + klafirc/__main__.py | 3 + klafirc/__pycache__/__init__.cpython-36.pyc | Bin 0 -> 280 bytes klafirc/__pycache__/__main__.cpython-36.pyc | Bin 0 -> 165 bytes klafirc/__pycache__/bot.cpython-36.pyc | Bin 0 -> 2017 bytes klafirc/__pycache__/irc.cpython-36.pyc | Bin 0 -> 2626 bytes klafirc/__pycache__/loader.cpython-36.pyc | Bin 0 -> 1363 bytes klafirc/__pycache__/runner.cpython-36.pyc | Bin 0 -> 1017 bytes klafirc/__pycache__/settings.cpython-36.pyc | Bin 0 -> 668 bytes klafirc/bot.py | 68 +++++ klafirc/irc.py | 55 ++++ klafirc/klafirc.log | 289 ++++++++++++++++++++ klafirc/loader.py | 38 +++ klafirc/runner.py | 21 ++ klafirc/settings.py | 24 ++ requirements.txt | 11 + 20 files changed, 586 insertions(+) create mode 100644 README.md create mode 100644 bots.yaml create mode 100644 install.sh create mode 100644 klafirc.service create mode 100644 klafirc/__init__.py create mode 100644 klafirc/__main__.py create mode 100644 klafirc/__pycache__/__init__.cpython-36.pyc create mode 100644 klafirc/__pycache__/__main__.cpython-36.pyc create mode 100644 klafirc/__pycache__/bot.cpython-36.pyc create mode 100644 klafirc/__pycache__/irc.cpython-36.pyc create mode 100644 klafirc/__pycache__/loader.cpython-36.pyc create mode 100644 klafirc/__pycache__/runner.cpython-36.pyc create mode 100644 klafirc/__pycache__/settings.cpython-36.pyc create mode 100644 klafirc/bot.py create mode 100644 klafirc/irc.py create mode 100644 klafirc/klafirc.log create mode 100644 klafirc/loader.py create mode 100644 klafirc/runner.py create mode 100644 klafirc/settings.py create mode 100644 requirements.txt diff --git a/README.md b/README.md new file mode 100644 index 0000000..df863c5 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +#Klafirc + +Klafirc is a simple irc bot which react to matches and pings. diff --git a/bots.yaml b/bots.yaml new file mode 100644 index 0000000..3885d41 --- /dev/null +++ b/bots.yaml @@ -0,0 +1,46 @@ +bots: + sel: + on_ping: + - "Arcas:`à viarezo ils font des caleçons.` Chibrac:`bah non au rezo, à viarezo ils ont pas de boules à couvrir`" + - "Unleash the salt" + - "Les lentilles c'est extrêmement pratique de base pour toute personne active [wink-wink Chibrac, NDLR]" + - "proxima (ViaRézo):Pour ce qui est du reste, nous avons, je crois, bien compris votre demande ; mais nos impératifs actuels, surtout pour Rennes et Metz, impliquent de passer par notre école, qui est a priori assez frileuse vis-à-vis du Crans et de ses relations avec le CROUS; nous espérons donc pouvoir à terme nous rapprocher de la présentation que tu décris, mais cela impliquerait un travail en amont pour ne pas contrevenir à nos propres efforts, et nous souhaiterions donc que vous présentiez pas, pour l’instant, vos démarches comme une action commune avec ViaRézo." + - "J'ai vraiment hâte de rencontrer les N1As de l'année prochaine." + - "À Metz vous êtes vraiment des experts." + - "Centrale Metz" + - " bon, babel avec un pare-feu nftables, vous avez prévu d'y réfléchir pour 2042 ou ça a des chances d'arriver sous peu ?" + - " je glande presque autant qu'un pelec" + - " choisi l'excuse du moment chez ton supelec : l'inté, la campagne, les partiels, les vacances" + - " Chirac on connaît tous tes performances scolaires t'inquiète pas" + on_match: + 'détruire le monde' : "Manu on fait des collages ?" + '{name}, pourquoi es-tu là ?' : "{user} : En l'an 2018, en plus d'être feignants, les Rézomen devinrent salés à cause de la fermeture du campus. C'est pourquoi un jeune Rézoman nommé Klafyvel m'a créé, afin d'avoir un salage automatique de {channel}. Depuis je hante le chan." + 'on peut te joindre sur irc et telegram ?' : "{user} : oui, sur telegram pour que mes amis iraniens profitent de ma science et sur irc en attendant que les barbus en mode de reconnaissance se mettent à la page. Je pense qu'on devrait ajouter un bridge matrix \U0001f914" + Macron: + on_ping: + - "PARCE QUE C'EST NOTRE PROJEEEET !" + on_match: + 'tocard' : "Est-ce que je peux dire autocar ?" + '^Manu.*\?' : "Tu m’appelles monsieur le président de la République, ou monsieur." + Patou: + on_ping: + - "En parlant de ça, Centrale ne sait vraiment pas travailler en multicampus" + - "On avait ouvert une voie d'escalade sur une des façades de la résidence" + - "Je vous ai parlé de la fois où j'ai discuté avec Bill Gates ?" + - "Bosse plutôt que de me faire la conversation !" + - "On parle, on parle, mais le code il avance pas beaucoup" + - "Garantie 5 ans puis poubelle" + - "Ben non, c'est une idée de merde" + - "Oui, vas-y, fait comme tu veux" + - "Je suis généreux, mais toi ça va pas être facile de te trouver des points" + - "Attend un peu, il y a Konrad qui m'appelle. Qu'est-ce qu'il me veut encore celui-là ?" + - "Hein !?" + - "Faites du vpn sur l'ecole ou sur la rez depuis l'exterieur" + - "Je viens donc de supprimer les comptes et de détruire les boites mail" + - "Au fait, j'ai l'impression que vous avez limité ma vitesse de téléchargement, c'est un peu lent je trouve ... évitez de brider ma machine svp" + +channels: + - server: irc.rezometz.org + port: 6667 + channel: "#test" + bots: [sel, Macron, Patou] diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..0fba832 --- /dev/null +++ b/install.sh @@ -0,0 +1,7 @@ +pip3 install -r requirements.txt +mkdir /var/log/klafirc +mkdir /etc/klafirc +cp bots.yaml /etc/klafirc +cp klafirc.service /etc/systemd/system/ +systemctl enable klafirc.service +systemctl start klafirc.service diff --git a/klafirc.service b/klafirc.service new file mode 100644 index 0000000..3ca1650 --- /dev/null +++ b/klafirc.service @@ -0,0 +1,14 @@ +[Unit] +Description=Klafyirc bots +After=network-online.target + +[Service] +Type=simple + +User=klafirc +Group=klafirc + +ExecStart=python3 -m klafirc + +[Install] +WantedBy=multi-user.target diff --git a/klafirc/__init__.py b/klafirc/__init__.py new file mode 100644 index 0000000..0c77e2e --- /dev/null +++ b/klafirc/__init__.py @@ -0,0 +1,7 @@ +""" +A simple irc bot. See /etc/klafirc/bots.yaml to see which bots are runned. +""" + +from .runner import run + +__version__ = "0.1" diff --git a/klafirc/__main__.py b/klafirc/__main__.py new file mode 100644 index 0000000..7c15dec --- /dev/null +++ b/klafirc/__main__.py @@ -0,0 +1,3 @@ +from . import run + +run() diff --git a/klafirc/__pycache__/__init__.cpython-36.pyc b/klafirc/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c4c15dc393573b1050506a303e74799f15cfecb8 GIT binary patch literal 280 zcmX|5yH3ME5WI&2ks&?hwQlY}vs23AqU&4Z>gH%ps*0%MzU$EH{F_r)!6!+= zL0;>d=OUZV0c@xN%Cp%PK> X1L)m2E$`Z3_a5&hy+|2RCN9MvaRg2n literal 0 HcmV?d00001 diff --git a/klafirc/__pycache__/__main__.cpython-36.pyc b/klafirc/__pycache__/__main__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4ae9bb2fc4c1aead656145e2be0c5195d5f07c6c GIT binary patch literal 165 zcmXr!<>lJ;IVoC_fq~&M5W@izkmUfx#bQ7rg&~D8has0Sijk2am9d$Dks*aCm_d{I zB_mK$lkpaFQE8r^Cetm3B9OL~3`HzJ3QYXc)6dAyP1VoNNldFOOU=|ZFO~ZcU5&w)mP<@wzqqK{&V{6&mBVk zA{)a7{uriu4+tlmW@K2ebVwf&ZgKl5;r7ZJTAY4G0_Sg#BPTJ^W>~-+!&G;H2r{Ic zpftChlA+CQ?!fABmwT|fyu*E1J>CUtJ#Bwdlrb8>fvW@aQ<&-qNJT3Wf>S`Lp z@Gwu}vpkxL!*p+yajS5$xbedWM}rUVv*5vZ#}9r&#brRXgA9C~-&oU~ zcoOBg$h0#nWT`zRji3GIyvIgLu)!@Cf;coJCJ zQ6d{j4Ak#Lz6Q&S;9ycr#lcw?jV{kccEH8C*?_O@3ZFliU1~oJ6NpL}x)|ggAjI?N z)o;;BNQx7}okCKc+e^E$fVWF0bt{^BBU0JFLOPBBLy&2E z@yA2XAq&k1v$ANSI(St+%ts%xuOR`dln@4XF-hXdU6zcPxf7gSBw5Dbay%B&7>#mu zA>^RV6DGEK_+?wQ{wX{l^72Y4uq9Lrkr*h6aX1M&8z&eM=_BbO*+S9>5;zj0s$Juq z_M3Mxt9dD&lqO|0*+s#A#Ch0Ay#Xf*trFj%4((ZsUChU($bZTOOUC2`O<_(TBM@~8 zMFUZ{7H_{C^@t&wP6A7IK}UPhY$kFJTXb8Z1J^zD@p)9b4VTJPt6k%yxri|uIM8H^ zliy$iSO8yE&<*y<(lLlZoLH4pL2r2OF5NL%dQUz^?4-_$d`7;%v+PtIK#{$o@?Pbo z9^O@*eUf$nRW726lE?SHA(huB@)_LvYw2fYH|@cGYegH`rH>Z4llI|7e{8LccI82I z+~_7H_#Yv>_&;V(}@h?R=m-)3O_c`>Q%eH(P?5V3~U(nkUVgoVS zKs?rfcJOO;XYIzqW```;)~=dmNmql)+5E|wD)*_s13%ZCLc=kw|MazgR6B4V^P@1>V8r?t DNZjE3 literal 0 HcmV?d00001 diff --git a/klafirc/__pycache__/irc.cpython-36.pyc b/klafirc/__pycache__/irc.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..12c69a07aa86c80ef75d9f26d6879a31d28c145f GIT binary patch literal 2626 zcmaJ@OOx9~5T4Q7UVF17n=FqMB|>@_kFX_rDXKtMMdPcU_VGFsYr#-Lk`TFaYKI`|p)4z{?{l#PKFLvf}px;JQ zzd;Blc)=z-=A3k^uqJkFPn_7ne_J?(JMm&q>u%vsf;iypYbHG5KV`zt__(vM<1R)5 z(ZNV3bH-a3>51-7EZTYj3oPP|oy#<`8ee9Ew60_m9LuV%(yDmD+XY`$HP(4WH5z3y zrESZ{ZWVP0O2%R?SZoO%+t1jL3rpBfgV@o!BV6dNaW3|ZOR+DyV(Tf3gJ;ZPaR+Yo z8t~PY{t^^*Kb%YCdNRYiunrS=(br@Uc5*V^3Jm`2xT} z_t64?p<#p#`*3#YNjaEgr(v$bv?|Lituui;Iy4$}8&^$_GbsaDXtvu0c~yQl5SjF8 z(8bV%FD(dYA8<{KfO1==>;9FvSNt7lO$;|P%26OWdB4r z?p2fQ#{FV2Jb9QEH$?VO|3OGrJ@ozK6S)PmT{H#C0ElhA%V(DjRQsDArWUQhL%oZp z(fR<&8m+m;<}6-w#Ot|r7NfV;7>Qi1UT%jURZ~-ASAYAB8=QK@DMU*JZmu`FAX?r_dK)xHB2p?>$lFCnUr#c9^wq? z+Ot2BTW#^ zm)KT=6B8v*N2zh93du=`H1)B|$M{8Lj)T_av+WkG zb`cUkND|89Bx$-yGO5J0Aib9)52k~no$-@IRB4jvl+-kpui{`yagc98H2pTm)2t}4 zZpEr4$u+-;)>KQhTi~|Ub9;VZ2e!_i6f>)bn0FgZeFU*Cv%*5@wCPQN9tBo-=w0E9 z0KF%uoOYX*5qC{R+92y@qJXLin{%RUf;x`PNEA!H4wDA`mWg^`btRpv1Y2I_b&|YG zUTW5HkI$|cd|TW5%S9<=2|d)WoS+!d zqr{r}z0M$HHzjk^X=f^_E6h3!#^>EspLk%l<3uVXR3%&g13tU9>Hm2fHts_AIiM2= zBg%e(^fIYbTVtDUw!F{o+HN=;=%FCYJ)hF(g zD<&A*e0Kf+FJrc>_^}ZhbDae{wdQPYCAz4MZD?qQCypkqDO;K#y1uu8a0Wuih9AEi zf&S4nFT@Y+=f zOuU1pjRib#=%+^yqkgdl)MjTno0oMa%dFO6k_58J6soj% yZ)A0ia;J1S;|}g&=xbh$eeIh}zWFaiXEh!G literal 0 HcmV?d00001 diff --git a/klafirc/__pycache__/loader.cpython-36.pyc b/klafirc/__pycache__/loader.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e361f08946793c69e0cda58730074d85c3b12451 GIT binary patch literal 1363 zcmZWo&u`>36t*45$;{5S-BR`kEUO;&z({B-!DT@RtpJG&8j0ml6hI-3GtGp)8F2{r$oO`|u6W3x9LcFJAwW!qy= zRl8UeCMVyn34j;q-BXx?C0w&aXs*R;mIOM`5~CdQBX@+{u~Xl+nMNLprADV6p?`(m zJ%{Ppl51}H1GeRy^}_Nk|NU?y`d}%o*mBF#@D%s@j=f|*um!`v(hRx9?B;z+UN(#4 zylv*?;?iV&**3>>)7Hn+$bc#4WZBGHC)-ugIC-7bm6H{soYZCBJ9*aj-868rE2_DR z=VetiSzS0j|AU!*#Q*)#$$48BC$Fk(etlI`C%U-uKc&h49Vua9o~^E3oTg<{_Guc^ z{m3xB$H)9Wzu6y{c(z-ShvY>YqZ9U&tN|=rLdHkTqHn?;e*jNAO_fPgtoy zX*e@?us`IFn=*ezOe9g;q$_Zo!~k{H=jYSd(2)&E=~P#ktHQV_KhK(`0K2Q!^e$Kw zeG+F{53v(MrpR*AXF4_$3YC=K9C=7t%)12RzNlAK){d>LpipDYETZkZ6#DGYRo&>+%r?&c@N0z6Al8<4b5XRH0xBhLXm68L-Y>O4+uRZL*ynSD)-d$en^wZ zIF$JhEBYR#+4-057u`zcbNd2` RKOau>1*tovMI}sve*la4G^79k literal 0 HcmV?d00001 diff --git a/klafirc/__pycache__/runner.cpython-36.pyc b/klafirc/__pycache__/runner.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5df96e3670787bf3298c145ed49a145972f97350 GIT binary patch literal 1017 zcmY*XOK%e~5cXqV**vIF#R;KuT!h*KSAQn1 z(q1|B&WRH<-ZlhF9*-Y0-#6d*MZcfUe;O zk_+zrpa{xPgx(K}sEkEiCL*Ea9Z`{rZ-|PQOmtMDIyXe5D*Z&V?k(gb8Es;t#}ikZ zTiWiUgLCOwVu#&VtOyj4pxtk7wRzZ^+jt*VOR^Fu!Iln1u^Ei(tkJwuDZdZ+<3l znqbU*RUOlTT%v;o$>Z8t5uh~)Wss9dCpAblaYwr!MP#+P&_)DjwQ&uHT0oW*UvY>M zT`+Rmw#zHhnjYptQBfp|&k0TGfF|@2y-M#2hFqg8L{X}7sikaEDa%^T3-o(Zp3lcc zdt>^Lz~@`Tz|_VAp_zK3=~ z2e)#&1thDyI@x-f1tx;nCdjL4?EyR?__Pte(PoX>s{Dr#VKEHLkEo9rWnHo1zUS6y zwVhW^n@T$`yl;&EbAkiB?}$jOb`BU=5AQ$YKlC-sl^jj-vQ_aF7VgFGu^#Qw4L0ch E1#|GzIRF3v literal 0 HcmV?d00001 diff --git a/klafirc/__pycache__/settings.cpython-36.pyc b/klafirc/__pycache__/settings.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a534a13e0ab409fe53dcc314a0508e2f6045148b GIT binary patch literal 668 zcmaJ;J#X7U481!`)<=$@sRr!T zzos4fgKq7Vy;Fvwl&Zw(QVAmYNIsHydfn@Vzkl6)`oReKNuE6}#wYlh?`R~ER1sc# zrf9)9qeOOiM>^b*E_Z>NJ=kfwy?Gy^mbZ)3V~C&i#sBohb)Te{WDwrtz2ss*?TZg(C8~UpjdKO>#X>63 zSL>JQU0Fc-S&7+d2`ZJaY(TDW)0?s~$x0Mzy`L_HPF0yb)oKFvB$!*jIyx5Sw#o|_ zn1kW);OJNZ&RU3Vq5xw=hILCtelpr6_Y}_>>{$;7WOx*h+aS67dz#Vs3y5{!osK@9 zS${OWx*nfTPPspso;8sTGN>lV25q}F8NF{XRqwXW`Neo@gK?<~QB_z9W{)9{W~jh* zyT?Yz*|vp3%2piPyR0;bqJ_L~8u&>3M)V$D*qDdpKQgvbrMRb--y~mF)_+r!@~eWk ewG8GEjZY)yP<)w>zRw~S(msu7NJEA-^nU>AvAq-k literal 0 HcmV?d00001 diff --git a/klafirc/bot.py b/klafirc/bot.py new file mode 100644 index 0000000..2a5da24 --- /dev/null +++ b/klafirc/bot.py @@ -0,0 +1,68 @@ +import re +import random + +class Bot: + def __init__(self, nickname): + """Initialize a bot object + + Args: + nickname: nickname of the bot on irc + """ + self.nickname = nickname + self.channel = None + self.port = None + self.server = None + self.reactions = {} + self.pings = [] + self.ping_match = re.compile('^(<.+> )?\@?{name}'.format(name=nickname)) + + def add_reaction(self, match, reaction): + """Add a reaction to the bot. + + Args: + match: The string which, if matched will trigger the answer. + reaction: The string which will be sent. + """ + context = { + 'server': self.server, + 'channel': self.channel, + 'name': self.nickname, + } + self.reactions[re.compile(match.format(**context))] = reaction + + def add_ping(self, reaction): + """Add a reaction to a ping""" + + self.pings.append(reaction) + + def get_reaction(self, user, channel, message): + """Get a reaction to a message. + + Args: + user: The user who sent the message. + channel: The channel on which the bot speak. + message: The message to which the bot has to react. + + Returns: + Every matched reactions. + """ + username = user.split('!')[0] + + context = { + 'server': self.server, + 'channel': channel, + 'name': self.nickname, + 'user': username, + 'message': message + } + result = [] + for m in self.reactions.keys(): + if m.search(message): + result.append(self.reactions[m].format(**context)) + + if not result and self.ping_match.search(message): + sentence = random.choice(self.pings).format(**context) + result.append(' : '.join([username, sentence])) + + return result + diff --git a/klafirc/irc.py b/klafirc/irc.py new file mode 100644 index 0000000..4abbb18 --- /dev/null +++ b/klafirc/irc.py @@ -0,0 +1,55 @@ +from twisted.words.protocols import irc +from twisted.internet import reactor, protocol + +from .bot import Bot +from .settings import logger + +class IRCBot(irc.IRCClient): + """An IRC bot""" + + def connectionMade(self): + super(IRCBot, self).connectionMade() + logger.info('{name} is connected'.format(name=self.nickname)) + self.join(self.factory.channel) + + def connectionLost(self, reason): + super(IRCBot, self).connectionLost(reason) + logger.info('{name} is disconnected : {reason}'.format( + name=self.nickname, + reason = reason + )) + + def signedOn(self): + self.join(self.factory.channel) + + def joined(self, channel): + logger.info(self.nickname + ' joined ' + self.factory.channel) + + def privmsg(self, user, channel, msg): + results = self.factory.bot.get_reaction(user, channel, msg) + logger.debug(self.nickname + ' heard ' + msg) + if results: + logger.info(self.nickname + ' reacting to ' + msg) + for r in results: + self.say(self.factory.channel, r) + + +class IRCBotFactory(protocol.ClientFactory): + def __init__(self, bot): + self.bot = bot + self.channel = bot.channel + + def clientConnectionLost(self, connector, reason): + connector.connect() + logger.info("Client connexion lost") + + def clientConnectionFailed(self, connector, reason): + logger.info("Connection failed : " + reason) + reactor.stop() + + def buildProtocol(self, addr): + p = IRCBot() + p.factory = self + p.nickname = self.bot.nickname + return p + diff --git a/klafirc/klafirc.log b/klafirc/klafirc.log new file mode 100644 index 0000000..7c1e004 --- /dev/null +++ b/klafirc/klafirc.log @@ -0,0 +1,289 @@ +2018-08-02 12:38:12,880 :: INFO :: Klafirc is running ! +2018-08-02 12:38:12,880 :: INFO :: Loading configuration from bots.yaml +2018-08-02 12:38:12,969 :: INFO :: sel is connected +2018-08-02 12:38:12,970 :: INFO :: Macron is connected +2018-08-02 12:38:12,974 :: INFO :: Patou is connected +2018-08-02 12:38:14,691 :: INFO :: sel_ joined #test +2018-08-02 12:38:14,710 :: INFO :: Macron_ joined #test +2018-08-02 12:38:14,726 :: INFO :: Patou joined #test +2018-08-02 12:38:14,773 :: DEBUG :: Macron_ heard Hello +2018-08-02 12:38:14,777 :: DEBUG :: sel_ heard Hello +2018-08-02 12:38:14,790 :: DEBUG :: Patou heard Hello +2018-08-02 12:38:14,791 :: DEBUG :: Patou heard Hello +2018-08-02 12:38:14,878 :: DEBUG :: Macron_ heard Hello +2018-08-02 12:38:14,882 :: DEBUG :: sel_ heard Hello +2018-08-02 12:39:13,839 :: DEBUG :: Patou heard sel : est un tocard +2018-08-02 12:39:13,840 :: DEBUG :: sel_ heard sel : est un tocard +2018-08-02 12:39:13,841 :: INFO :: sel_ reacting to sel : est un tocard +2018-08-02 12:39:13,841 :: DEBUG :: Macron_ heard sel : est un tocard +2018-08-02 12:39:13,912 :: DEBUG :: Macron_ heard klafyvel : À Metz vous êtes vraiment des experts. +2018-08-02 12:39:13,913 :: DEBUG :: Patou heard klafyvel : À Metz vous êtes vraiment des experts. +2018-08-02 12:39:37,662 :: DEBUG :: sel_ heard tocard +2018-08-02 12:39:37,663 :: DEBUG :: Patou heard tocard +2018-08-02 12:39:37,664 :: DEBUG :: Macron_ heard tocard +2018-08-02 12:39:37,664 :: INFO :: Macron_ reacting to tocard +2018-08-02 12:39:37,746 :: DEBUG :: Patou heard Est-ce que je peux dire autocar ? +2018-08-02 12:39:37,766 :: DEBUG :: sel_ heard Est-ce que je peux dire autocar ? +2018-08-02 12:43:05,801 :: INFO :: sel_ is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 12:43:05,802 :: INFO :: Client connexion lost +2018-08-02 12:43:05,803 :: INFO :: Macron_ is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 12:43:05,803 :: INFO :: Client connexion lost +2018-08-02 12:43:05,804 :: INFO :: Patou is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 12:43:05,804 :: INFO :: Client connexion lost +2018-08-02 12:43:06,716 :: INFO :: Klafirc is running ! +2018-08-02 12:43:06,716 :: INFO :: Loading configuration from bots.yaml +2018-08-02 12:43:06,804 :: INFO :: sel is connected +2018-08-02 12:43:06,805 :: INFO :: Patou is connected +2018-08-02 12:43:06,810 :: INFO :: Macron is connected +2018-08-02 12:43:07,195 :: INFO :: sel_ joined #test +2018-08-02 12:43:07,211 :: INFO :: Patou joined #test +2018-08-02 12:43:08,286 :: INFO :: Macron_ joined #test +2018-08-02 12:43:27,472 :: DEBUG :: Patou heard sel est un tocard +2018-08-02 12:43:27,473 :: DEBUG :: sel_ heard sel est un tocard +2018-08-02 12:43:27,474 :: INFO :: sel_ reacting to sel est un tocard +2018-08-02 12:43:27,475 :: DEBUG :: Macron_ heard sel est un tocard +2018-08-02 12:43:27,476 :: INFO :: Macron_ reacting to sel est un tocard +2018-08-02 12:43:27,549 :: DEBUG :: Patou heard klafyvel : Arcas:`à viarezo ils font des caleçons.` Chibrac:`bah non au rezo, à viarezo ils ont pas de boules à couvrir` +2018-08-02 12:43:27,550 :: DEBUG :: Macron_ heard klafyvel : Arcas:`à viarezo ils font des caleçons.` Chibrac:`bah non au rezo, à viarezo ils ont pas de boules à couvrir` +2018-08-02 12:43:27,553 :: DEBUG :: sel_ heard Est-ce que je peux dire autocar ? +2018-08-02 12:43:27,616 :: DEBUG :: Patou heard Est-ce que je peux dire autocar ? +2018-08-02 12:43:51,988 :: DEBUG :: sel_ heard bon maintenant que ça march +2018-08-02 12:43:51,988 :: DEBUG :: Patou heard bon maintenant que ça march +2018-08-02 12:43:51,990 :: DEBUG :: Macron_ heard bon maintenant que ça march +2018-08-02 12:44:00,396 :: DEBUG :: Patou heard voyons si on peut détruire le monde +2018-08-02 12:44:00,397 :: DEBUG :: sel_ heard voyons si on peut détruire le monde +2018-08-02 12:44:00,398 :: DEBUG :: Macron_ heard voyons si on peut détruire le monde +2018-08-02 12:45:22,325 :: INFO :: sel_ is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 12:45:22,325 :: INFO :: Client connexion lost +2018-08-02 12:45:22,325 :: INFO :: Macron_ is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 12:45:22,326 :: INFO :: Client connexion lost +2018-08-02 12:45:22,326 :: INFO :: Patou is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 12:45:22,327 :: INFO :: Client connexion lost +2018-08-02 12:45:23,250 :: INFO :: Klafirc is running ! +2018-08-02 12:45:23,251 :: INFO :: Loading configuration from bots.yaml +2018-08-02 12:45:23,341 :: INFO :: Patou is connected +2018-08-02 12:45:23,342 :: INFO :: sel is connected +2018-08-02 12:45:23,345 :: INFO :: Macron is connected +2018-08-02 12:45:24,779 :: INFO :: Patou joined #test +2018-08-02 12:45:24,799 :: INFO :: sel_ joined #test +2018-08-02 12:45:24,817 :: INFO :: Macron_ joined #test +2018-08-02 12:45:39,875 :: DEBUG :: Patou heard voyons si on peut détruire le monde +2018-08-02 12:45:39,876 :: DEBUG :: sel_ heard voyons si on peut détruire le monde +2018-08-02 12:45:39,876 :: INFO :: sel_ reacting to voyons si on peut détruire le monde +2018-08-02 12:45:39,877 :: DEBUG :: Macron_ heard voyons si on peut détruire le monde +2018-08-02 12:45:39,948 :: DEBUG :: Patou heard Manu on fait des collages ? +2018-08-02 12:45:39,948 :: DEBUG :: Macron_ heard Manu on fait des collages ? +2018-08-02 12:45:39,949 :: INFO :: Macron_ reacting to Manu on fait des collages ? +2018-08-02 12:45:40,020 :: DEBUG :: Patou heard Tu m’appelles monsieur le président de la République, ou monsieur. +2018-08-02 12:45:40,021 :: DEBUG :: sel_ heard Tu m’appelles monsieur le président de la République, ou monsieur. +2018-08-02 12:46:12,091 :: DEBUG :: Patou heard parfait, maintenant un peu de sucre pour les réponses +2018-08-02 12:46:12,092 :: DEBUG :: Macron_ heard parfait, maintenant un peu de sucre pour les réponses +2018-08-02 12:46:12,093 :: DEBUG :: sel_ heard parfait, maintenant un peu de sucre pour les réponses +2018-08-02 13:34:28,694 :: INFO :: Macron_ is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:34:28,694 :: INFO :: Client connexion lost +2018-08-02 13:34:28,695 :: INFO :: Patou is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:34:28,696 :: INFO :: Client connexion lost +2018-08-02 13:34:28,697 :: INFO :: sel_ is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:34:28,697 :: INFO :: Client connexion lost +2018-08-02 13:34:29,882 :: INFO :: Klafirc is running ! +2018-08-02 13:34:29,882 :: INFO :: Loading configuration from bots.yaml +2018-08-02 13:34:30,150 :: INFO :: sel is connected +2018-08-02 13:34:30,152 :: INFO :: Macron is connected +2018-08-02 13:34:30,156 :: INFO :: Patou is connected +2018-08-02 13:34:30,999 :: INFO :: sel_ joined #test +2018-08-02 13:34:32,071 :: INFO :: Macron_ joined #test +2018-08-02 13:34:32,088 :: INFO :: Patou joined #test +2018-08-02 13:34:56,009 :: DEBUG :: Patou heard sel 🤔 +2018-08-02 13:34:56,011 :: DEBUG :: sel_ heard sel 🤔 +2018-08-02 13:34:56,011 :: INFO :: sel_ reacting to sel 🤔 +2018-08-02 13:34:56,012 :: DEBUG :: Macron_ heard sel 🤔 +2018-08-02 13:34:56,085 :: DEBUG :: Macron_ heard klafyvel : J'ai vraiment hâte de rencontrer les N1As de l'année prochaine. +2018-08-02 13:34:56,086 :: DEBUG :: Patou heard klafyvel : J'ai vraiment hâte de rencontrer les N1As de l'année prochaine. +2018-08-02 13:41:46,583 :: INFO :: Macron_ is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:41:46,584 :: INFO :: Client connexion lost +2018-08-02 13:41:46,585 :: INFO :: Patou is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:41:46,585 :: INFO :: Client connexion lost +2018-08-02 13:41:46,586 :: INFO :: sel_ is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:41:46,587 :: INFO :: Client connexion lost +2018-08-02 13:41:47,743 :: INFO :: Klafirc is running ! +2018-08-02 13:41:47,743 :: INFO :: Loading configuration from bots.yaml +2018-08-02 13:42:55,998 :: INFO :: Klafirc is running ! +2018-08-02 13:42:55,998 :: INFO :: Loading configuration from bots.yaml +2018-08-02 13:43:29,672 :: INFO :: Klafirc is running ! +2018-08-02 13:43:29,672 :: INFO :: Loading configuration from bots.yaml +2018-08-02 13:43:41,504 :: INFO :: Klafirc is running ! +2018-08-02 13:43:41,504 :: INFO :: Loading configuration from bots.yaml +2018-08-02 13:43:54,043 :: INFO :: Klafirc is running ! +2018-08-02 13:43:54,044 :: INFO :: Loading configuration from bots.yaml +2018-08-02 13:46:29,128 :: INFO :: Klafirc is running ! +2018-08-02 13:46:29,128 :: INFO :: Loading configuration from bots.yaml +2018-08-02 13:46:39,634 :: INFO :: Klafirc is running ! +2018-08-02 13:46:39,634 :: INFO :: Loading configuration from bots.yaml +2018-08-02 13:46:39,722 :: INFO :: Macron is connected +2018-08-02 13:46:39,726 :: INFO :: Patou is connected +2018-08-02 13:46:39,731 :: INFO :: sel is connected +2018-08-02 13:46:41,131 :: INFO :: Macron_ joined Macron +2018-08-02 13:46:41,147 :: INFO :: Patou joined Patou +2018-08-02 13:46:41,168 :: INFO :: sel_ joined sel +2018-08-02 13:47:20,301 :: INFO :: Patou is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:47:20,302 :: INFO :: Client connexion lost +2018-08-02 13:47:20,302 :: INFO :: sel_ is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:47:20,303 :: INFO :: Client connexion lost +2018-08-02 13:47:20,303 :: INFO :: Macron_ is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:47:20,304 :: INFO :: Client connexion lost +2018-08-02 13:47:21,126 :: INFO :: Klafirc is running ! +2018-08-02 13:47:21,126 :: INFO :: Loading configuration from bots.yaml +2018-08-02 13:47:21,216 :: INFO :: sel is connected +2018-08-02 13:47:21,217 :: INFO :: Patou is connected +2018-08-02 13:47:21,221 :: INFO :: Macron is connected +2018-08-02 13:47:22,623 :: INFO :: Macron_ joined #test +2018-08-02 13:47:22,627 :: INFO :: sel_ joined #test +2018-08-02 13:47:22,644 :: INFO :: Patou joined #test +2018-08-02 13:49:16,664 :: INFO :: Patou is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:49:16,665 :: INFO :: Client connexion lost +2018-08-02 13:49:16,666 :: INFO :: sel_ is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:49:16,666 :: INFO :: Client connexion lost +2018-08-02 13:49:16,667 :: INFO :: Macron_ is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:49:16,668 :: INFO :: Client connexion lost +2018-08-02 13:49:17,342 :: INFO :: Klafirc is running ! +2018-08-02 13:49:17,342 :: INFO :: Loading configuration from bots.yaml +2018-08-02 13:49:17,434 :: INFO :: sel is connected +2018-08-02 13:49:17,436 :: INFO :: Patou is connected +2018-08-02 13:49:17,444 :: INFO :: Macron is connected +2018-08-02 13:49:18,843 :: INFO :: sel_ joined #test +2018-08-02 13:49:18,860 :: INFO :: Patou joined #test +2018-08-02 13:49:18,880 :: INFO :: Macron_ joined #test +2018-08-02 13:49:40,409 :: INFO :: Macron_ is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:49:40,410 :: INFO :: Client connexion lost +2018-08-02 13:49:40,410 :: INFO :: Patou is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:49:40,411 :: INFO :: Client connexion lost +2018-08-02 13:49:40,411 :: INFO :: sel_ is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:49:40,412 :: INFO :: Client connexion lost +2018-08-02 13:49:41,196 :: INFO :: Klafirc is running ! +2018-08-02 13:49:41,196 :: INFO :: Loading configuration from bots.yaml +2018-08-02 13:49:41,288 :: INFO :: Patou is connected +2018-08-02 13:49:41,290 :: INFO :: Macron is connected +2018-08-02 13:49:41,293 :: INFO :: sel is connected +2018-08-02 13:49:41,696 :: INFO :: Patou joined #test +2018-08-02 13:49:41,712 :: INFO :: Macron_ joined #test +2018-08-02 13:49:42,979 :: INFO :: sel_ joined #test +2018-08-02 13:49:48,547 :: DEBUG :: Macron_ heard sel, pourquoi es-tu là ? +2018-08-02 13:49:48,548 :: DEBUG :: Patou heard sel, pourquoi es-tu là ? +2018-08-02 13:49:48,552 :: DEBUG :: sel_ heard sel, pourquoi es-tu là ? +2018-08-02 13:49:48,552 :: INFO :: sel_ reacting to sel, pourquoi es-tu là ? +2018-08-02 13:49:48,630 :: DEBUG :: Patou heard En l'an 2018, en plus d'être feignants, les Rézomen devinrent salés à cause de la fermeture du campus. C'est pourquoi un jeune Rézoman nommé Klafyvel m'a créé, afin d'avoir un salage automatique de {channel}. Depuis je hante le chan. +2018-08-02 13:49:48,630 :: DEBUG :: Patou heard klafyvel : J'ai vraiment hâte de rencontrer les N1As de l'année prochaine. +2018-08-02 13:49:48,631 :: DEBUG :: Macron_ heard En l'an 2018, en plus d'être feignants, les Rézomen devinrent salés à cause de la fermeture du campus. C'est pourquoi un jeune Rézoman nommé Klafyvel m'a créé, afin d'avoir un salage automatique de {channel}. Depuis je hante le chan. +2018-08-02 13:49:48,632 :: DEBUG :: Macron_ heard klafyvel : J'ai vraiment hâte de rencontrer les N1As de l'année prochaine. +2018-08-02 13:51:07,441 :: INFO :: Patou is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:51:07,442 :: INFO :: Client connexion lost +2018-08-02 13:51:07,442 :: INFO :: sel_ is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:51:07,443 :: INFO :: Client connexion lost +2018-08-02 13:51:07,444 :: INFO :: Macron_ is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:51:07,445 :: INFO :: Client connexion lost +2018-08-02 13:51:08,366 :: INFO :: Klafirc is running ! +2018-08-02 13:51:08,366 :: INFO :: Loading configuration from bots.yaml +2018-08-02 13:51:08,456 :: INFO :: sel is connected +2018-08-02 13:51:08,457 :: INFO :: Patou is connected +2018-08-02 13:51:08,463 :: INFO :: Macron is connected +2018-08-02 13:51:09,844 :: INFO :: Patou joined #test +2018-08-02 13:51:09,863 :: INFO :: sel_ joined #test +2018-08-02 13:51:09,901 :: INFO :: Macron_ joined #test +2018-08-02 13:51:18,927 :: DEBUG :: Patou heard sel, pourquoi es-tu là ? +2018-08-02 13:51:18,929 :: DEBUG :: sel_ heard sel, pourquoi es-tu là ? +2018-08-02 13:51:18,929 :: INFO :: sel_ reacting to sel, pourquoi es-tu là ? +2018-08-02 13:51:18,930 :: DEBUG :: Macron_ heard sel, pourquoi es-tu là ? +2018-08-02 13:51:19,022 :: DEBUG :: Patou heard En l'an 2018, en plus d'être feignants, les Rézomen devinrent salés à cause de la fermeture du campus. C'est pourquoi un jeune Rézoman nommé Klafyvel m'a créé, afin d'avoir un salage automatique de #test. Depuis je hante le chan. +2018-08-02 13:51:19,022 :: DEBUG :: Macron_ heard En l'an 2018, en plus d'être feignants, les Rézomen devinrent salés à cause de la fermeture du campus. C'est pourquoi un jeune Rézoman nommé Klafyvel m'a créé, afin d'avoir un salage automatique de #test. Depuis je hante le chan. +2018-08-02 13:51:45,392 :: DEBUG :: sel_ heard Sel, quel est votre métier ? +2018-08-02 13:51:45,393 :: DEBUG :: Macron_ heard Sel, quel est votre métier ? +2018-08-02 13:51:45,394 :: DEBUG :: Patou heard Sel, quel est votre métier ? +2018-08-02 13:52:05,863 :: DEBUG :: sel_ heard ah oui la casse +2018-08-02 13:52:05,865 :: DEBUG :: Macron_ heard ah oui la casse +2018-08-02 13:52:05,865 :: DEBUG :: Patou heard ah oui la casse +2018-08-02 13:52:07,112 :: DEBUG :: sel_ heard sel devient insensible à la casse +2018-08-02 13:52:07,113 :: INFO :: sel_ reacting to sel devient insensible à la casse +2018-08-02 13:52:07,113 :: DEBUG :: Patou heard sel devient insensible à la casse +2018-08-02 13:52:07,114 :: DEBUG :: Macron_ heard sel devient insensible à la casse +2018-08-02 13:52:07,187 :: DEBUG :: Patou heard Guimoz : J'ai vraiment hâte de rencontrer les N1As de l'année prochaine. +2018-08-02 13:52:07,188 :: DEBUG :: Macron_ heard Guimoz : J'ai vraiment hâte de rencontrer les N1As de l'année prochaine. +2018-08-02 13:52:24,071 :: DEBUG :: sel_ heard sel, tu penses quoi de Manu ? +2018-08-02 13:52:24,072 :: INFO :: sel_ reacting to sel, tu penses quoi de Manu ? +2018-08-02 13:52:24,074 :: DEBUG :: Patou heard sel, tu penses quoi de Manu ? +2018-08-02 13:52:24,075 :: DEBUG :: Macron_ heard sel, tu penses quoi de Manu ? +2018-08-02 13:52:24,144 :: DEBUG :: Patou heard klafyvel : je glande presque autant qu'un pelec +2018-08-02 13:52:24,145 :: DEBUG :: Macron_ heard klafyvel : je glande presque autant qu'un pelec +2018-08-02 13:52:33,881 :: DEBUG :: sel_ heard ouais moyennement pertinent +2018-08-02 13:52:33,882 :: DEBUG :: Macron_ heard ouais moyennement pertinent +2018-08-02 13:52:33,883 :: DEBUG :: Patou heard ouais moyennement pertinent +2018-08-02 13:53:57,589 :: INFO :: Patou is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:53:57,590 :: INFO :: Client connexion lost +2018-08-02 13:53:57,591 :: INFO :: sel_ is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:53:57,592 :: INFO :: Client connexion lost +2018-08-02 13:53:57,592 :: INFO :: Macron_ is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:53:57,593 :: INFO :: Client connexion lost +2018-08-02 13:53:58,453 :: INFO :: Klafirc is running ! +2018-08-02 13:53:58,453 :: INFO :: Loading configuration from bots.yaml +2018-08-02 13:53:58,546 :: INFO :: Patou is connected +2018-08-02 13:53:58,547 :: INFO :: Macron is connected +2018-08-02 13:53:58,555 :: INFO :: sel is connected +2018-08-02 13:53:59,964 :: INFO :: Patou joined #test +2018-08-02 13:53:59,985 :: INFO :: Macron_ joined #test +2018-08-02 13:53:59,999 :: INFO :: sel_ joined #test +2018-08-02 13:54:51,169 :: DEBUG :: Patou heard sel on va détruire le monde ? +2018-08-02 13:54:51,170 :: DEBUG :: Macron_ heard sel on va détruire le monde ? +2018-08-02 13:54:51,171 :: DEBUG :: sel_ heard sel on va détruire le monde ? +2018-08-02 13:54:51,172 :: INFO :: sel_ reacting to sel on va détruire le monde ? +2018-08-02 13:54:51,248 :: DEBUG :: Patou heard Manu on fait des collages ? +2018-08-02 13:54:51,248 :: DEBUG :: Macron_ heard Manu on fait des collages ? +2018-08-02 13:54:51,249 :: INFO :: Macron_ reacting to Manu on fait des collages ? +2018-08-02 13:54:51,319 :: DEBUG :: Patou heard Tu m’appelles monsieur le président de la République, ou monsieur. +2018-08-02 13:54:51,320 :: DEBUG :: sel_ heard Tu m’appelles monsieur le président de la République, ou monsieur. +2018-08-02 13:55:12,882 :: DEBUG :: Macron_ heard Macron : ça part +2018-08-02 13:55:12,883 :: INFO :: Macron_ reacting to Macron : ça part +2018-08-02 13:55:12,884 :: DEBUG :: Patou heard Macron : ça part +2018-08-02 13:55:12,885 :: DEBUG :: sel_ heard Macron : ça part +2018-08-02 13:55:12,957 :: DEBUG :: Patou heard klafyvel : PARCE QUE C'EST NOTRE PROJEEEET ! +2018-08-02 13:55:12,958 :: DEBUG :: sel_ heard klafyvel : PARCE QUE C'EST NOTRE PROJEEEET ! +2018-08-02 13:56:18,732 :: DEBUG :: sel_ heard paaarfait +2018-08-02 13:56:18,734 :: DEBUG :: Patou heard paaarfait +2018-08-02 13:56:18,735 :: DEBUG :: Macron_ heard paaarfait +2018-08-02 13:56:35,543 :: DEBUG :: Patou heard maintenant un petit setup d'installation, un service et c'est fini +2018-08-02 13:56:35,545 :: DEBUG :: Macron_ heard maintenant un petit setup d'installation, un service et c'est fini +2018-08-02 13:56:35,546 :: DEBUG :: sel_ heard maintenant un petit setup d'installation, un service et c'est fini +2018-08-02 13:56:37,145 :: INFO :: Patou is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:56:37,146 :: INFO :: Client connexion lost +2018-08-02 13:56:37,146 :: INFO :: sel_ is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:56:37,147 :: INFO :: Client connexion lost +2018-08-02 13:56:37,147 :: INFO :: Macron_ is disconnected : [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. +] +2018-08-02 13:56:37,148 :: INFO :: Client connexion lost diff --git a/klafirc/loader.py b/klafirc/loader.py new file mode 100644 index 0000000..9d8e355 --- /dev/null +++ b/klafirc/loader.py @@ -0,0 +1,38 @@ +import yaml + +from .bot import Bot +from .settings import logger + + +class Loader: + def __init__(self, filename): + logger.info('Loading configuration from ' + filename) + with open(filename) as f: + self.dict = yaml.load(f) + self.bots = [] + + def load_bot_template(self, name, channel, serv, port): + template = self.dict['bots'][name] + b = Bot(nickname=name) + b.server = serv + b.channel = channel + b.port = port + for ping in template.get('on_ping', []): + b.add_ping(ping) + + matches = template.get('on_match', []) + for match in matches: + b.add_reaction(match, matches[match]) + + return b + + def load_bots(self): + for channel in self.dict['channels']: + name = channel['channel'] + serv = channel['server'] + port = channel.get('port', 6667) + bots_name = channel['bots'] + + for nickname in bots_name: + b = self.load_bot_template(nickname, name, serv, port) + self.bots.append(b) diff --git a/klafirc/runner.py b/klafirc/runner.py new file mode 100644 index 0000000..7a00fe0 --- /dev/null +++ b/klafirc/runner.py @@ -0,0 +1,21 @@ +from twisted.internet import reactor + +from .loader import Loader +from .irc import IRCBotFactory +from .settings import logger, BOT_FILE + +class Runner: + def __init__(self): + self.loader = Loader(BOT_FILE) + + def run(self): + self.loader.load_bots() + for bot in self.loader.bots: + bot_factory = IRCBotFactory(bot) + reactor.connectTCP(bot.server, bot.port, bot_factory) + reactor.run() + +def run(): + logger.info('Klafirc is running !') + runner = Runner() + runner.run() diff --git a/klafirc/settings.py b/klafirc/settings.py new file mode 100644 index 0000000..f5525cf --- /dev/null +++ b/klafirc/settings.py @@ -0,0 +1,24 @@ +import logging +from logging.handlers import RotatingFileHandler + +DEBUG = True +BOT_FILE = '/home/klafyvel/dev/klafirc/bots.yaml' +LOG_FILE = '/var/log/klafirc/klafirc.log' + +logger = logging.getLogger() + +if DEBUG: + logger.setLevel(logging.DEBUG) +else: + logger.setLevel(logging.INFO) + +formatter = logging.Formatter('%(asctime)s :: %(levelname)s :: %(message)s') +file_handler = RotatingFileHandler(LOG_FILE, 'a', 1000000, 1) +file_handler.setLevel(logging.DEBUG) +file_handler.setFormatter(formatter) +logger.addHandler(file_handler) + +stream_handler = logging.StreamHandler() +stream_handler.setLevel(logging.DEBUG) +stream_handler.setFormatter(formatter) +logger.addHandler(stream_handler) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..ca9cb3b --- /dev/null +++ b/requirements.txt @@ -0,0 +1,11 @@ +attrs==18.1.0 +Automat==0.7.0 +constantly==15.1.0 +hyperlink==18.0.0 +idna==2.7 +incremental==17.5.0 +PyHamcrest==1.9.0 +PyYAML==3.13 +six==1.11.0 +Twisted==18.7.0 +zope.interface==4.5.0