138 lines
2.5 KiB
Markdown
Raw Permalink Normal View History

# Icecast IRC Bot Documentation v1.1.0
This document is automatically generated from the codebase.
## Overview
An IRC bot that monitors an Icecast stream and announces track changes.
## Configuration
See `config.yaml.example` for a full example configuration file.
No command documentation available (help template not found)
## Methods
### admin_required
Decorator to mark a command as requiring admin privileges.
**Arguments:**
- `f`: The command handler function to wrap.
- `Returns`:
### announce_song
Announce a song in the IRC channel.
**Arguments:**
- `song`: The song title to announce.
- `Only announces if`:
### fetch_json_metadata
Fetch metadata from the Icecast JSON status endpoint.
**Returns:**
str: The current song title, or an error message if fetching failed.
### format_help_section
Format a help section according to the template.
**Arguments:**
- `section_config`: Configuration dictionary for the section.
- `prefix`: Command prefix to use.
- `Returns`:
- `List[str]`: List of formatted help lines for each command.
### get_version
Get the current version from VERSION file.
### help_command_fallback
Fallback help command implementation using hardcoded format.
**Arguments:**
- `message`: The IRC message object that triggered this command.
### is_admin
Check if a user has admin privileges.
**Arguments:**
- `user`: Full IRC user string (nickname!username@hostname) or User object.
- `Returns`:
- `bool`: True if user has admin privileges, False otherwise.
### load_config
Load and validate the bot configuration from a YAML file.
**Arguments:**
- `config_path`: Path to the YAML configuration file. If None, uses default path.
- `Returns`:
- `dict`: The loaded and validated configuration dictionary with default values applied.
### monitor_metadata
Monitor the Icecast stream for metadata changes.
### restart_monitoring
Restart the metadata monitoring task and verify the reconnection.
**Returns:**
bool: True if reconnection was successful and verified, False otherwise.
### setup_handlers
Set up all IRC event handlers and command patterns.
### should_announce_song
Check if a song should be announced based on configured ignore patterns.
**Arguments:**
- `song`: The song title to check.
- `Returns`:
- `bool`: True if the song should be announced, False if it matches any ignore patterns.
### start
Start the IRC bot and begin processing events.
### start_monitoring
Start the metadata monitoring task.
### stop_monitoring
Stop the metadata monitoring task.