forked from n/quotes-bot-python
!q help
This commit is contained in:
parent
29659ac747
commit
80c37cb7b4
1 changed files with 21 additions and 0 deletions
21
bot.py
Normal file
21
bot.py
Normal file
|
@ -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)
|
Loading…
Add table
Reference in a new issue