3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 22:39:26 +01:00
dbot/modules/profile/api.js

23 lines
590 B
JavaScript

var _ = require('underscore')._;
var api = function(dbot) {
return {
/**
* Create a profile for a new primary user on a given server.
* If the server does not already exist, create it.
*/
"createProfile": function(server, primary){
if(!_.has(this.profiles, server)){
this.profiles[server] = {};
}
this.profiles[server][primary] = {};
_.defaults(this.profiles[server][primary], this.config.schema);
},
}
};
exports.fetch = function(dbot) {
return api(dbot);
};