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:
17
src/quadnite_bot/commands/help.py
Normal file
17
src/quadnite_bot/commands/help.py
Normal 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)
|
||||
Reference in New Issue
Block a user