diff --git a/modules/uptime.py b/modules/uptime.py new file mode 100644 index 0000000..4317c82 --- /dev/null +++ b/modules/uptime.py @@ -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.')