diff --git a/plugins/wordbot.py b/plugins/wordbot.py index 03c4f83..e539047 100644 --- a/plugins/wordbot.py +++ b/plugins/wordbot.py @@ -3,6 +3,7 @@ import itertools import logging from pathlib import Path import random +import re import sqlite3 import time from typing import Set @@ -234,8 +235,8 @@ class Wordbot(Plugin): if not self.db.is_game_active(channel): # Don't try to score words for inactive games return - parts = {word.strip().lower() for word in line.split()} - matches = parts & self.db.unmatched_words(channel) + words_in_line = {re.findall("[a-z0-9-]+", line.lower())} + matches = words_in_line & self.db.unmatched_words(channel) for word in matches: self.send_to( conn,