예제 #1
0
def add_users(chatroom):
    newusers = get_newusers(chatroom)
    #if 'USTC' or u'科大'in chatroom['NickName']:
    #    VerifyContent = u'Hi, I am 徐峤 0804 from %s' % chatroom['NickName']
    #elif u'求职' in chatroom['NickName']:
    #    VerifyContent = 'Hi, I am Qiao Xu 0804 from %s, My LinkedIn address is: https://www.linkedin.com/in/qiao--xu' % chatroom['NickName']
    #else:
    VerifyContent = u'Hi, I am Qiao Xu from %s, 曹教授校友, 现在美国国家实验室' % chatroom['NickName']
    #VerifyContent = u'你好,沃顿论坛小伙伴'
    random.shuffle(newusers) #random shuffle elements
    iadded = 0
    for friend in newusers:
        #if friend['NickName'] != 'test': continue  # a specific name
        add_msg = itchat.add_friend(friend['UserName'], status=2, verifyContent=VerifyContent, autoUpdate=True)
        #print("Adding %s now: %s" % (friend['NickName'], add_msg['BaseResponse']['ErrMsg'].encode('latin-1')))
        try:
            add_msg['BaseResponse']['ErrMsg'].encode('latin-1')
            print("Adding %s now: %s" % (friend['NickName'], add_msg['BaseResponse']['ErrMsg'].encode('latin-1')))
        except:
            print("Adding %s now: %s" % (friend['NickName'], add_msg['BaseResponse']['ErrMsg']))
            pass
        iadded = iadded + 1
        itry = 0
        while add_msg['BaseResponse']['ErrMsg'] != u'请求成功':  # api limitation, only 10 at a time
        #while add_msg['BaseResponse']['ErrMsg'].encode('latin-1') == '操作太频繁,请稍后再试。':  # api limitation, only 10 at a time
            itry = itry + 1
            time.sleep(100)
            add_msg = itchat.add_friend(friend['UserName'], status=2, verifyContent=VerifyContent, autoUpdate=True)
            print('retry %s time' % itry)
        time.sleep(30)
    return iadded
예제 #2
0
def recv_msg(msg):
    print(msg)
    if msg['Text'] == "100":
        ALREADY_SET = True
        itchat.send('输入群名,添加好友', toUserName='******')
    else:
        if msg['Text'] == "Test":
            itchat.send('输入200, 加好友', toUserName='******')
        else:
            chatroomName = "Test"
            print(chatroomName)
            itchat.get_chatrooms(update=True)
            chatrooms = itchat.search_chatrooms(name=chatroomName)
            if chatrooms is None:
                print(u'没有找到群聊:' + chatroomName)
            else:
                chatroom = itchat.update_chatroom(chatrooms[0]['UserName'])
                for friend in chatroom['MemberList']:
                    friend = itchat.search_friends(userName=friend['UserName'])
                    # 如果是演示目的,把下面的方法改为print即可
                    if friend != None:
                        # print(friend)
                        print(friend['UserName'])
                        itchat.add_friend(userName=friend['UserName'],
                                          status=2)
                        # itchat.add_member_into_chatroom('Test', [friend['UserName']])
                        # itchat.send_msg('Text message', toUserName=friend['UserName'])
                        # print(REAL_SINCERE_WISH % (friend['DisplayName']
                        # or friend['NickName']), friend['UserName'])
                        # itchat.send('hello', toUserName='******')
                        itchat.send('欢迎使用本服务', toUserName=friend['UserName'])
                        time.sleep(.5)

                    else:
                        print('no msg')
예제 #3
0
def add_friend(msg):
    itchat.add_friend(**msg['Text'])  # 该操作会自动将新好友的消息录入,不需要重载通讯录
    user_info = itchat.search_friends(
        userName=msg['RecommendInfo']['UserName'])
    itchat.send_msg(u'Hi,我是一个智能机器人,能帮助您自动化的管理微信群,把我拉入群,我就可以开始为你工作啦',
                    user_info['UserName'])
    upsert_user(user_info)
