Quan666 / ELF_RSS

QQ机器人 RSS订阅 插件,订阅源建议选择 RSSHub
https://myelf.club/archives/221
GNU General Public License v3.0
539 stars 53 forks source link

AttributeError: 'ELFConfig' object has no attribute 'debug' #413

Closed fkcptlst closed 1 year ago

fkcptlst commented 1 year ago

ELF_RSS 、 go-cqhttp 、 nonebot 、 Python 版本及操作系统

ELF_RSS:2.6.17,其它的版本都不重要

列出安装的 Python 包

No response

如何复现

直接通过nbcli运行就行。

如何fix:

其实就是在ELFConfig类中添加一个debug:bool = False就行了。如果没有设置rsshub_backup(按照文档中,RSSHUB_BACKUP是被注释掉的),if就会检查后面那个,然后就会报错。

期望行为

不会报错

实际行为

> File "/home/lcf/miniconda3/envs/none_bot_env/lib/python3.10/site-packages/nonebot/message.py", line 187, in _run_matcher
    await matcher.run(bot, event, state, stack, dependency_cache)
  File "/home/lcf/miniconda3/envs/none_bot_env/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 732, in run
    await self.simple_run(bot, event, state, stack, dependency_cache)
  File "/home/lcf/miniconda3/envs/none_bot_env/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 707, in simple_run
    await handler(
  File "/home/lcf/miniconda3/envs/none_bot_env/lib/python3.10/site-packages/nonebot/dependencies/__init__.py", line 108, in __call__
    return await cast(Callable[..., Awaitable[R]], self.call)(**values)
  File "/home/lcf/miniconda3/envs/none_bot_env/lib/python3.10/site-packages/ELF_RSS2/__init__.py", line 54, in start
    await asyncio.gather(*[tr.add_job(rss) for rss in rss_list if not rss.stop])
  File "/home/lcf/miniconda3/envs/none_bot_env/lib/python3.10/site-packages/ELF_RSS2/my_trigger.py", line 39, in add_job
    await check_update(rss)
  File "/home/lcf/miniconda3/envs/none_bot_env/lib/python3.10/site-packages/ELF_RSS2/my_trigger.py", line 23, in check_update
    await asyncio.wait_for(rss_parsing.start(rss), timeout=wait_for)
  File "/home/lcf/miniconda3/envs/none_bot_env/lib/python3.10/asyncio/tasks.py", line 445, in wait_for
    return fut.result()
  File "/home/lcf/miniconda3/envs/none_bot_env/lib/python3.10/site-packages/ELF_RSS2/rss_parsing.py", line 82, in start
    new_rss, cached = await fetch_rss(rss)
  File "/home/lcf/miniconda3/envs/none_bot_env/lib/python3.10/site-packages/ELF_RSS2/rss_parsing.py", line 163, in fetch_rss
    if not config.rsshub_backup and not config.debug:
AttributeError: 'ELFConfig' object has no attribute 'debug'

其实就是在ELFConfig类中添加一个debug:bool = False就行了。如果没有设置rsshub_backup(按照文档中,RSSHUB_BACKUP是被注释掉的),if就会检查后面那个,然后就会报错。