Skip to content

Conversation

@zbejas
Copy link
Owner

@zbejas zbejas commented Aug 8, 2025

This pull request introduces several improvements and refactors to the bot, focusing on enhanced configuration flexibility, improved message formatting, and more robust handling of YouTube video metadata. The most significant changes include moving the Ollama system prompt to a dedicated file, adding support for video duration parsing and formatting, and restructuring the Discord bot logic for clarity and maintainability.

Configuration and Prompt Handling:

  • The Ollama system prompt is now loaded from a system_prompt.txt file by default, unless overridden by the OLLAMA_PROMPT environment variable. This makes the prompt easier to maintain and customize. The .env.example and README.md files have been updated to reflect this change, and a new OLLAMA_KEEP_ALIVE configuration option has been added. [1] [2] [3] [4] [5] [6] [7]

YouTube Video Metadata and Duration Support:

  • The bot now fetches and parses YouTube video durations (ISO 8601 format) and includes this information in original content replies. Utilities for parsing and formatting durations have been added in time.ts, and the YouTube API call now requests contentDetails. [1] [2] [3] [4]

Discord Bot Refactor and Message Formatting:

  • The Discord bot logic has been refactored for better readability and maintainability. Message handling, reply formatting, and original content processing have been modularized. Replies now include video durations and improved formatting, making it easier for users to compare reaction and original video lengths. [1] [2] [3] [4]

Other Improvements:

  • The Ollama API integration now uses the configured OLLAMA_KEEP_ALIVE value.
  • Minor updates and clarifications have been made to documentation and error messages. [1] [2]

These changes collectively make the bot more robust, configurable, and user-friendly.

@zbejas zbejas merged commit 431c021 into main Aug 8, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants