From f097685c3d2c07e85f7d1763d107574f62552d0b Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 10 Feb 2018 12:47:54 +0000 Subject: [PATCH] notes fixes --- modules/report/commands.js | 5 +++-- modules/warning/warning.js | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/report/commands.js b/modules/report/commands.js index 00e52ac..2e94d73 100644 --- a/modules/report/commands.js +++ b/modules/report/commands.js @@ -140,7 +140,7 @@ var commands = function(dbot) { var notes = {}; this.db.search('warnings', { 'server': server, - 'warnee': warnee.id + 'warnee': target.id }, function(warning) { if(warning.reason.match('#note')) { notes[warning.time] = warning; @@ -153,7 +153,8 @@ var commands = function(dbot) { var n = 0; _.each(nTimes, function(key) { - event.reply('['+n+'][\u00036note\u000f][' + moment(parseInt(time)).format('DD/MM/YYYY') + '] ' + notes[key].reason); + // just couldn't be bothered doing the warner lookup, waste of time + event.reply('[\u00036note ' + n + '\u000f][' + moment(parseInt(key)).format('DD/MM/YYYY') + ']['+notes[key].warner.split('.')[0]+'] ' + notes[key].reason); n++; }); } else { diff --git a/modules/warning/warning.js b/modules/warning/warning.js index aa1d370..0c291c5 100644 --- a/modules/warning/warning.js +++ b/modules/warning/warning.js @@ -171,6 +171,7 @@ var warning = function(dbot) { this.commands['~warn'].access = 'power_user'; this.commands['~rmwarning'].access = 'power_user'; this.commands['~rmlastwarning'].access = 'power_user'; + this.commands['~addnote'].regex = [/addnote ([^ ]+) (.+)/, 3]; this.commands['~addnote'].access = 'power_user'; };