fix profile

This commit is contained in:
reality 2013-10-23 19:53:14 +00:00
parent 80b76c9325
commit 1e995d7bba
2 changed files with 5 additions and 4 deletions

View File

@ -2,7 +2,7 @@ var _ = require('underscore')._;
var commands = function(dbot){
var commands = {
'~getprop': function(event){
'~get': 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){
@ -14,7 +14,7 @@ var commands = function(dbot){
}
},
'~setprop': function(event){
'~set': 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){
@ -31,7 +31,7 @@ var commands = function(dbot){
event.reply(dbot.api.web.getUrl('profile/' + event.server + '/' + user));
}
};
commands['~setprop'].regex = [/~setprop ([^ ]+) (.+)/, 3];
commands['~set'].regex = [/~set ([^ ]+) (.+)/, 3];
return commands;
};

View File

@ -8,9 +8,10 @@
"tagline": null,
"avatar": null,
"bio": null,
"lastfm": null,
"favourites": {
"colour": null
},
}
}
},
"dependencies": [ "web", "quotes", "users" ]