Update plugins, refactor proxy plugin, yt preview now gets lyrics
This commit is contained in:
@@ -18,6 +18,7 @@ async def handle_command(room, message, bot, prefix, config):
|
||||
message (RoomMessage): The message object containing the command.
|
||||
bot (Bot): The bot object.
|
||||
prefix (str): The command prefix.
|
||||
config (dict): Configuration parameters.
|
||||
|
||||
Returns:
|
||||
None
|
||||
@@ -30,9 +31,6 @@ async def handle_command(room, message, bot, prefix, config):
|
||||
conf = load_config()
|
||||
if command in conf:
|
||||
await handle_ai_command(room, bot, command, match.args(), conf)
|
||||
#else:
|
||||
#await bot.api.send_text_message(room.room_id, f"Unknown command: {command}")
|
||||
#logging.info("Sent unknown command message to the room")
|
||||
|
||||
async def handle_ai_command(room, bot, command, args, config):
|
||||
"""
|
||||
@@ -43,7 +41,7 @@ async def handle_ai_command(room, bot, command, args, config):
|
||||
bot (Bot): The bot object.
|
||||
command (str): The name of the AI model command.
|
||||
args (list): List of arguments provided with the command.
|
||||
config: Configuration parameters.
|
||||
config (dict): Configuration parameters.
|
||||
|
||||
Returns:
|
||||
None
|
||||
@@ -91,6 +89,15 @@ async def handle_ai_command(room, bot, command, args, config):
|
||||
await bot.api.send_text_message(room.room_id, f"Error generating text: {e}")
|
||||
|
||||
def markdown_to_html(markdown_text):
|
||||
"""
|
||||
Convert Markdown text to HTML.
|
||||
|
||||
Args:
|
||||
markdown_text (str): Markdown formatted text.
|
||||
|
||||
Returns:
|
||||
str: HTML formatted text.
|
||||
"""
|
||||
html_content = markdown2.markdown(markdown_text)
|
||||
return html_content
|
||||
|
||||
@@ -106,4 +113,3 @@ def load_config():
|
||||
return config
|
||||
|
||||
CONFIG = load_config()
|
||||
|
||||
|
Reference in New Issue
Block a user