           log.error e  if e
           @save_group_info ret.result if ret.retcode == 0
           callback( ret.retcode == 0, e || 'retcode isnot 0' ) if callback
+
+    # 获取好友列表
+    update_buddy_list: (callback)->
+        @api.get_buddy_list @auth , (ret,e)=>
+            @save_buddy_info ret.result if ret.retcode == 0
+            callback( ret.retcode == 0, e || 'retcode isnot 0' ) if callback
     
     # 更新群成员， 似乎获取不到群ID
     # @options {key:value} 

            log.debug "[群消息]","[#{msg.from_group.name}] #{msg.from_user.nick}:#{msg.content} #{msg.time}"
        else if msg.type == 'buddy'
            log.debug "[好友消息]","#{msg.from_user.nick}:#{msg.content} #{msg.time}"
        
        # 消息处理 ，只操作群
        # if msg.type == 'group'
        
        content = msg.content.trim()
        replied = false
        reply = (content)=>
            @reply_message(msg,content) unless replied
            replied = true
            
        @dispatcher.dispatch(content ,reply, @ , msg)
            
                    
    _create_message : (event)->
        value = event.value
        msg = 
            content : value.content.slice(-1).pop()
            time    : new Date(value.time * 1000)
            from_uin: value.from_uin
            type    : if value.group_code then 'group' else 'buddy'

    listen_group : (name , callback) ->
      log.info 'fetching group list'
      @update_group_list (ret, e) =>
          log.info '√ group list fetched'
                    
          @update_buddy_list (ret,error)->
              log.info '√ buddy list fetched' if ret

          
          log.info "fetching groupmember #{name}"
          @update_group_member {name:name} ,(ret,error)=>
              log.info '√ group memeber fetched'
                
              groupinfo = @get_group {name:name} 
              group = new Group(@, groupinfo.gid)
