Commit da045dae authored by Benjamin Graillot's avatar Benjamin Graillot

Envoi du message

parent 3b7d42b5
......@@ -104,15 +104,7 @@ class Ninja(Bot):
for channel in patts:
if any(re.fullmatch(patt, page) for patt in patts[channel]):
t = time.time()
if type == Update.edit:
if comment:
self.connection.privmsg(channel, '\x0310,99{page}\x0f \x033,99{user}\x0f \x0399,99{comment}\x0f \x0315,99(r{revision})'.format(page=page, user=user, revision=revision, comment=comment))
else:
self.connection.privmsg(channel, '\x0310,99{page}\x0f \x033,99{user}\x0f \x0315,99(r{revision})\x0f'.format(page=page, user=user, revision=revision))
elif type == Update.attachment:
self.connection.privmsg(channel, '\x0310,99{page}\x0f \x033,99{user}\x0f \x0399,99{comment}\x0f : \x0310,99{revision}\x0f'.format(page=page, user=user, comment=comment, revision=revision))
elif type == Update.rename:
self.connection.privmsg(channel, '\x0310,99{page}\x0f \x033,99{user}\x0f \x0399,99rename -->\x0f \x0310,99{revision}\x0f \x0399,99{comment}\x0f'.format(page=page, user=user, comment=comment, revision=revision))
self.connection.privmsg(channel, message)
# on attend 5 secondes pour éviter que le serveur nous empêche d'envoyer les messages
# time.sleep n'a pas l'air de trop marcher dans les thread du coup je le combine avec time.time
while t + 5 > time.time():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment