From 72200596de9349334d177c2992912bae592d67bd Mon Sep 17 00:00:00 2001 From: reality Date: Thu, 27 Jun 2013 18:43:52 +0000 Subject: [PATCH] reinstate ~profile command --- modules/profile/commands.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/modules/profile/commands.js b/modules/profile/commands.js index f8c81a0..8900e68 100644 --- a/modules/profile/commands.js +++ b/modules/profile/commands.js @@ -2,32 +2,34 @@ var _ = require('underscore')._; var commands = function(dbot){ var commands = { - - "~getprop": function(event){ + '~getprop': function(event){ if(event.params[1]){ if(_.has(this.config.schema.profile, event.params[1])){ this.api.getProperty(event.server, event.user, event.params[1], function(reply){ event.reply(reply); }); - } - else{ - event.reply("Invalid property. Go home."); + } else { + event.reply('Invalid property. Go home.'); } } }, - "~setprop": function(event){ + '~setprop': function(event){ if(event.input[1] && event.input[2]){ if(_.has(this.config.schema.profile, event.input[1])){ this.api.setProperty(event.server, event.user, event.input[1], event.input[2], function(reply){ event.reply(reply); }); - } - else{ - event.reply("Invalid property. Go home."); + } else { + event.reply('Invalid property. Go home.'); } } }, + + '~profile': function(event) { + var user = event.params[1] || event.user; + event.reply(dbot.api.web.getUrl('profile/' + event.server + '/' + user)); + } }; commands['~setprop'].regex = [/~setprop ([^ ]+) (.+)/, 3];