by default, prevent highlighting from !wordiest
This commit is contained in:
parent
330c0ded44
commit
2c524303aa
1 changed files with 8 additions and 2 deletions
|
@ -129,6 +129,12 @@ class Module(ModuleManager.BaseModule):
|
||||||
else:
|
else:
|
||||||
event["stderr"].write("That word is not being tracked")
|
event["stderr"].write("That word is not being tracked")
|
||||||
|
|
||||||
|
def _get_nickname(self, server, target, nickname):
|
||||||
|
nickname = server.get_user(nickname).nickname
|
||||||
|
if target.get_setting("wordiest-prevent-highlight", True):
|
||||||
|
nickname = utils.prevent_highlight(nickname)
|
||||||
|
return nickname
|
||||||
|
|
||||||
@utils.hook("received.command.wordiest")
|
@utils.hook("received.command.wordiest")
|
||||||
def wordiest(self, event):
|
def wordiest(self, event):
|
||||||
"""
|
"""
|
||||||
|
@ -155,7 +161,7 @@ class Module(ModuleManager.BaseModule):
|
||||||
user_words[nickname] += word_count
|
user_words[nickname] += word_count
|
||||||
|
|
||||||
top_10 = utils.top_10(user_words,
|
top_10 = utils.top_10(user_words,
|
||||||
convert_key=lambda nickname:
|
convert_key=lambda nickname: self._get_nickname(
|
||||||
event["server"].get_user(nickname).nickname)
|
event["server"], event["target"], nickname))
|
||||||
event["stdout"].write("wordiest%s: %s" % (
|
event["stdout"].write("wordiest%s: %s" % (
|
||||||
word_prefix, ", ".join(top_10)))
|
word_prefix, ", ".join(top_10)))
|
||||||
|
|
Loading…
Reference in a new issue