Skip to content

Commit

Permalink
Add uptime module
Browse files Browse the repository at this point in the history
  • Loading branch information
aluminiumgeek committed Dec 16, 2015
1 parent dcdaed6 commit e27e255
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/user_uptime.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from datetime import timedelta


def main(bot, *args):
"""
uptime
Print system uptime
"""

with open('/proc/uptime', 'r') as f:
uptime_seconds = float(f.readline().split()[0])
return str(timedelta(seconds = uptime_seconds))

0 comments on commit e27e255

Please sign in to comment.