-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] matcher插件部分logger.info(event)报错 #31
Comments
额外测试 这个错误是由于 错误原因分析
|
猜测靠谱的原因 在Python类的继承中,若出现AttributeError: 'ChatEvent' object has no attribute '_ChatEvent__nbevent'错误,通常是由于子类访问父类私有属性时的命名规范冲突导致的。以下是结合用户代码的详细分析及解决方案: 一、问题定位
在父类SuggarEvent中,self.__nbevent实际存储为_SuggarEvent__nbevent。 |
报错解决 二、解决方案
python
|
好 |
Python 版本
3.11.2
SuggarChat 版本
1.3.1
发生了什么?
从代码片段看,logger.info()的方法签名是info(__message, *args, **kwargs),即第一个参数必须是字符串格式的日志模板,后续参数用于填充模板中的占位符。如果直接传入event对象,且未定义__message的格式化逻辑,可能导致类型不兼容或参数解析异常
。
如何复现
将README中demo放入自定义插件
期望的结果?
demo例程,规范调用logger
SuggarChat 运行日志
The text was updated successfully, but these errors were encountered: