wxpy
wxpy copied to clipboard
发送消息失败
如图所示 为什么发送消息的代码会报错呢? 我是python小白。
my_friends = bot.search().search('Shi',sex=MALE,)
my_friends.send("hi")
Traceback (most recent call last):
File "C:/Users/Dell/PycharmProjects/WBot/venv/WBot_test.py", line 12, in
bot.friends()返回的是一个数组,.search返回的是一个数组,所以需要取下标,你的代码也写错了
my_friends = bot.friends().search('Shi',sex=MALE)[0]
my_friends.send("hi")