# coding: utf-8 from __future__ import unicode_literals from wxpy import * from wechat_sender import listen bot = Bot('bot.pkl') listen(bot)
# coding: utf-8 # pip install wechat_sender from __future__ import unicode_literals from wxpy import * from wechat_sender import listen bot = Bot('bot.pkl') my_friend_list = bot.friends().search('黄英兰') print(my_friend_list) #my_friend = bot.friends().search('yinglanhuang')[0] my_friend = my_friend_list[0] my_friend.send('我爱你') @bot.register(Friend) def reply_test(msg): msg.reply('test') listen(bot) # 只需改变最后一行代码
#print(msg.text) #msg.reply('you are so handsome!') res = response.OnlyForSmaug(msg) #dict if res['type'] == 'Text': msg.reply_msg(res['res']) elif res['type'] == 'tuling': tuling.do_reply(msg) @mybot.register(MissYang) def onlyformissyang(msg): #print(msg.text) #msg.reply('you are so handsome!') res = response.OnlyForMissYang(msg) #dict if res['type'] == 'Text': msg.reply_msg(res['res']) elif res['type'] == 'tuling': tuling.do_reply(msg) if __name__ == '__main__': recvers = [] friend = search_friend(mybot, '林夕水共') recvers.append(friend) listen(mybot, receivers=recvers, token='daqiaoweijiu', port=6969, status_report=True, status_interval=30 * 60 * 1000)
fff = [] for friend in my: fff.append(str(friend).strip('>').split(': ')[1]) #fff=fff.remove('Sigma小助手') del fff[0] sss = ",".join('%s' % id for id in fff) f = open("friends.txt", 'a') f.write(sss) f.close() ''' my1 = bot.friends().search('吴震')[0] my2 = bot.friends().search('吴明')[0] my3 = bot.friends().search('朱依心')[0] ''' @bot.register(Friend) def reply_test(msg): msg.reply('欢迎关注,更多内容请关注公众号--SQuant') @bot.register(msg_types=FRIENDS) def auto_accept_friends(msg): if 'sigma' in msg.text.lower(): new_friend = bot.accept_friend(msg.card) new_friend.send('sigma小助手为您服务') listen(bot, receivers=my, port=10015)
# coding: utf-8 # pip install wechat_sender from __future__ import unicode_literals from wxpy import * from wechat_sender import listen bot = Bot('bot.pkl') my_friend_list = bot.friends().search('黄英兰') print( my_friend_list) #my_friend = bot.friends().search('yinglanhuang')[0] my_friend = my_friend_list[0] my_friend.send('我爱你') @bot.register(Friend) def reply_test(msg): msg.reply('test') listen(bot) # 只需改变最后一行代码
# coding: utf-8 from __future__ import unicode_literals from wxpy import * from wechat_sender import listen bot = Bot(cache_path=True) receivers = [] receivers.append(bot.file_helper) receivers.append(bot.friends().search('拉卡拉')[0]) receivers.append(ensure_one(bot.friends().search('李静', city='西安'))) #有可能搜索出多个结果 receivers.append(bot.friends().search('证明给他看')[0]) receivers.append(bot.friends().search('妈')[0]) print(receivers) listen(bot, receivers=receivers, token='weather_report_123456789') #关键一步
# coding: utf-8 from __future__ import unicode_literals from wxpy import * from wechat_sender import listen bot = Bot('bot.pkl') receivers = [] receivers.append(bot.file_helper) print(receivers) listen(bot, receivers=receivers)
from __future__ import unicode_literals from wxpy import * from wechat_sender import listen bot = Bot() my = bot.friends() ''' my1 = bot.friends().search('吴震')[0] my2 = bot.friends().search('吴明')[0] my3 = bot.friends().search('朱依心')[0] ''' @bot.register(Friend) def reply_test(msg): msg.reply('欢迎关注,更多内容请关注公众号--SQuant') @bot.register(msg_types=FRIENDS) def auto_accept_friends(msg): if 'sigma' in msg.text.lower(): new_friend = bot.accept_friend(msg.card) new_friend.send('sigma小助手为您服务') listen(bot, receivers=my, port=10111)
from __future__ import unicode_literals from wxpy import * from wechat_sender import listen bot = Bot(console_qr=True, cache_path=True) my1 = bot.friends().search('吴震')[0] listen(bot, receivers=my1, port=10003)