Testing configuration changes/updates

This commit is contained in:
Hash Borgir
2024-02-13 22:39:17 -07:00
parent aa7e76e653
commit 2277dd1b90
17 changed files with 525 additions and 20 deletions

View File

@@ -1,23 +0,0 @@
# plugins/fortune.py
import subprocess
import logging
import simplematrixbotlib as botlib
async def handle_command(room, message, bot, PREFIX):
"""
Function to handle the !fortune command.
Args:
room (Room): The Matrix room where the command was invoked.
message (RoomMessage): The message object containing the command.
Returns:
None
"""
match = botlib.MessageMatch(room, message, bot, PREFIX)
if match.is_not_from_this_bot() and match.prefix() and match.command("fortune"):
logging.info("Received !fortune command")
fortune_output = "🃏 " + subprocess.run(['/usr/games/fortune'], capture_output=True).stdout.decode('UTF-8')
await bot.api.send_markdown_message(room.room_id, fortune_output)
logging.info("Sent fortune to the room")