Commit graph

9 commits

Author SHA1 Message Date
Claude
e87963148c
Add comprehensive IRC event debugging to diagnose message reception issues
- Add global event handler to log all IRC events
- Add on_join handler to properly track channel joins
- Add on_disconnect handler to detect connection drops
- Add on_privmsg handler to catch messages that might not trigger pubmsg
- Add detailed debug logging throughout message flow
- Improve test_irc.py with same debugging capabilities
2026-01-06 12:34:11 +00:00
Kenearos
952e543970
Merge pull request #12 from Kenearos/claude/init-irc-bot-dashboard-kYxih
Claude/init irc bot dashboard k yxih
2026-01-02 22:42:31 +01:00
Claude
5e0ebbb1c4
Add nickname detection and AI-based ambiguous message handling
Enhanced bot to respond to partial names and ambiguous greetings:

MentionDetector improvements (utils.py):
- Auto-generate nicknames from bot name (kenearosmd → Kene, Kenearos)
- Add patterns for all nicknames (full name + partial names)
- New is_ambiguous_greeting() method for greetings without clear mention
- Updated extract_content() to remove all name variants

Bot logic improvements (chatbot.py):
- New check_if_addressed() method uses AI to determine if ambiguous
  messages are directed at the bot
- AI analyzes greetings like "Hi wie gehts" and decides if bot should respond
- If AI confirms, message is processed like a normal mention

Recognition examples:
- kenearosmd: wie gehts → responds 
- Kene was meinst du → responds 
- Kenearos! → responds 
- Hi wie gehts → AI checks context → responds if appropriate 

This prevents the bot from spamming on every greeting while still
being responsive when addressed indirectly.
2026-01-02 21:30:20 +00:00
copilot-swe-agent[bot]
3614c7e76b Add synchronization and cleanup for event loop thread
Co-authored-by: Kenearos <86194771+Kenearos@users.noreply.github.com>
2026-01-02 21:20:01 +00:00
Claude
e9fc21e423
Fix bot not responding to mentions - event loop wasn't running
The bot was detecting mentions correctly but not responding because
the async event loop was never started.

Changes:
- Created separate _run_event_loop() method to run loop.run_forever()
- Start event loop in its own daemon thread before IRC bot
- IRC bot thread no longer sets event loop (handled by loop thread)
- Now asyncio.run_coroutine_threadsafe() can properly execute async tasks

This fixes the issue where mentions were detected but handle_mention()
was never executed because there was no running event loop to process
the coroutine.
2026-01-02 21:09:39 +00:00
Claude
a52be47121
Fix shutdown error: file descriptor cannot be a negative integer
Improved error handling in bot shutdown process:
- Check connection state before attempting to quit IRC
- Use thread-safe event loop shutdown
- Filter expected shutdown errors from error logs
- Changed shutdown errors to debug level logging

This prevents the "file descriptor cannot be a negative integer (-1)"
error from appearing as an ERROR when cleanly shutting down the bot.
2026-01-02 21:06:47 +00:00
Claude
2b15ceeaa1
Replace print statements with proper logging
Fixed inconsistent error handling in ai_provider.py and memory.py by:
- Adding optional logger parameter to PerplexityProvider and ConversationMemory classes
- Replacing all print() statements with proper logger.error() calls
- Updating chatbot.py to pass logger instance to both components
- Ensuring consistent logging architecture across the codebase

This improves error visibility and integrates with the existing logging infrastructure.
2026-01-02 20:58:49 +00:00
Claude
193e269274
Add detailed logging for content extraction debugging
- Log extracted content to help debug empty content issue
- Add warning when content is empty after mention extraction
- Display extraction info in dashboard for better visibility

Helps diagnose why bot detects mentions but doesn't respond
2026-01-02 20:53:11 +00:00
Claude
963a65536f
Implement complete Eugen Twitch chatbot
This commit implements the full Eugen bot based on specifications in CLAUDE.md and eugen_claude.md.

Features implemented:
- Smart name recognition (@Eugen, Eugen:, etc.)
- Persistent conversation memory per user (max 25 messages, 1 hour retention)
- Perplexity Sonar API integration for AI responses
- Live monitoring dashboard with PySimpleGUI
- Setup wizard for first-time configuration
- Comprehensive logging (main log + API debug log)

Files added:
- config.py: Configuration management from .env and config.json
- utils.py: MentionDetector and Logger utility classes
- memory.py: ConversationMemory for persistent chat history
- ai_provider.py: PerplexityProvider for API integration
- gui.py: Dashboard and SetupWizard GUI components
- chatbot.py: Main EugenBot orchestrator with IRC handling
- requirements.txt: Python dependencies
- .env.example: Template for environment variables
- .gitignore: Renamed from gitignore for proper Git usage

Updated:
- README.md: Complete usage instructions and documentation

The bot is ready to use - users just need to add their API keys and run python chatbot.py
2026-01-02 11:18:40 +00:00