Bug fixes for word scoring

This commit is contained in:
aewens 2018-12-04 11:45:18 -05:00
parent 5246008861
commit 7d44bfad19
2 changed files with 3 additions and 3 deletions

View File

@ -52,7 +52,7 @@ actions = [
},
{
"type": "response",
"pattern": "/hm+/",
"pattern": "/.^[^!]*hm+/",
"callback": score_word("hmm", "hm+")
},
{
@ -67,7 +67,7 @@ actions = [
},
{
"type": "response",
"pattern": "/o+f/",
"pattern": "/^[^!]*o+f/",
"callback": score_word("oof", "o+f")
},
{

View File

@ -9,7 +9,7 @@ def score_word(word, regex):
check = response.lower().strip()
botnick = self.bot.botnick
pattern = re.compile(regex)#"hm+")
pattern = re.compile(regex)
matches = re.findall(pattern, check)
maximum = 10
score = len(matches) if len(matches) <= maximum else maximum