Quick reference for diagnosing and fixing common issues with the Eugen Twitch bot.
Before anything else, run the credential validator:
python test_credentials.pyThis tool will:
- Test your Twitch OAuth token
- Validate your Perplexity API key
- Check model availability (sonar-pro vs sonar)
- Provide specific error messages
- Suggest exact fixes
Error Output:
IRC EVENT: privnotice | Source: tmi.twitch.tv | Args: ['Login authentication failed']
Causes:
- Token is expired or invalid
- Token doesn't match the bot nickname
- Bot account is banned/suspended
Solution:
-
Verify Bot Nickname Match
- If
TWITCH_BOT_NICKNAME=Eugen, you must generate the token while logged into Twitch asEugen - Token and bot nickname MUST match the same account
- If
-
Generate New Token
1. Go to: https://twitchtokengenerator.com 2. Log into Twitch as the bot account 3. Select "Bot Chat Token" 4. Copy the full token (including oauth: prefix) 5. Update .env file: TWITCH_OAUTH_TOKEN=oauth:your_new_token_here -
Test the Token
python test_credentials.py
Error Output:
⚠ Unerwartete Antwort: 400
Causes:
- API key doesn't have access to
sonar-promodel - Invalid request format
- Model not available on your plan
Solution:
-
Use Model Fallback
- The setup wizard automatically tries
sonarifsonar-profails - Manually update
.env:PERPLEXITY_MODEL=sonar
- The setup wizard automatically tries
-
Verify API Key
python test_credentials.py
-
Check API Credits
- Go to: https://www.perplexity.ai/settings/api
- Verify your account has credits
- Check API key is active
Error Output:
✗ Perplexity API-Key ist ungültig (401 Unauthorized)
Causes:
- Invalid API key
- API key was revoked
- Typo in
.envfile
Solution:
-
Generate New API Key
1. Go to: https://www.perplexity.ai/settings/api 2. Create new API key 3. Copy the key (starts with pplx-) 4. Update .env: PERPLEXITY_API_KEY=pplx-your_new_key_here -
Verify No Extra Spaces
- Check
.envfile has no spaces around the=sign - Format:
PERPLEXITY_API_KEY=pplx-abc123(no spaces)
- Check
Symptoms:
- Bot connects successfully
- Bot joins channel
- But doesn't respond to mentions
Checklist:
-
Verify Bot is Mentioned Correctly
✓ @Eugen how are you? ✓ Eugen: tell me about WoW ✓ Eugen, what's new? ✗ eugen (lowercase doesn't work) -
Check Debug Logs
tail -f logs/eugen.log
Look for:
Mention detected from {user}API call to Perplexity- Any error messages
-
Enable Debug Mode
DEBUG_MODE=trueRestart the bot and check logs again
-
Test Credentials
python test_credentials.py
Error Output:
IRC EVENT: disconnect | Args: ['Connection reset by peer']
Causes:
- Network interruption
- Firewall blocking port 6667
- Invalid authentication (see #1)
Solution:
-
Check Firewall
- Allow outbound connections on port 6667
- Try temporarily disabling firewall to test
-
Verify Internet Connection
ping irc.chat.twitch.tv
-
Check OAuth Token (most common cause)
python test_credentials.py
Error Output:
429 Too Many Requests
Causes:
- Too many API calls in short time
- Perplexity API quota exceeded
Solution:
-
Check API Usage
- Go to: https://www.perplexity.ai/settings/api
- View usage and limits
-
Reduce Request Frequency
- Consider implementing cooldowns
- Limit responses to specific users
-
Wait and Retry
- Wait a few minutes
- Restart the bot
cat .envtail -n 50 logs/eugen.logtail -n 50 logs/api_debug.logpython test_credentials.pypython setup_wizard.py- Run
python test_credentials.py - Check
logs/eugen.log - Enable
DEBUG_MODE=trueand restart - Review this troubleshooting guide
When reporting issues, include:
- Error messages from logs
- Output of
python test_credentials.py - Contents of
.env(REDACT secrets!) - Python version:
python --version - OS: Windows/Linux/Mac
- GitHub Issues: https://github.com/Kenearos/KI-Chat-Bot-Eugen/issues
- Twitch Token Generator: https://twitchtokengenerator.com
- Perplexity API: https://www.perplexity.ai/settings/api
- Configuration:
.env - Main log:
logs/eugen.log - API debug:
logs/api_debug.log - Conversations:
data/conversations/
- Twitch OAuth Token (starts with
oauth:) - Twitch Bot Nickname (must match token account)
- Twitch Channel (starts with
#) - Perplexity API Key (starts with
pplx-)
python setup_wizard.py- Interactive setuppython test_credentials.py- Validate credentialspython chatbot.py- Run the bot