From 80c37cb7b4f7e442a7adeeae3140fa2fb1298ae0 Mon Sep 17 00:00:00 2001 From: n Date: Fri, 31 Jan 2025 18:12:38 -0600 Subject: [PATCH] !q help --- bot.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 bot.py diff --git a/bot.py b/bot.py new file mode 100644 index 0000000..f5b80e1 --- /dev/null +++ b/bot.py @@ -0,0 +1,21 @@ +import simplematrixbotlib as botLibrary + +credentials = botLibrary.Creds("https://localhost:8008", "user", "password") +bot = botLibrary.Bot(credentials) +PREFIX = "!q" + +@bot.listener.on_message_event +async def help_message(room, message): + match = botlib.MessageMatch(room, message, bot, PREFIX) + if not (match.is_not_from_this_bot() and match.prefix() + and match.command("help")): + return + + message = (f""" + Help + ============================ + A work-in-progress Python rewrite of the original quotes bot, aiming for a mostly complete remake. + {PREFIX}help - show this message + """) + + await bot.api.send_text_message(room.room_id, message)