added .upwolf
This commit is contained in:
parent
041a95f3af
commit
840f9e925f
|
@ -37,6 +37,20 @@ def updick(bot, trigger):
|
|||
bot.msg("8" + "="*delta.days + "D")
|
||||
|
||||
|
||||
@commands('upwulf')
|
||||
def updick(bot, trigger):
|
||||
""".upwulf - Returns the uptime of Fulvia, measured in Adalwulfs."""
|
||||
if trigger.group(2):
|
||||
if trigger.group(2) in bot.users:
|
||||
d = defer.Deferred()
|
||||
d.addCallback(idleTimeWulf, bot)
|
||||
bot.memory["idle_callbacks"][trigger.group(2)] = d
|
||||
bot.whois(trigger.group(2))
|
||||
else:
|
||||
delta = datetime.datetime.now() - bot.memory["uptime"]
|
||||
bot.msg("Adalwulf" + "_"*delta.days)
|
||||
|
||||
|
||||
def idleTime(result, bot):
|
||||
"""
|
||||
result - tuple containing (nick, idle, signon)
|
||||
|
@ -45,3 +59,13 @@ def idleTime(result, bot):
|
|||
t = datetime.datetime.fromtimestamp(int(signon))
|
||||
delta = datetime.datetime.now() - t
|
||||
bot.msg("8" + "="*delta.days + "D")
|
||||
|
||||
|
||||
def idleTimeWulf(result, bot):
|
||||
"""
|
||||
result - tuple containing (nick, idle, signon)
|
||||
"""
|
||||
nick, idle, signon = result
|
||||
t = datetime.datetime.fromtimestamp(int(signon))
|
||||
delta = datetime.datetime.now() - t
|
||||
bot.msg("Adalwulf" + "_"*delta.days)
|
||||
|
|
Loading…
Reference in New Issue
Block a user