Ensure browse_command updates bot.system_prompt_path when prompt file is selected

This commit is contained in:
cyclop-bot
2025-06-03 14:06:59 -05:00
parent 9c9b5991b6
commit aeb9acd97c
+3 -1
View File
@@ -62,5 +62,7 @@ async def button_callback(update: Update, context: ContextTypes.DEFAULT_TYPE) ->
# Handle file selection # Handle file selection
file_path = data.split(":")[1] file_path = data.split(":")[1]
os.environ['SYSTEM_PROMPT_PATH'] = file_path os.environ['SYSTEM_PROMPT_PATH'] = file_path
if hasattr(browse_command_bot, 'system_prompt_path'):
browse_command_bot.system_prompt_path = file_path
browse_command_bot.system_prompt = browse_command_bot.load_system_prompt() browse_command_bot.system_prompt = browse_command_bot.load_system_prompt()
await query.edit_message_text(f"Selected: {file_path}. System prompt updated.") await query.edit_message_text(f"Selected: {file_path}. System prompt updated.")