diff --git a/Utils.py b/Utils.py index eca0e895..0acce941 100644 --- a/Utils.py +++ b/Utils.py @@ -216,3 +216,6 @@ def get_closest_setting(event, setting, default=None): else: closest = event["user"] return closest.get_setting(setting, server.get_setting(setting, default)) + +def prevent_highlight(nickname): + return nickname[0]+"\u200b"+nickname[1:] diff --git a/modules/coins.py b/modules/coins.py index 9face321..4ccdfff9 100644 --- a/modules/coins.py +++ b/modules/coins.py @@ -51,9 +51,9 @@ class Module(object): top_10 = sorted(all_coins.keys()) top_10 = sorted(top_10, key=all_coins.get, reverse=True)[:10] - top_10 = ", ".join("%s (%s)" % (event["server"].get_user( - nickname).nickname, "{0:.2f}".format(all_coins[nickname]) - ) for nickname in top_10) + top_10 = ", ".join("%s (%s)" % (Utils.prevent_highlight(event[ + "server"].get_user(nickname).nickname), "{0:.2f}".format( + all_coins[nickname])) for nickname in top_10) event["stdout"].write("Richest users: %s" % top_10) def redeem_coins(self, event): diff --git a/modules/words.py b/modules/words.py index ccdfa0cb..71fabb82 100644 --- a/modules/words.py +++ b/modules/words.py @@ -1,4 +1,4 @@ - +import Utils class Module(object): def __init__(self, bot): @@ -80,8 +80,8 @@ class Module(object): top_10 = sorted(word_users.keys()) top_10 = sorted(top_10, key=word_users.get, reverse=True)[:10] - top_10 = ", ".join("%s (%d)" % (event["server"].get_user( - nickname).nickname, word_users[nickname] + top_10 = ", ".join("%s (%d)" % (Utils.prevent_highlight(event[ + "server"].get_user(nickname).nickname), word_users[nickname] ) for nickname in top_10) event["stdout"].write("Top '%s' users: %s" % (word, top_10)) else: