From 17840f5c9cd9ef23bc794e26558eea80906a9395 Mon Sep 17 00:00:00 2001 From: reality Date: Mon, 23 Mar 2015 16:14:41 +0000 Subject: [PATCH] karma colour --- modules/karma/karma.js | 13 ++++++++++++- modules/karma/strings.json | 4 ++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/modules/karma/karma.js b/modules/karma/karma.js index d175069..9722792 100644 --- a/modules/karma/karma.js +++ b/modules/karma/karma.js @@ -124,7 +124,18 @@ var karma = function(dbot) { this.internalAPI.setKarma(match[1], karma, function(err, karma) { this.lastKarma[event.rUser.id] = Date.now(); - event.reply(dbot.t('newkarma', { + var pre; + if(karma.karma > 0) { + pre = '[\u00039karma\u000f]'; + karma.karma = '[\u00039'+karma.karma+'\u000f]'; + } else if(karma.karma < 0) { + pre = '[\u00034karma\u000f]'; + karma.karma = '[\u00034'+karma.karma+'\u000f]'; + } else { + pre = '[\u00036karma\u000f]'; + karma.karma = '[\u00036'+karma.karma+'\u000f]'; + } + event.reply(pre + ' ' + dbot.t('newkarma', { 'item': match[1], 'value': karma.karma })); diff --git a/modules/karma/strings.json b/modules/karma/strings.json index c524d4f..9b3b449 100644 --- a/modules/karma/strings.json +++ b/modules/karma/strings.json @@ -1,8 +1,8 @@ { "karma": { - "en": "[karma] {item} has {karma} karma" + "en": "{item} has {karma} karma" }, "newkarma": { - "en": "[karma] {item} now has {value} karma" + "en": "{item} now has {value} karma" } }