mirror of
				https://github.com/reality/dbot.git
				synced 2025-11-04 12:37:40 +01:00 
			
		
		
		
	new db without resolvchan
This commit is contained in:
		
							parent
							
								
									5621bad05c
								
							
						
					
					
						commit
						d3633fc21d
					
				@ -12,24 +12,18 @@ var reddit = function(dbot) {
 | 
			
		||||
 | 
			
		||||
    this.internalAPI = {
 | 
			
		||||
        'getChannelFeeds': function(server, cName, callback) {
 | 
			
		||||
            dbot.api.users.resolveChannel(server, cName, function(channel) {
 | 
			
		||||
                if(channel) {
 | 
			
		||||
                    this.db.read('reddit_feeds', channel.id, function(err, cFeeds) {
 | 
			
		||||
                        if(err || !cFeeds) {
 | 
			
		||||
                            callback(null, {
 | 
			
		||||
                                'id': channel.id,
 | 
			
		||||
                                'server': server,
 | 
			
		||||
                                'channel': cName,
 | 
			
		||||
                                'feeds': {}
 | 
			
		||||
                            });
 | 
			
		||||
                        } else {
 | 
			
		||||
                           callback(null, cFeeds); 
 | 
			
		||||
                        }
 | 
			
		||||
            this.db.read('reddit_feeds', cName + '.' + server, function(err, cFeeds) {
 | 
			
		||||
                if(err || !cFeeds) {
 | 
			
		||||
                    callback(null, {
 | 
			
		||||
                        'id': cName + '.' + server,
 | 
			
		||||
                        'server': server,
 | 
			
		||||
                        'channel': cName,
 | 
			
		||||
                        'feeds': {}
 | 
			
		||||
                    });
 | 
			
		||||
                } else {
 | 
			
		||||
                    callback('NoSuchChannel', null);
 | 
			
		||||
                   callback(null, cFeeds); 
 | 
			
		||||
                }
 | 
			
		||||
            }.bind(this));
 | 
			
		||||
            });
 | 
			
		||||
        }.bind(this),
 | 
			
		||||
 | 
			
		||||
        'updateChannelFeeds': function(cFeeds, callback) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user