Sfoglia il codice sorgente

EWW WHY

pull/47/head
Kunal Mehta 11 anni fa
parent
commit
713df0f0d8
1 ha cambiato i file con 9 aggiunte e 2 eliminazioni
  1. +9
    -2
      earwigbot/commands/lag.py

+ 9
- 2
earwigbot/commands/lag.py Vedi File

@@ -23,6 +23,8 @@
from earwigbot import exceptions
from earwigbot.commands import Command

old = 99999999999999999999999

class Lag(Command):
"""Return replag or maxlag information on specific databases."""
name = "lag"
@@ -32,17 +34,22 @@ class Lag(Command):
site = self.get_site(data)
if not site:
return
replag = self.get_replag(site)
if data.command == "replag":
base = "\x0302{0}\x0F: {1}."
msg = base.format(site.name, self.get_replag(site))
msg = base.format(site.name, replag)
elif data.command == "maxlag":
base = "\x0302{0}\x0F: {1}."
msg = base.format(site.name, self.get_maxlag(site).capitalize())
else:
base = "\x0302{0}\x0F: {1}; {2}."
msg = base.format(site.name, self.get_replag(site),
msg = base.format(site.name, replag,
self.get_maxlag(site))
self.reply(data, msg)
global old
if replag > old:
self.reply(data, 'EWW WHY')
old = replag

def get_replag(self, site):
return "replag is {0}".format(self.time(site.get_replag()))


Caricamento…
Annulla
Salva