feat: add !uptime command

Track bot start time via monotonic clock, display as compact
duration (e.g. "up 3d 2h 15m 42s").

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
user
2026-02-15 01:46:06 +01:00
parent 830add0797
commit 5c0b23464c
2 changed files with 22 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ from __future__ import annotations
import asyncio
import logging
import time
from pathlib import Path
from derp.irc import IRCConnection, Message, format_msg, parse
@@ -30,6 +31,7 @@ class Bot:
self.nick: str = config["server"]["nick"]
self.prefix: str = config["bot"]["prefix"]
self._running = False
self._started: float = time.monotonic()
async def start(self) -> None:
"""Connect, register, join channels, and enter the main loop."""