1
0
Fork 0
quotes-bot-python/bot.py

22 lines
688 B
Python
Raw Normal View History

2025-01-31 18:12:38 -06:00
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)