我们从Python开源项目中,提取了以下5个代码示例,用于说明如何使用itchat.add_friend()。
def add_friends(msg): itchat.add_friend(**msg['Text'])
def add_friend(user_name, status=2, verify_content='', auto_update=True): ''' add a friend or accept a friend for options - user_name: 'user_name' for friend's info dict - status: - for adding status should be 2 - for accepting status should be 3 - ticket: greeting message - userInfo: friend's other info for adding into local storage it is defined in components/contact.py ''' return itchat.add_friend(user_name, status, verify_content, auto_update)
def add_friend(msg, status=3): itchat.add_friend(**msg['Text']) # ???????????????????????? time.sleep(5) itchat.send_msg(u'????????', msg['RecommendInfo']['UserName'])
def fri_reply(msg): itchat.add_friend(**msg['Text']) itchat.send_msg('??????????', msg['RecommendInfo']['UserName'])
def add_friend(msg): logging.info('add friend {}, message {}'.format(msg['RecommendInfo']['UserName'], msg['Text'])) itchat.add_friend(**msg['Text']) itchat.send_msg(faq.replay_welcome(), msg['RecommendInfo']['UserName'])