예제 #4
0
파일: go.py 프로젝트: lilei57/hzlgithub
def add_friend(msg):
    # 该操作会自动将新好友的消息录入,不需要重载通讯录
    itchat.add_friend(**msg['Text'])
    # 加完好友后,给好友打个招呼
    #itchat.send_msg('[愉快]你好,我是微信自动回复消息机器人\n[抠鼻]想在淘宝/天猫买东西?直接把关键词发给我,机器人帮你找相关商品优惠券。\n[抠鼻]想在京东买东西?把链接发给我,机器人给你发返利红包\n--------------\n发送【帮助】查看使用机器人流程。', msg['RecommendInfo']['UserName'])
    itchat.send_msg('[愉快]你好,我是网购优惠券、返利机器人,\n发送【帮助】查看使用机器人流程。',
                    msg['RecommendInfo']['UserName'])
예제 #5
0
def add_friends_msg(msg):
    """ 监听添加好友请求 为了自动同意好友请求
    """

    conf = config.get('auto_reply_info')
    IS_AUTO_ADD_FRIEND = conf.get('is_auto_add_friend')

    add_friend_keys = ''.join(conf.get('auto_add_friend_keywords'))
    note_first_meet_text = '''等你等的好辛苦,很高心您的加入!

    '''  # 好友成功后的第一句话
    add_friend_compile = re.compile('|'.join(i.strip() for i in
                                             re.split(r'[,,]+', add_friend_keys) if i), re.I)  # 通过关键词同意加好友请求

    itchat.get_friends(update=True)  # 更新好友数据。

    if not IS_AUTO_ADD_FRIEND:  # 如果是已关闭添加好友功能,则直接返回
        return

    userid = msg['RecommendInfo']['UserName']
    nickname = msg['RecommendInfo']['NickName']

    content = msg['RecommendInfo']['Content']  # 获取验证消息
    if add_friend_compile.findall(content):
        time.sleep(random.randint(1, 2))  # 随机休眠(1~3)秒,用于防检测机器人
        itchat.add_friend(**msg['Text'])  # 同意加好友请求
        time.sleep(random.randint(1, 2))
        itchat.send(note_first_meet_text, userid)  # 给刚交的朋友发送欢迎语句
        note = '已添加好友:{}'.format(nickname)
        set_system_notice(note)
    else:
        note = '添加好友失败:用户「{}」 发来的验证消息「{}」。'.format(nickname, content)
        set_system_notice(note)
예제 #6
0
def add_friend(msg):
    if SWITCH_FRIEND:
        itchat.add_friend(**msg['Text'])  # 该操作将自动将好友的消息录入,不需要重载通讯录
        #新好友的打招呼信息,延迟后发送打招呼信息
        itchat.send_msg(GREETING[0], msg['RecommendInfo']['UserName'])
        itchat.send_msg(GREETING[1], msg['RecommendInfo']['UserName'])
        itchat.send_msg(GREETING[2], msg['RecommendInfo']['UserName'])
예제 #7
0
def msg_receive(msg):
    print(json.dumps(msg))
    if msg['FromUserName'].startswith("@@"):
        print(
            'receive msg :\n', "from group %s - %s : %s" %
            (msg['User']['NickName'], msg['ActualNickName'], msg.text))
        if (dfa(msg.text)):
            itchat.add_friend(msg.actualUserName, verifyContent='嘿嘿')
            s = "中国共产党同全国各民族工人、农民、知识分子团结在一起,同各民主党派、无党派人士、各民族的爱国力量团结在一起,进一步发展和壮大由全体社会主义劳动者、社会主义事业的建设者、拥护社会主义的爱国者、拥护祖国统一和致力于中华民族伟大复兴的爱国者组成的最广泛的爱国统一战线。"
            return "%s  ! %s" % (msg.actualNickName, s)
        if '加我好友' in msg.text:
            itchat.add_friend(msg.actualNickName, verifyContent='hello')
            itchat.send_msg('asdf', toUserName=msg.actualNickName)
        if msg.isAt:
            # someone @me
            msg.user.send(u'@%s\u2005 : 我收到了 --> %s 不要急...' %
                          (msg.actualNickName, msg.text))
        return
    res = reply(msg.text)
    print('receive msg :\n',
          "from friends %s : %s" % (msg['User']['NickName'], msg.text))
    if isinstance(res, dict):
        ty = res['type']
        if ty == 'img':
            itchat.send_image(res['path'], msg['FromUserName'])
        elif ty == 'file':
            itchat.send_file(res['path'], msg['FromUserName'])
    elif isinstance(res, str):
        if res == 'no_msg':
            pass
        else:
            return res
