feat: basic commands + prototype of roll parser

This commit is contained in:
RatCornu 2026-03-24 00:24:58 +01:00
parent 4b47899a3d
commit 74f991af40
Signed by: ratcornu
GPG key ID: B3BE02E379E6E8E2
4 changed files with 84 additions and 1 deletions

17
misc.py Normal file
View file

@ -0,0 +1,17 @@
from datetime import datetime
async def ping(bot, mtch, room, message):
await bot.api.send_text_message(room.room_id, "Pong")
async def echo(bot, mtch, room, message):
await bot.api.send_text_message(room.room_id, " ".join(mtch.args()))
async def uptime(bot, mtch, room, message):
delta = datetime.now() - bot.start_time
await bot.api.send_text_message(
room.room_id,
f"Le bot est actif depuis {int(delta.total_seconds())} secondes (en gros {int(delta.total_seconds() / 86400)} jours).",
)