mirror of
https://github.com/reality/dbot.git
synced 2024-11-30 16:09:27 +01:00
karma colour
This commit is contained in:
parent
a2ea8cd260
commit
17840f5c9c
@ -124,7 +124,18 @@ var karma = function(dbot) {
|
|||||||
|
|
||||||
this.internalAPI.setKarma(match[1], karma, function(err, karma) {
|
this.internalAPI.setKarma(match[1], karma, function(err, karma) {
|
||||||
this.lastKarma[event.rUser.id] = Date.now();
|
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],
|
'item': match[1],
|
||||||
'value': karma.karma
|
'value': karma.karma
|
||||||
}));
|
}));
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"karma": {
|
"karma": {
|
||||||
"en": "[karma] {item} has {karma} karma"
|
"en": "{item} has {karma} karma"
|
||||||
},
|
},
|
||||||
"newkarma": {
|
"newkarma": {
|
||||||
"en": "[karma] {item} now has {value} karma"
|
"en": "{item} now has {value} karma"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user