zhujunsheng
# encoding=utf-8
from wxpy import *
bot = Bot(cache_path=True, console_qr=False)
# 启用 puid 属性,并指定 puid 所需的映射数据保存/载入路径
mymine = bot.friends().search(\'小号\')[0]
mymine.send(\'开始\')
myfriend= bot.friends().search(\'徐谦\')[0]
xinxi = \'\'
xinxi2 = \'\'
@bot.register(mymine, TEXT)
def print_msg1(msg1):
global xinxi
print(msg1)#打印小号的信息
#xinxi.append(msg1.text)
#xinxi = msg1.text#变量赋值
myfriend.send(msg1.text)#给朋友发送小号的信息
@bot.register(myfriend, TEXT)
def print_msg2(msg2):
global xinxi2
print(msg2)#打印朋友回复的信息
xinxi2 = msg2.text #把朋友的信息赋值给xinxi2变量
#myfriend.send(msg2.text)发送对方的信息给对方
mymine.send(xinxi2)#给我的小号发送变量xinxi2
@bot.register(Group, TEXT)
def print_msg(msg3):
print(msg3)
bot.join()

分类:

技术点:

相关文章:

  • 2022-02-10
  • 2021-12-15
  • 2022-03-09
  • 2022-02-05
  • 2021-07-09
  • 2021-11-15
  • 2021-08-04
  • 2021-06-21
猜你喜欢
  • 2021-06-10
  • 2022-12-23
  • 2022-01-14
  • 2021-06-07
  • 2022-01-07
  • 2021-12-15
  • 2022-01-02
相关资源
相似解决方案