#!/usr/bin/env python3
import itchat
from itchat.content import TEXT

@itchat.msg_register(TEXT, isGroupChat=False)
def text_reply(msg):
    print(msg)
    if 'IFE' in msg['Text']:
      friend = itchat.search_friends(userName=msg['FromUserName'])
      print(friend)
      itchat.get_chatrooms(update=True)
      chatroom = itchat.search_chatrooms('2017IFE抱团群')[0]
      print(chatroom)
      r = itchat.add_member_into_chatroom(chatroom['UserName'], [friend])
      if r['BaseResponse']['ErrMsg'] == '':
        itchat.send(('自动邀请成功！'), msg['FromUserName'])

itchat.auto_login(enableCmdQR=True,hotReload=True)
itchat.run()

@@ -63,16 +63,56 @@
 t TEXT%0A%0A
+CHAT_ROOM = '2017IFE%E6%8A%B1%E5%9B%A2%E7%BE%A4'%0ATOKEN = 'IFE'%0A%0A
 @itchat.
@@ -192,21 +192,21 @@
 %0A    if 
-'IFE'
+TOKEN
  in msg%5B
@@ -382,28 +382,25 @@
 atrooms(
-'2017IFE%E6%8A%B1%E5%9B%A2%E7%BE%A4'
+CHAT_ROOM
 )%5B0%5D%0A   

Update auto-invite.py