1
1
mirror of https://gitlab.com/ceda_ei/Quadnite-Bot synced 2026-05-13 01:00:06 +02:00

Add /help command

This commit is contained in:
2026-05-09 10:27:59 +02:00
parent 1ad42e6068
commit 7bbc82d175
8 changed files with 98 additions and 71 deletions

View File

@@ -0,0 +1,17 @@
from pathlib import Path
from deltachat2 import NewMsgEvent
from quadnite_bot.command import Command, Context
class HelpCommand(Command):
command = "help"
def __init__(self):
self.responses = []
for file in sorted((Path(__file__).resolve().parent.parent / "static/help").iterdir()):
with open(file) as f:
self.responses.append(f.read())
def process_event(self, ctx: Context, event: NewMsgEvent) -> None:
for response in self.responses:
ctx.reply(response)