3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-25 04:02:39 +01:00

FIXED THAT MOTHERFUCKING BASTID BUG I AM THE RESURRECTION YEAAAAAAAAA [#272]

This commit is contained in:
reality 2013-03-24 18:05:57 +00:00
parent 17c2c4b317
commit 9443970c89

View File

@ -12,7 +12,7 @@ var users = function(dbot) {
'createUser': function(server, nick, channel, callback) {
var id = uuid.v4();
this.db.create('users', id, {
'uuid': id,
'id': id,
'primaryNick': nick,
'currentNick': nick,
'server': server,
@ -22,15 +22,12 @@ var users = function(dbot) {
if(!err) {
dbot.api.event.emit('new_user', [ result ]);
callback(result);
dbot.say('aberwiki', '#realitest', result.server);
dbot.say('aberwiki', '#realitest', result.primaryNick);
}
});
}.bind(this),
'addChannelUser': function(user, channelName) {
user.channels.push(channelName);
dbot.say('aberwiki', '#realitest', user.id);
this.db.save('users', user.id, user, function(err) {
if(!err) {
this.api.getChannel(user.server, channelName, function(channel) {
@ -40,7 +37,7 @@ var users = function(dbot) {
dbot.api.event.emit('new_channel_user', [ user, channel]);
}
});
});
}.bind(this));
}
}.bind(this));
}.bind(this),
@ -101,7 +98,7 @@ var users = function(dbot) {
if(!channel) { // Channel does not yet exist
var id = uuid.v4();
this.db.create('channel_users', id, {
'uuid': id,
'id': id,
'server': event.server,
'name': event.channel.name,
'users': []