* [新增] 转发消息,目前支持 7 种消息类型 `Message.forward()` ([文档](http://wxpy.readthedocs.io/zh/latest/messages.htmlwxpy.Message.forward))
例如,将公司群中的老板消息转发出来
python
from wxpy import *
bot = Bot()
定位公司群
company_group = ensure_one(bot.groups().search('公司微信群'))
定位老板
boss = ensure_one(company_group.search('老板大名'))
将老板的消息转发到文件传输助手
bot.register(company_group)
def forward_boss_message(msg):
if msg.member == boss:
msg.forward(bot.file_helper, prefix='老板发言')
堵塞线程
embed()
* [新增] 在多个群中同步消息 `sync_message_in_groups()` ([文档](http://wxpy.readthedocs.io/zh/latest/utils.htmlwxpy.sync_message_in_groups))
python
my_groups = [group1, group2, group3 ...]
bot.register(my_groups, except_self=False)
def sync_my_groups(msg):
sync_message_in_groups(msg, my_groups)
* [新增] 上传文件并获得 media_id,可用于重复发送 `Bot.upload_file()` ([文档](http://wxpy.readthedocs.io/zh/latest/bot.htmlwxpy.Bot.upload_file))
* [新增] 堵塞进程,直到结束消息监听 (例如,机器人被登出时) `Bot.join()` ([文档](http://wxpy.readthedocs.io/zh/latest/bot.htmlwxpy.Bot.join))
* [新增] 群聊中的机器人自身(作为群成员) `Group.self`
* [修复] 群消息中,当发送者为机器人自身时,msg.member 为 None 的问题