Added uptime module

This commit is contained in:
Ville Ranki 2019-12-09 20:44:45 +02:00
parent e26aea6f54
commit d4bfe1f020
1 changed files with 14 additions and 0 deletions

14
modules/uptime.py Normal file
View File

@ -0,0 +1,14 @@
import time
class MatrixModule:
def matrix_start(self, bot):
self.starttime = time.time()
async def matrix_message(self, bot, room, event):
await bot.send_text(room, 'Uptime: ' + str(int(time.time() - self.starttime)) + ' seconds.')
def matrix_stop(self, bot):
pass
def help(self):
return('Tells how many seconds the bot has been up.')