def deal_with_friend(msg):
    if add_friend_compile.search(msg['Content']) is not None:
        itchat.add_friend(**msg['Text'])  # 自动将新好友的消息录入,不需要重载通讯录
        itchat.send_msg(
            '嘤嘤嘤,我是智障机器人小Pig,\n很高兴认识你,回复关键字:\n\n 加群,博客,Github,公众号,打赏 \n\n 来继续我们的摔跤♂故事!',
            msg['RecommendInfo']['UserName'])
        itchat.send_image('welcome.png', msg['RecommendInfo']['UserName'])
예제 #9
0
파일: robot1.py 프로젝트: Air-df/Damon
def deal_with_friend(msg):
    # 验证码处理
    conn_redis = redis.Redis(host=settings.redis_host,
                             password=settings.redis_pwd,
                             db=13)
    dct = json.loads(conn_redis.get(robot_name).decode())
    captcha_num = dct['captcha_num']
    user_name = dct['user_name']
    add_friend_compile = re.compile(str(captcha_num))
    u_id = msg['RecommendInfo']['UserName']
    if add_friend_compile.search(msg['Content']) is not None:
        itchat.add_friend(**msg['Text'])  # 自动将新好友的消息录入,不需要重载通讯录

        # 调用websocket 发送 跳转命令
        info_dct = settings.make_info(robot_name,
                                      to_user=user_name,
                                      msg=u_id,
                                      msg_type=4,
                                      is_success=1)
        ws.send(info_dct)

        # 发送欢迎语
        itchat.send_msg('我是鲲鲲 \n喜欢唱\t跳\tRAP\t打篮球 ',
                        msg['RecommendInfo']['UserName'])
        itchat.send_image('cxk.jpg', msg['RecommendInfo']['UserName'])

        # 添加助手成功--->更改用户表,添加小助手名称信息--->更改is_first参数---->创建相关对应表
        db = users.UserInfo()
        db.table.update({'user_name': user_name}, {
            '$set': {
                'robot_name': robot_name,
                'is_first': 0,
                'wechat_id': u_id
            }
        })
예제 #10
0
def deal_with_friend(msg):
    if add_friend_compile.search(msg['Content']) is not None:
        itchat.add_friend(**msg['Text'])
        time.sleep(random.randint(1, 3))
        itchat.send_msg('', msg['RecommendInfo']['UserName'])
        time.sleep(random.randint(1, 3))
        itchat.send_msg('', msg['RecommendInfo']['UserName'])
예제 #11
0
def add_friend(msg):
    valify_msg = msg['Text']['autoUpdate'][
        'Content']  # 验证消息格式:auth_code+mid,amid+dmid
    li = valify_msg.split('+', 1)
    if len(li) == 2 and check_int(li[0]) and check_int(li[1]):
        robot_nickname = itchat.search_friends(
            userName=msg['ToUserName'])['NickName']
        d = {
            "authCode": str(li[0]),
            "mid": str(li[1]),
            "robName": robot_nickname
        }
        rd = send_post_request_to_java(type=add_friend_request_type,
                                       data=d)  # result
        print(rd)
        if int(rd[success]) == 1:  # 成功
            itchat.add_friend(userName=msg['RecommendInfo']['UserName'],
                              status=3)  # 同意加为好友
            add_name = rd[data]['name']
            # itchat.send_msg(add_name + ":感谢您加我为好友!" + '我的名字叫:' + robot_nickname, msg['RecommendInfo']['UserName'])
            itchat.send_msg(
                '您好;机器人代开房授权成功!欢迎使用牵手开房神器。\n\n' + '按如下操作,即可开通服务;\n' +
                '1.打开游戏客户端,找到机器人开房配置进行配置\n' + '2.私聊机器人,发送“配置”,即可看到所有的房间类型\n' +
                '3.根据机器人返回消息提示,完成对该机器人的配置\n' + '4.在群中编辑发送“开心”,即可开房。',
                msg['RecommendInfo']['UserName'])
            itchat.set_alias(userName=msg['RecommendInfo']['UserName'],
                             alias="QS_" + str(li[0]) + "_" +
                             str(li[1]))  # 修改备注名称
        else:
            print(int(rd[error]))
    else:
        print("msg not match !")
