Created
March 16, 2019 05:58
-
-
Save wwj718/8377a278193a04aa54b727892e378304 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itchat, time | |
from itchat.content import TEXT | |
@itchat.msg_register([TEXT]) | |
def text_reply(msg): | |
# 不会接受群消息 | |
# msg.user.send('%s: %s' % (msg.type, msg.text)) | |
# author = itchat.search_friends(nickName='Finn')[0] | |
# author.send('hi ,我正通过codelab的Scratch界面与你聊天!') | |
content = msg.text | |
user = msg.user["NickName"] | |
# from IPython import embed;embed() | |
@itchat.msg_register(TEXT, isGroupChat=True) | |
def group_text_reply(msg): | |
from IPython import embed;embed() | |
if msg.isAt: | |
msg.user.send(u'@%s\u2005I received: %s' % ( | |
msg.actualNickName, msg.text)) | |
itchat.auto_login() | |
itchat.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment