selfteaching / selfteaching-python-camp

147 stars 881 forks source link

Day12 定义my_friend的地方如何将他设置为没有任何限制,只要是发信息的就可以调用后续函数? #3188

Open nolitaann opened 5 years ago

nolitaann commented 5 years ago

from wxpy import * import requests from pyquery import PyQuery import stats_word

bot = Bot() my_friend=bot.friends().search("欣", keywords=None, **attributes)# 这一步我不想做任何限定,只要是好友给我发信息可以么? @bot.register(my_firend,SHARING) def my_friend_sharing(msg): msg=msg.url r = requests.get(msg) document=PyQuery(r.text) content = document('#js_content').text() a=stats_word.stats_text(content,100) b=str(a) my_friend.send(b)

embed()

srvz commented 5 years ago

my_friend = bot.friends() 就行