CMHopeSunshine / nonebot-plugin-learning-chat

Nonebot2插件,让Bot学习群友的发言和表情包。/ Nonebot2 plugin to learn what your group members say.
GNU Affero General Public License v3.0
166 stars 6 forks source link

Bug: 日志未转义 #45

Closed laiyoi closed 1 year ago

laiyoi commented 1 year ago
07-17 23:24:19 [ERROR] nonebot | Rule check failed for Matcher(type='message', module=nonebot_plugin_learning_chat).
Traceback (most recent call last):
  File "E:\anaconda\envs\nb\lib\site-packages\nonebot\message.py", line 457, in check_and_run_matcher
    if not await _check_matcher(
> File "E:\anaconda\envs\nb\lib\site-packages\nonebot\message.py", line 363, in _check_matcher
    ) or not await Matcher.check_rule(bot, event, state, stack, dependency_cache):
  File "E:\anaconda\envs\nb\lib\site-packages\nonebot\internal\matcher\matcher.py", line 303, in check_rule
    return event_type == (cls.type or event_type) and await cls.rule(
  File "E:\anaconda\envs\nb\lib\site-packages\nonebot\internal\rule.py", line 73, in __call__
    results = await asyncio.gather(
  File "E:\anaconda\envs\nb\lib\site-packages\nonebot\dependencies\__init__.py", line 108, in __call__
    return await cast(Callable[..., Awaitable[R]], self.call)(**values)
  File "E:\anaconda\envs\nb\lib\site-packages\nonebot_plugin_learning_chat\__init__.py", line 33, in ChatRule
    if answers := await LearningChat(event).answer():
  File "E:\anaconda\envs\nb\lib\site-packages\nonebot_plugin_learning_chat\handler.py", line 176, in answer
    result = await self._learn()
  File "E:\anaconda\envs\nb\lib\site-packages\nonebot_plugin_learning_chat\handler.py", line 168, in _learn
    await self._set_answer(messages[0])
  File "E:\anaconda\envs\nb\lib\site-packages\nonebot_plugin_learning_chat\handler.py", line 651, in _set_answer
    log_debug(
  File "E:\anaconda\envs\nb\lib\site-packages\nonebot_plugin_learning_chat\config.py", line 111, in log_debug
    logger.opt(colors=True).debug(f"<u><y>[{command}]</y></u>{info}")
  File "E:\anaconda\envs\nb\lib\site-packages\loguru\_colorizer.py", line 369, in prepare_simple_message
    parser.feed(string)
  File "E:\anaconda\envs\nb\lib\site-packages\loguru\_colorizer.py", line 253, in feed
    raise ValueError(
ValueError: Tag "<&#91;width&#93;x&#91;height&#93;>" does not correspond to any known ansi directive, make sure you did not misspelled it (or prepend '\' to escape it)

本来好好的,安了一个别的插件突然就这样了,把环境删了重安回来也不行

CMHopeSunshine commented 1 year ago

9077b8f6643e0e42112df8f95335764e54d06400 已修复,更新至0.3.0版本

laiyoi commented 1 year ago

这个</m>出现在日志里面是否有一些不符合预期

07-18 01:06:28 [DEBUG] nonebot_plugin_learning_chat | [群聊学习]➤将被学习为<m>应该修好了</m>的回答,已学次数为<m>1</m>
CMHopeSunshine commented 1 year ago

雀食..但是无关紧要,下次再一起修了

laiyoi commented 1 year ago

现在去掉转义的函数把代码改回去又能用了