Hk Bot
No description available
Ask AI about Hk Bot
Powered by Claude Β· Grounded in docs
I know everything about Hk Bot. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
hk_bot
A simple Telegram bot framework for wind/kite sports updates. Commands are auto-discovered plugins β add a file to src/commands/ and it just works.
Commands
| Command | Description |
|---|---|
/woo | WOO Leaderboard |
/windguru | Wind Forecast |
/hkr | HKR Reviews |
/iksurfmag | IKSurf News |
/youtube | Latest video from configured YouTube channels |
YouTube Russian Voiceover
When a YouTube video is fetched (via /youtube or embedded in /iksurfmag), the bot automatically:
- Extracts auto-generated English subtitles via yt-dlp
- Falls back to faster-whisper (
tinymodel, ~39 MB) if no subtitles exist - Translates the transcript to Russian via MyMemory (free)
- Generates Russian TTS audio via gTTS (free, requires internet)
- Mixes the TTS audio into the video using ffmpeg
Two messages are sent: the voiceover version (with caption) followed by the original. If any step fails, the original video is sent silently.
Project Structure
hk_bot/
βββ src/
β βββ bot.py # Entry point
β βββ api/
β β βββ abstract_request_command.py # Base class for all commands
β β βββ abstract_cron_command.py # Mixin for scheduled commands
β β βββ abstract_news_command.py # Mixin for news-style commands
β βββ commands/ # Auto-discovered command plugins
β βββ woo_command.py
β βββ windguru_command.py
β βββ hkr_command.py
β βββ iksurfmag_command.py
βββ requirements.txt
βββ .env.example
Adding a Command
- Create
src/commands/my_command.py - Define a class extending
AbstractRequestCommand - Set
NAME(slash command) andLABEL, implementasync def run() -> str
from api.abstract_request_command import AbstractRequestCommand
class MyCommand(AbstractRequestCommand):
NAME = "mycommand"
LABEL = "My Command"
async def run(self) -> str:
return "Hello!"
The command is picked up automatically β no registration needed.
Setup
# System dependency (required for voiceover)
apt-get install -y ffmpeg # Debian/Ubuntu/Raspberry Pi OS
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your TELEGRAM_BOT_TOKEN
python src/bot.py
Note: On first run,
faster-whisperwill download the Whispertinymodel (~39 MB) to~/.cache/automatically. This only happens once.
Deploy
Push to main β GitHub Actions deploys automatically to the LXC container.
License
MIT
