Add debug test scripts for troubleshooting
Added two diagnostic tools: test_mention.py: - Tests MentionDetector with various message formats - Shows nickname generation (Kene from Kenearos) - Displays extracted content from mentions - Helps verify mention detection is working correctly test_irc.py: - Minimal IRC bot for testing message reception - Prints all received messages to console - Helps diagnose if IRC connection is receiving messages - Useful for debugging connection issues These tools help troubleshoot when bot doesn't respond: 1. Run test_mention.py to verify detection logic 2. Run test_irc.py to verify IRC message reception
This commit is contained in:
parent
5daf62ba22
commit
11b928c242
2 changed files with 85 additions and 0 deletions
37
test_mention.py
Normal file
37
test_mention.py
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/env python3
|
||||
"""
|
||||
Test script to check if mention detection works
|
||||
"""
|
||||
from utils import MentionDetector
|
||||
|
||||
# Test with your bot name
|
||||
detector = MentionDetector(bot_name="Kenearos")
|
||||
|
||||
print("Testing Mention Detection for bot: Kenearos")
|
||||
print("=" * 60)
|
||||
print(f"Generated nicknames: {detector.nicknames}")
|
||||
print()
|
||||
|
||||
# Test messages
|
||||
test_messages = [
|
||||
"@Kenearos Hi",
|
||||
"Kenearos: wie gehts dir?",
|
||||
"Kene was meinst du?",
|
||||
"Hey Kenearos!",
|
||||
"kenearos test",
|
||||
"KENEAROS TEST",
|
||||
"Hi wie gehts",
|
||||
"Hallo",
|
||||
"test message without bot",
|
||||
]
|
||||
|
||||
for msg in test_messages:
|
||||
is_mentioned = detector.is_mentioned(msg)
|
||||
is_greeting = detector.is_ambiguous_greeting(msg)
|
||||
content = detector.extract_content(msg) if is_mentioned else "N/A"
|
||||
|
||||
print(f"Message: '{msg}'")
|
||||
print(f" Mentioned: {is_mentioned}")
|
||||
print(f" Ambiguous greeting: {is_greeting}")
|
||||
print(f" Extracted content: '{content}'")
|
||||
print()
|
||||
Loading…
Add table
Add a link
Reference in a new issue