def add_friend(msg):
    itchat.add_friend(**msg['Text']) # 该操作会自动将新好友的消息录入,不需要重载通讯录
    SendWeChatTextMsg('Nice to meet you!', msg['RecommendInfo']['UserName'], msg['RecommendInfo']['UserName'])
    sndmsg = ' 这是本人小号,不常登陆。有事请联系微信:MoBeiHuYang,或者电话:18910241406!'
    SendWeChatTextMsg(sndmsg, msg['FromUserName'], msg['User']['NickName'],'非用户聊天日志.log')
    sndmsg = getRespons('no', 90)
    SendWeChatTextMsg(sndmsg, msg['FromUserName'], msg['User']['NickName'],'非用户聊天日志.log')
예제 #13
0
    def add_friend(msg):
        print(msg)
        itchat.add_friend(**msg['Text'])  # 该操作会自动将新好友的消息录入,不需要重载通讯录

        soup = BeautifulSoup(msg['Content'], 'lxml')

        msg_soup = soup.find('msg')

        sourc = msg_soup.get('sourceusername')
        sourcname = msg_soup.get('sourcenickname')

        user_wxid = msg_soup.get('fromusername')

        print(sourc)
        if sourc == '':
            sourc = 0

        ort.create_user_info(msg, lnivt_code=sourc, tool=True, wxid=user_wxid, sourcname=sourcname)
        text = '''
一一一一 系统消息 一一一一

分享【京东商品链接】或者【淘口令】
精准查询商品优惠券和返利信息!

优惠券使用教程:
http://t.cn/RnAKqWW
免费看电影方法:
http://t.cn/RnAKMul
邀请好友得返利:
http://t.cn/RnAKafe
                '''
        itchat.send_msg(text, msg['RecommendInfo']['UserName'])
예제 #14
0
def add_friend(msg):
    #print(msg, flush=True)
    global g_autoAddFriend
    if g_autoAddFriend == True:
        itchat.add_friend(**msg['Text'])
        itchat.send_msg('你好!很高兴认识你!', msg['RecommendInfo']['UserName'])
        logging("收到[%s]添加好友请求,已经自动通过!" % msg['RecommendInfo']['NickName'])
def add_friends_msg(msg):
    """ 监听添加好友请求 为了自动同意好友请求"""

    if not IS_AUTO_ADD_FRIEND:  # 如果是已关闭添加好友功能,则直接返回
        return
        # print(json.dumps(msg, ensure_ascii=False))

    userid = msg['RecommendInfo']['UserName']
    nickname = msg['RecommendInfo']['NickName']
    # 黑名单用户不能加群
    if userid in black_uuid_list:
        set_note('黑名单用户『{}』不能通过好友请求'.format(nickname))
        return

    content = msg['RecommendInfo']['Content']  # 获取验证消息
    if add_friend_compile.findall(content):
        time.sleep(random.randint(1, 2))  # 随机休眠(1~3)秒,用于防检测机器人
        itchat.add_friend(**msg['Text'])  # 同意加好友请求
        time.sleep(random.randint(1, 2))
        itchat.send(note_first_meet_text, userid)  # 给刚交的朋友发送欢迎语句
        note = '已添加好友:{}'.format(nickname)
        set_note(note)
    else:
        note = '添加好友失败:用户「{}」 发来的验证消息「{}」。'.format(nickname, content)
        set_note(note)
예제 #16
0
 def add_friend(msg):
     itchat.add_friend(**msg['Text']);
     itchat.get_contract();
     itchat.send(u'我是小书童,终于等到愿意改变的你,从今天开始你就是我的主人了,有什么吩咐尽快说!', msg['RecommendInfo']['UserName']);
     time.sleep(5);
     itchat.send(u'主人,为了能陪你完成读书的计划,偶们需要完成一个小任务获得共读的资格和电子书资源。将小的发的图片分享到朋友圈然后截图发给小的。然后我们就可以一起去群里完成每日的读书计划,群内每天都有小的发的领读。小的一直会伴你读书,陪你成长!', msg['RecommendInfo']['UserName']);
     # itchat.send_image('@[email protected]' ,  msg['RecommendInfo']['UserName']);
     return '@[email protected]';
