ehForwarderBot / efb-qq-slave

EFB QQ Slave, a channel for EH Forwarder Bot. EFB QQ从端
GNU General Public License v3.0
448 stars 48 forks source link

发送消息时报错UnboundLocalError: local variable 'f' referenced before assignment #103

Closed HoiGe closed 2 years ago

HoiGe commented 2 years ago

报错信息

2022-01-23 14:24:50,856 [ERROR]: efb_telegram_master.master_message (master_message.process_telegram_message; master_message.py:410)
    Message is not sent. (update: {'update_id': 152763631, 'message': {'group_chat_created': False, 'message_id': 34620, 'channel_chat_created': False, 'chat': {'id': -761126414, 'title': '测试', 'type': 'group', 'all_members_are_administrators': True}, 'supergroup_chat_created': False, 'text': 'Test', 'photo': [], 'caption_entities': [], 'new_chat_members': [], 'delete_chat_photo': False, 'date': 1642919090, 'entities': [], 'new_chat_photo': [], 'from': {'id': 165521317, 'last_name': 'Peg', 'is_bot': False, 'first_name': 'Hon', 'username': 'HonPigeon', 'language_code': 'zh-hans'}}}, exception: local variable 'f' referenced before assignment)
Traceback (most recent call last):
  File "/usr/local/python3/lib/python3.9/site-packages/efb_telegram_master/master_message.py", line 393, in process_telegram_message
    slave_msg = coordinator.send_message(m)
  File "/usr/local/python3/lib/python3.9/site-packages/ehforwarderbot/coordinator.py", line 113, in send_message
    return slaves[msg.deliver_to.channel_id].send_message(msg)
  File "/usr/local/python3/lib/python3.9/site-packages/efb_qq_slave/__init__.py", line 80, in send_message
    return self.QQClient.send_message(msg)
  File "/usr/local/python3/lib/python3.9/site-packages/efb_qq_plugin_mirai/mirai.py", line 218, in send_message
    if f:
UnboundLocalError: local variable 'f' referenced before assignmen

在发送任意文字/图片时 ehforwarderbot端报错如上

TG端报错

Message is not sent.

UnboundLocalError("local variable 'f' referenced before assignment")

但实际消息已经发送成功

补充:

milkice233 commented 2 years ago

刚修,pip3 install -U https://github.com/ehForwarderBot/efb-qq-plugin-mirai