File "/home/patchy/zhenxun_bot-0.1.6.7/plugins/statistics/statistics_handle.py", line 166, in _
name = name.group_name if group else str(event.group_id)
UnboundLocalError: local variable 'name' referenced before assignment
定位到 statistics_handle.py 第166行
//....
day_index = data["day_index"]
data = data[arg][key]
if _type == "group":
group = await GroupInfo.filter(group_id=event.group_id).first()
>>> name = name.group_name if group else str(event.group_id) <<<
else:
name = event.sender.card or event.sender.nickname
img = await generate_statistics_img(data, arg, name, plugin, day_index)
await statistics.send(image(b64=img))
在群内使用 功能调用统计 时,出现报错:
定位到
statistics_handle.py
第166行变量声明位置有些问题。
超级用户单独调用全局统计的话是没有问题的。