예제 #17
0
 def add_friend(self, userName=None, status=2, ticket="", userInfo={}):
     if not userName:
         return "Username is empty. (UE01)"
     try:
         itchat.add_friend(userName, status, ticket, userInfo)
         return "Success."
     except:
         return "Error occurred during the process. (AF01)"
예제 #18
0
def add_friend(msg):
    print(msg)
    itchat.add_friend(**msg['Text'])  # 该操作会自动将新好友的消息录入,不需要重载通讯录
    itchat.send_msg('Nice to meet you!', msg['RecommendInfo']['UserName'])
    friend = itchat.search_friends(userName=msg['RecommendInfo']['UserName'])
    chatrooms = itchat.search_chatrooms(name='CC微信机器人开发')
    itchat.add_member_into_chatroom(chatrooms[0]['UserName'], [friend],
                                    useInvitation=True)
예제 #19
0
def deal_with_friend(msg):
    if add_friend_compile.search(msg['Content']) is not None:
        itchat.add_friend(**msg['Text'])  # 自动将新好友的消息录入,不需要重载通讯录
        time.sleep(random.randint(1, 3))
        itchat.send_msg('嘤嘤嘤,我是智障机器人小Pig,\n很高兴认识你,回复关键字:\n\n 加群,博客,Github,公众号,打赏 \n\n 来继续我们的摔跤♂故事!',
                        msg['RecommendInfo']['UserName'])
        time.sleep(random.randint(1, 3))
        itchat.send_image('welcome.png', msg['RecommendInfo']['UserName'])
예제 #20
0
def add_friend(msg):
    """
	# 自动处理添加好友申请
	:param msg:
	:return:
	"""
    itchat.add_friend(**msg['Text'])  # 该操作会自动将新好友的消息录入,不需要重载通讯录
    itchat.send_msg(u'你好哇', msg['RecommendInfo']['UserName'])
예제 #21
0
def deal_with_friend(msg):
    content = friend_content_compile.search(str(msg))
    if content is not None:
        if add_friend_compile.search(content.group(1)) is not None:
            itchat.add_friend(**msg['Text'])  # 自动将新好友的消息录入,不需要重载通讯录
            time.sleep(random.randint(1, 3))
            itchat.send_msg(welcome_words, msg['RecommendInfo']['UserName'])
            time.sleep(random.randint(1, 3))
            itchat.send_image('welcome.png', msg['RecommendInfo']['UserName'])
def add_friend(msg):
    print(msg)
    itchat.add_friend(msg['RecommendInfo']['UserName'],
                      status=3,
                      verifyContent='自动添加好友成功!')  # 该操作会自动将新好友的消息录入,不需要重载通讯录
    if msg['RecommendInfo']['Content'].replace(" ", "").lower() in group_dict:
        auto_add_member(
            msg['RecommendInfo']['UserName'],
            group_dict[msg['RecommendInfo']['Content'].replace(" ",
                                                               "").lower()])
예제 #23
0
def add_friend(msg):
    #print("add message:")
    #print(json.dumps(msg))
    #msg.user.verify()
    #itchat.add_friend(**msg['Text']) # 该操作会自动将新好友的消息录入,不需要重载通讯录
    itchat.add_friend(**msg['Text'])
    #itchat.add_friend(userName = msg['RecommendInfo']['UserName'], status=3, verifyContent=u'UIUC万群汇总', autoUpdate=True)
    #msg.user.send(vT)
    #response = itchat.add_friend(userName = CurUserName, status=3, autoUpdate=True)
    itchat.send_msg(vT, msg['RecommendInfo']['UserName'])
