mirror of
https://github.com/reality/dbot.git
synced 2024-11-30 16:09:27 +01:00
test
This commit is contained in:
parent
f621fbc38e
commit
01b2d22059
2
jsbot
2
jsbot
@ -1 +1 @@
|
|||||||
Subproject commit c8bfa1bd838d8ff074c266055e373e63506e647b
|
Subproject commit 14868e9d935bfd39ba698f6c610fc0c049da2b8a
|
@ -68,6 +68,10 @@ var api = function(dbot) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
'resolveChannel': function(server, channelName, callback) {
|
'resolveChannel': function(server, channelName, callback) {
|
||||||
|
if(_.has(this.chanCache[server], channelName)) {
|
||||||
|
return this.api.getChannel(this.chanCache[server][channelName], callback);
|
||||||
|
}
|
||||||
|
|
||||||
var channel = false;
|
var channel = false;
|
||||||
this.db.search('channel_users', {
|
this.db.search('channel_users', {
|
||||||
'server': server,
|
'server': server,
|
||||||
@ -76,9 +80,10 @@ var api = function(dbot) {
|
|||||||
channel = result;
|
channel = result;
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
if(!err) {
|
if(!err) {
|
||||||
|
this.chanCache[server][channelName] = channel.id;
|
||||||
callback(channel);
|
callback(channel);
|
||||||
}
|
}
|
||||||
});
|
}.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
'getChannel': function(uuid, callback) {
|
'getChannel': function(uuid, callback) {
|
||||||
|
@ -11,6 +11,10 @@ var users = function(dbot) {
|
|||||||
_.each(dbot.config.servers, function(v, k) {
|
_.each(dbot.config.servers, function(v, k) {
|
||||||
this.userCache[k] = {};
|
this.userCache[k] = {};
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
this.chanCache = {};
|
||||||
|
_.each(dbot.config.servers, function(v, k) {
|
||||||
|
this.chanCache[k] = {};
|
||||||
|
}.bind(this));
|
||||||
|
|
||||||
/*** Internal API ***/
|
/*** Internal API ***/
|
||||||
this.internalAPI = {
|
this.internalAPI = {
|
||||||
|
Loading…
Reference in New Issue
Block a user