mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 19:19:32 +01:00
Made uptime command not based on loading of FunCommands module.
This commit is contained in:
parent
c31167ed3f
commit
10a0fe9f93
@ -95,7 +95,6 @@ class FunCommands(callbacks.Privmsg):
|
|||||||
self.recvdMsgs = 0
|
self.recvdMsgs = 0
|
||||||
self.sentBytes = 0
|
self.sentBytes = 0
|
||||||
self.recvdBytes = 0
|
self.recvdBytes = 0
|
||||||
self._startTime = time.time()
|
|
||||||
|
|
||||||
def inFilter(self, irc, msg):
|
def inFilter(self, irc, msg):
|
||||||
self.recvdMsgs += 1
|
self.recvdMsgs += 1
|
||||||
@ -309,7 +308,7 @@ class FunCommands(callbacks.Privmsg):
|
|||||||
|
|
||||||
def uptime(self, irc, msg, args):
|
def uptime(self, irc, msg, args):
|
||||||
"takes no arguments"
|
"takes no arguments"
|
||||||
elapsed = time.time() - self._startTime
|
elapsed = time.time() - world.startedAt
|
||||||
days, elapsed = elapsed // 86400, elapsed % 86400
|
days, elapsed = elapsed // 86400, elapsed % 86400
|
||||||
hours, elapsed = elapsed // 3600, elapsed % 3600
|
hours, elapsed = elapsed // 3600, elapsed % 3600
|
||||||
minutes, seconds = elapsed // 60, elapsed % 60
|
minutes, seconds = elapsed // 60, elapsed % 60
|
||||||
|
@ -36,14 +36,18 @@ Main program file for running the bot.
|
|||||||
from fix import *
|
from fix import *
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
import time
|
||||||
import email
|
import email
|
||||||
import getopt
|
import getopt
|
||||||
#import pprint
|
#import pprint
|
||||||
|
|
||||||
import conf
|
import conf
|
||||||
|
import world
|
||||||
|
|
||||||
sys.path.append(conf.pluginDir)
|
sys.path.append(conf.pluginDir)
|
||||||
|
|
||||||
|
world.startedAt = time.time()
|
||||||
|
|
||||||
class ConfigurationDict(dict):
|
class ConfigurationDict(dict):
|
||||||
def __init__(self, L=None):
|
def __init__(self, L=None):
|
||||||
if L is not None:
|
if L is not None:
|
||||||
|
Loading…
Reference in New Issue
Block a user