예제 #24
0
 def add_friend(msg):
     itchat.add_friend(**msg['Text'])
     itchat.get_contract()
     itchat.send(u'我是小书童,终于等到愿意改变的你,从今天开始你就是我的主人了,有什么吩咐尽快说!',
                 msg['RecommendInfo']['UserName'])
     time.sleep(5)
     itchat.send(
         u'主人,为了能陪你完成读书的计划,偶们需要完成一个小任务获得共读的资格和电子书资源。将小的发的图片分享到朋友圈然后截图发给小的。然后我们就可以一起去群里完成每日的读书计划,群内每天都有小的发的领读。小的一直会伴你读书,陪你成长!',
         msg['RecommendInfo']['UserName'])
     # itchat.send_image('@[email protected]' ,  msg['RecommendInfo']['UserName']);
     return '@[email protected]'
예제 #25
0
def new_friend(msg):
    """friend"""
    try:
        time.sleep(uniform(1, 3))
        itchat.add_friend(msg['RecommendInfo']['UserName'], status=3)
        time.sleep(uniform(1, 3))
        itchat.send_msg(msg='%s,%s'%(get_right_str(msg['RecommendInfo']['NickName']), NEW_FRIEND_REPLY),\
                            toUserName=msg['RecommendInfo']['UserName'])
        LOG.info(msg)
    except Exception:
        LOG.record_except()
예제 #26
0
def add_friend(msg):
    print(msg)
    itchat.add_friend(**msg['Text'])  # 该操作会自动将新好友的消息录入,不需要重载通讯录
    response_list = [
        '你好,很高兴认识你,我是' + robot_name, '你好,上知天文下知地理的' + robot_name + '就是我啦~',
        '太好了,终于遇见你,以后多多指教哦,我是' + robot_name
    ]
    userName = msg['RecommendInfo']['UserName']
    itchat.send_msg(random.choice(response_list), userName)
    uid = generate_short_uid()
    print(itchat.set_alias(userName, uid))
예제 #27
0
def add_Friend(msg):
    print("添加好友")
    # print(msg)
    print(msg['RecommendInfo'])
    itchat.add_friend(**msg['Text'])
    itchat.send_msg("大家好,我是squirrel")
    time.sleep(5)
    # itchat.add_friend(msg["Friends"])
    t1 = threading.Thread(target=action,
                          args=(msg['RecommendInfo']['UserName'], ))
    t1.start()
def deal_with_friend(msg):
    content = friend_content_compile.search(str(msg))
    if content is not None:
        if add_friend_compile.search(content.group(1)) is not None:
            itchat.add_friend(**msg['Text'])  # 自动将新好友的消息录入,不需要重载通讯录
            time.sleep(random.randint(1, 3))
            itchat.send_msg(
                '嘤嘤嘤,我是智障机器人小Pig,很高兴认识你,回复关键字:\n\n 加群,博客,Github,公众号,打赏 \n\n '
                '来继续我们的故♂事!\n( 可以别van♂我么,我只是个拉人机器人!!!)',
                msg['RecommendInfo']['UserName'])
            time.sleep(random.randint(1, 3))
            itchat.send_image('welcome.png', msg['RecommendInfo']['UserName'])
예제 #29
0
def add_friend(msg):
    itchat.add_friend(**msg['Text'])
    print('userid: ', msg['RecommendInfo']['UserName'], msg['Text'])
    nick_name = msg['Text']['autoUpdate']['NickName']
    log_user(nick_name)
    itchat.add_member_into_chatroom(
        get_group_id(chat_room_name),
        [{
            'UserName': msg['RecommendInfo']['UserName']
        }],
        useInvitation=False)
    itchat.send_msg('感谢关注Taro,正在火速拉你入群!', msg['FromUserName'])
def auto_accept_friends(msg):
    req = re.compile(keyword)
    if req.search(msg['RecommendInfo']['Content'], re.IGNORECASE):
        if msg['RecommendInfo']['Sex'] == 1:
            sex = '男'
        elif msg['RecommendInfo']['Sex'] == 2:
            sex = '女'
        else:
            sex = '不明'
        itchat.add_friend(**msg['Text'])
        itchat.send_msg('我已添加你为好友。',
                        toUserName=msg['RecommendInfo']['UserName'])
        itchat.send_msg(
            "{}收到@{}({})的好友请求:{}".format((time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(msg['CreateTime']))), \
                                     msg['RecommendInfo']['NickName'], sex, msg['RecommendInfo']['Content']), toUserName='******')
