aboutsummaryrefslogtreecommitdiff
path: root/modules/words.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-01-04 12:13:36 +0000
committerGravatar jesopo2019-01-04 12:13:36 +0000
commit8171c5c49254562217b814a3149fbef446373a0a (patch)
tree5d9004f9b40843def07aa8678a0621395985a2b1 /modules/words.py
parentSort list of available settings for set/channelset/etc (set.py) (diff)
signature
Allow tracking words that have characters deemed as "start"/"end" characters
(words.py)
Diffstat (limited to 'modules/words.py')
-rw-r--r--modules/words.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/words.py b/modules/words.py
index a4295b79..3e963d95 100644
--- a/modules/words.py
+++ b/modules/words.py
@@ -22,9 +22,15 @@ class Module(ModuleManager.BaseModule):
tracked_words = set(event["server"].get_setting(
"tracked-words", []))
for word in words:
- word = word.lstrip(WORD_START).rstrip(WORD_STOP)
+ stripped_word = word.lstrip(WORD_START).rstrip(WORD_STOP)
+ found = None
if word.lower() in tracked_words:
- setting = "word-%s" % word
+ found = word.lower()
+ elif strippped_word.lower() in tracked_words:
+ found = stripped_word.lower()
+
+ if found:
+ setting = "word-%s" % found
word_count = user.get_setting(setting, 0)
word_count += 1
user.set_setting(setting, word_count)