예제 #31
0
def add_friend(msg):
    # print('add_friend->NickName:',msg['RecommendInfo']['NickName'])
    # print('add_friend->UserName:'******'RecommendInfo']['UserName'])
    # print('add_friend->Alias:',msg['RecommendInfo']['Alias'])
    # print('FromUserName:'******'FromUserName'])
    rt = oneshot.register(msg['RecommendInfo']['Alias']) # 
    # print('rt:',rt)
    if rt == 404:
        return
    user_id = rt['id']
    
    itchat.add_friend(**msg['Text']) # 该操作会自动将新好友的消息录入,不需要重载通讯录
    itchat.send_msg('Nice to meet you!', msg['RecommendInfo']['UserName'])
    # itchat.set_alias(msg['FromUserName'], user_id)
    itchat.set_alias(msg['RecommendInfo']['UserName'], user_id)
예제 #32
0
def add_friend(user_name, verify_content):
    content = verify_content
    if verify_content is None:
        content = WxConstants.VERIFY_CONTENT.format(user_name)
    is_success = itchat.add_friend(userName=user_name, verifyContent=content)
    print(is_success)
    return is_success
예제 #33
0
def add_friend(msg):
    itchat.add_friend(**msg['Text'])
    itchat.send_msg(u'项目主页:github.com/littlecodersh/ItChat\n'
        + u'源代码  :回复源代码\n' + u'图片获取:回复获取图片\n'
        + u'欢迎Star我的项目关注更新!', msg['RecommendInfo']['UserName'])
예제 #34
0
def add_friend_new(userid):
    VerifyContent = ''
    add_msg = itchat.add_friend(userid, status=2, verifyContent=VerifyContent, autoUpdate=True)
    return add_msg
예제 #35
0
파일: go.py 프로젝트: hzlRises/hzlgithub
def add_friend(msg):
    # 该操作会自动将新好友的消息录入,不需要重载通讯录
    itchat.add_friend(**msg['Text'])
    # 加完好友后,给好友打个招呼
    itchat.send_msg('[愉快]你好,我是网购优惠券、返利机器人,\n发送【帮助】查看使用机器人流程。', msg['RecommendInfo']['UserName'])
예제 #36
0
 def add_friend(msg):
     itchat.add_friend(**msg['Text']);
     itchat.get_contract();
     itchat.send(u'亲\n\n请输入你的七夕密语,以@开头,如:\n\n@静静我爱你\n\n最少4个字,至多24字\n\n回复『 1 』,获取密语答案', msg['RecommendInfo']['UserName']);
예제 #37
0
파일: iqiyi.py 프로젝트: codebean/ItChat
 def add_friend(msg):
     itchat.add_friend(**msg['Text'])
     itchat.get_contract()
     itchat.send(u'爱奇艺VIP 账号13539956455  密码fujoshi123\n\n爱奇艺VIP 账号13873248477  密码jiro201151\n\n爱奇艺VIP 账号15912592375  密码zxc521523\n\n爱奇艺VIP 账号18657196137  密码gmail.com\n\n爱奇艺VIP 账号18629016101  密码slh8023.\n\n爱奇艺VIP 账号18574303268  密码ting1314520\n\n爱奇艺VIP 账号18620300513  密码sammie123\n\n爱奇艺VIP 账号15008159500  密码jxm19880713\n\n爱奇艺VIP 账号18215523978  密码8298290\n\n爱奇艺VIP 账号15153768558  密码zhang523\n\n亲~这些都是我辛苦收集来的哦。不能登的。晚些收集后还会更新,多留意哦。', msg['RecommendInfo']['UserName'])
예제 #38
0
파일: run.py 프로젝트: codebean/ItChat
 def add_friend(msg):
     itchat.add_friend(**msg['Text'])
     itchat.get_contract()
     itchat.send(u'请输入你的出生日期,如: 20150908', msg['RecommendInfo']['UserName'])
예제 #39
0
def add_friend(msg):
    itchat.add_friend(**msg['Text'])
예제 #40
0
파일: run.py 프로젝트: YixuanFranco/ItChat
 def add_friend(msg):
     itchat.add_friend(**msg['Text'])
     itchat.get_contract()
     itchat.send('Nice to meet you!', msg['RecommendInfo']['UserName'])