Code Monkey home page Code Monkey logo

nonebot-plugin-pixivbot's Introduction

nonebot

nonebot_plugin_pixivbot

✨ PixivBot ✨

license pypi python

NoneBot插件,支持发送随机Pixiv插画、画师更新推送、定时订阅推送……

触发语句

普通语句

所有数字参数均支持中文数字和罗马数字。

  • 看看<类型>榜<范围>:查看pixiv榜单(<类型>可省略,<范围>应为a-b或a)
    • 示例:看看榜、看看日榜、看看榜1-5、看看月榜一
  • 来<数量>张图:从推荐插画随机抽选一张插画(<数量>可省略,下同)
    • 示例:来张图、来五张图
  • 来<数量>张<关键字>图:搜索关键字,从搜索结果随机抽选一张插画
    • 示例:来张初音ミク图、来五张初音ミク图
    • 注:默认开启关键字翻译功能。Bot会在平时的数据爬取时记录各个Tag的中文翻译。在搜索时,若关键字的日文翻译存在,则使用日文翻译代替关键字进行搜索。
  • 来<数量>张<用户>老师的图:搜索用户,从插画列表中随机抽选一张插画
    • 示例:来张Rella老师的图、来五张Rella老师的图
  • 看看图<插画ID>:查看ID对应的插画
    • 示例:看看图114514
  • 来<数量>张私家车:从书签中随机抽选一张插画(发送者需绑定Pixiv账号,或者在配置中指定默认Pixiv账号)
    • 示例:来张私家车、来五张私家车
  • 还要:重复上一次请求
  • 不够色:获取上一张插画的相关插画

命令语句

  • /pixivbot schedule <type> <schedule> [..args]:为本群(本用户)订阅类型为的定时推送功能,时间满足时进行推送
    • <type>:可选值有ranking, random_bookmark, random_recommended_illust, random_illust, random_user_illust
    • <schedule>:格式为HH:mm(每日固定时间点推送)或HH:mm*x(间隔时间推送),或者使用cron表达式
    • [..args]:
      • <type>为ranking时,接受mode、range
        • 示例:/pixivbot schedle ranking 12:00 --mode day --range 1-10
      • <type>为random_bookmark时,接受user
        • 示例:/pixivbot schedle random_bookmark 01:00*x
        • 示例:/pixivbot schedle random_bookmark 01:00*x --user 114514
      • <type>为random_illust时,接受word(必需)
        • 示例:/pixivbot schedle random_illust "0 */2 * * * *" --word ロリ
        • 示例:/pixivbot schedle random_illust "0 */2 * * * *" --word "Hatsune Miku"
      • <type>为random_user_illust时,接受user(必需)
        • 示例:/pixivbot schedle random_user_illust 01:00*x --user 森倉円
      • <type>为random_recommend_illust时,不接受参数
  • /pixivbot schedule:查看本群(本用户)的所有定时推送订阅
  • /pixivbot unschedule <id>:取消本群(本用户)的指定的定时推送订阅
  • /pixivbot watch <type> [..args]:为本群(本用户)订阅类型为的更新推送功能
    • <type>:可选值有user_illusts, following_illusts
    • [..args]:
      • <type>为user_illusts时,接受user(必需)
        • 示例:/pixivbot watch user_illusts --user 森倉円
      • <type>为following_illusts时,接受user
        • 示例:/pixivbot watch following_illusts
        • 示例:/pixivbot watch following_illusts --user 114514
  • /pixivbot watch:查看本群(本用户)的所有更新推送订阅
  • /pixivbot watch fetch <id>:【调试用命令】立刻手动触发一次指定的更新推送订阅
  • /pixivbot unwatch <id> [..args]:取消本群(本用户)的指定的更新推送订阅
  • /pixivbot bind <pixiv_user_id>:绑定Pixiv账号(用于随机书签功能)
  • /pixivbot unbind:解绑Pixiv账号
  • /pixivbot invalidate_cache:清除缓存(只有超级用户能够发送此命令)
  • /pixivbot/pixivbot help:查看帮助

环境配置

事前准备:登录pixiv账号并获取refresh_token。(参考:@ZipFile Pixiv OAuth Floweggplants/get-pixivpy-token

  1. 参考安装 | NoneBot安装NoneBot;
  2. 参考创建项目 | NoneBot创建一个NoneBot实例;
  3. 使用nb plugin install nonebot-plugin-pixivbot安装插件;
  4. 在.env.prod中修改配置(参考下方);

配置外部数据库(可选)

PixivBot需要使用数据库存放订阅以及缓存,默认使用SQLite。

SQLite

若需要自定义SQLite数据库文件路径,请设置配置项:

  • pixiv_sql_conn_url=sqlite+aiosqlite:///<数据库文件路径>

PostgreSQL

若需要使用PostgreSQL,请设置配置项:

  • pixiv_sql_conn_url=postgresql+asyncpg://<用户名>:<密码>@<主机>:<端口>/<数据库名>

并且执行pip install asyncpg安装asyncpg包

权限控制

插件接入了nonebot-plugin-access-control实现细粒度的权限控制:

nonebot_plugin_pixivbot
├── common
│   ├── illust  (看看图)
│   ├── ranking  (看看榜)
│   ├── more  (还要)
│   ├── random_bookmark  (来张私家车)
│   ├── random_illust  (来张xx图)
│   ├── random_recommended_illust  (来张图)
│   ├── random_related_illust  (不够色)
│   └── random_user_illust  (来张xx老师的图)
├── illust_link  (P站链接嗅探)
├── schedule
│   ├── receive  (接收定时推送)
│   └── manage  (管理定时推送)
├── watch
│   ├── receive  (接收更新推送)
│   └── manage  (管理定时推送)
├── invalidate_cache  (清除缓存)
├── bind  (绑定P站账号)
├── help  (帮助文本)
└── r18  (显示R-18内容)
    └── g  (显示R-18G内容)

譬如,超级用户可以通过发送/ac permission deny --srv nonebot_plugin_pixivbot.r18 --sbj all全局拦截R-18。

又譬如,超级用户可以通过分别发送以下指令,使得只有超级用户、QQ私聊与QQ群聊的群管理能够调用/pixivbot schedule/pixivbot unschedule命令。

/ac permission deny --srv nonebot_plugin_pixivbot.schedule.manage --sbj all
/ac permission allow --srv nonebot_plugin_pixivbot.schedule.manage --sbj qq:private
/ac permission allow --srv nonebot_plugin_pixivbot.schedule.manage --sbj qq:group_admin
/ac permission allow --srv nonebot_plugin_pixivbot.schedule.manage --sbj superuser

具体可以参考nonebot-plugin-access-control的文档进行权限控制。

常见问题

遇到问题时请先尝试执行pip install nonebot-plugin-pixivbot -U更新到最新版本

Issue请尽可能带上详细的日志、配置文件与环境信息。功能请求请移步Discussion。

网络错误,请稍后再试( No access_token Found!)

没登录成功,多半是网络问题。在国内请配置代理。

如果登录成功的话会在bot初始化后有这几句:

03-13 11:19:36 [SUCCESS] nonebot_plugin_pixivbot | refresh access token successfully. new token expires in 3600 seconds.
03-13 11:19:36 [DEBUG] nonebot_plugin_pixivbot | access_token: ***************
03-13 11:19:36 [DEBUG] nonebot_plugin_pixivbot | refresh_token: *****************

如何配置代理

pixiv_proxy配置项设为代理服务器地址(支持http、socks5协议)

pixiv_proxy=socks5://127.0.0.1:7890

发送合并转发消息惨遭风控

pixiv_onebot_send_forward_message配置项设为never可禁用合并转发

内部错误:<class 'sqlalchemy.exc.OperationalError'>(sqlite3.OperationalError) near "ON": syntax error

多半是SQLite版本过低,不支持ON CONFLICT子句,如果是Linux系统请更新安装的SQLite版本

配置项一览

最小配置:

pixiv_refresh_token=  # 前面获取的REFRESH_TOKEN

除最小配置出现的配置项以外都是可选项,给出的是默认值,建议只将自己需要的项加入.env.prod文件

完整配置:

# 数据库配置
pixiv_sql_conn_url=sqlite+aiosqlite:///pixiv_bot.db  # SQL连接URL,仅支持SQLite与PostgreSQL(通过SQLAlchemy进行连接,必须使用异步的DBAPI)
pixiv_use_local_cache=True  # 是否启用本地缓存

# 连接配置
pixiv_refresh_token=  # 前面获取的REFRESH_TOKEN
pixiv_proxy=  # 代理URL,推荐使用socks5代理
pixiv_query_timeout=60  # 查询超时(单位:秒)
pixiv_loading_prompt_delayed_time=5  # 加载提示消息的延迟时间(“努力加载中”的消息会在请求发出多少秒后发出)(单位:秒)
pixiv_simultaneous_query=8  # 向Pixiv查询的并发数
pixiv_download_custom_domain=  # 使用反向代理下载插画的域名

# 查询设置
pixiv_query_to_me_only=False  # 只响应关于Bot的查询
pixiv_command_to_me_only=False  # 只响应关于Bot的命令

pixiv_max_item_per_query=10  # 每个查询最多请求的插画数量

pixiv_tag_translation_enabled=True  # 启用搜索关键字翻译功能(平时搜索时记录标签翻译,在查询时判断是否存在对应中日翻译)

pixiv_block_tags=[]  # 当插画含有指定tag时会被阻拦
pixiv_block_action=no_image  # 阻拦时的动作,可选值:no_image(不显示插画,回复插画信息), completely_block(只回复过滤提示), no_reply(无回复)

pixiv_send_illust_link=False  # 发图时是否带上链接(容易被tx盯上)

pixiv_exclude_ai_illusts=False  # 是否过滤AI绘图作品

pixiv_watch_interval=600  # 更新推送的查询间隔(单位:秒)

# 插画压缩
pixiv_compression_enabled=False  # 启用插画压缩
pixiv_compression_max_size=  # 插画压缩最大尺寸
pixiv_compression_quantity=  # 插画压缩品质(0到100)

# 缓存过期时间/删除时间(单位:秒)
pixiv_download_cache_expires_in=604800  # 默认值:7天
pixiv_illust_detail_cache_expires_in=604800
pixiv_user_detail_cache_expires_in=604800
pixiv_illust_ranking_cache_expires_in=21600  # 默认值:6小时
pixiv_search_illust_cache_expires_in=86400  # 默认值:1天
pixiv_search_illust_cache_delete_in=2592000  # 默认值:30天
pixiv_search_user_cache_expires_in=86400
pixiv_search_user_cache_delete_in=2592000
pixiv_user_illusts_cache_expires_in=86400
pixiv_user_illusts_cache_delete_in=2592000
pixiv_user_bookmarks_cache_expires_in=86400
pixiv_user_bookmarks_cache_delete_in=2592000
pixiv_related_illusts_cache_expires_in=86400
pixiv_other_cache_expires_in=21600

# QQ平台(主要是gocq)配置
pixiv_poke_action=random_recommended_illust  # 响应戳一戳动作,可选值:ranking, random_recommended_illust, random_bookmark, 什么都不填即忽略戳一戳动作
pixiv_send_forward_message=auto  # 发图时是否使用转发消息的形式,可选值:always(永远使用), auto(仅在多张图片时使用), never(永远不使用)

# 功能配置
pixiv_more_enabled=True  # 启用重复上一次请求(还要)功能
pixiv_query_expires_in=600  # 上一次请求的过期时间(单位:秒)

pixiv_illust_query_enabled=True  # 启用插画查询(看看图)功能

pixiv_ranking_query_enabled=True  # 启用榜单查询(看看榜)功能
pixiv_ranking_default_mode=day  # 默认查询的榜单,可选值:day, week, month, day_male, day_female, week_original, week_rookie, day_manga
pixiv_ranking_default_range=[1, 3]  # 默认查询的榜单范围
pixiv_ranking_fetch_item=150  # 每次从服务器获取的榜单项数(查询的榜单范围必须在这个数目内)
pixiv_ranking_max_item_per_query=5  # 每次榜单查询最多能查询多少项

pixiv_random_illust_query_enabled=True  # 启用关键字插画随机抽选(来张xx图)功能
pixiv_random_illust_method=bookmark_proportion  # 随机抽选方法,下同,可选值:bookmark_proportion(概率与书签数成正比), view_proportion(概率与阅读量成正比), timedelta_proportion(概率与投稿时间和现在的时间差成正比), uniform(相等概率)
pixiv_random_illust_min_bookmark=0  # 过滤掉书签数小于该值的插画,下同
pixiv_random_illust_min_view=0  # 过滤掉阅读量小于该值的插画,下同
pixiv_random_illust_max_page=20  # 每次从服务器获取的查询结果页数,下同
pixiv_random_illust_max_item=500  # 每次从服务器获取的查询结果项数,下同

pixiv_random_recommended_illust_query_enabled=True  # 启用推荐插画随机抽选(来张图)功能
pixiv_random_recommended_illust_method=uniform
pixiv_random_recommended_illust_min_bookmark=0
pixiv_random_recommended_illust_min_view=0
pixiv_random_recommended_illust_max_page=40
pixiv_random_recommended_illust_max_item=1000

pixiv_random_related_illust_query_enabled=True  # 启用关联插画随机抽选(不够色)功能
pixiv_random_related_illust_method=bookmark_proportion
pixiv_random_related_illust_min_bookmark=0
pixiv_random_related_illust_min_view=0
pixiv_random_related_illust_max_page=4
pixiv_random_related_illust_max_item=100

pixiv_random_user_illust_query_enabled=True  # 启用用户插画随机抽选(来张xx老师的图)功能
pixiv_random_user_illust_method=timedelta_proportion
pixiv_random_user_illust_min_bookmark=0
pixiv_random_user_illust_min_view=0
pixiv_random_user_illust_max_page=2147483647
pixiv_random_user_illust_max_item=2147483647

pixiv_random_bookmark_query_enabled=True  # 启用用户书签随机抽选(来张私家车)功能
pixiv_random_bookmark_user_id=0  # 当QQ用户未绑定Pixiv账号时,从该Pixiv账号的书签内抽选
pixiv_random_bookmark_method=uniform
pixiv_random_bookmark_min_bookmark=0
pixiv_random_bookmark_min_view=0
pixiv_random_bookmark_max_page=2147483647
pixiv_random_bookmark_max_item=2147483647

Special Thanks

在线乞讨

点击请我打两把maimai

LICENSE

MIT License

Copyright (c) 2021 ssttkkl

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

nonebot-plugin-pixivbot's People

Contributors

dependabot[bot] avatar ssttkkl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nonebot-plugin-pixivbot's Issues

请求多张图片时失败,控制R-18的命令无响应

py:3.10.8
OS:Debian x64

nb-cli 1.0.4
nonebot-adapter-onebot 2.2.1
nonebot-plugin-access-control 0.2.3
nonebot-plugin-apscheduler 0.2.0
nonebot-plugin-datastore 0.4.0
nonebot-plugin-localstore 0.2.0
nonebot-plugin-pixivbot 1.7.0.post2
nonebot2 2.0.0rc3

配置文件:

DRIVER=~fastapi

HOST=127.0.0.1
PORT=8082
LOG_LEVEL=INFO
NICKNAME=["Alice"]
SUPERUSER=["123456789"]
COMMAND_START=["/", ""]

#nonebot-plugin-pixivbot
pixiv_refresh_token=*****************
pixiv_block_tags=["NovelAI"]
pixiv_block_action=completely_block
pixiv_query_cooldown=10
pixiv_max_item_per_query=5

#nonebot-plugin-access-control
ACCESS_CONTROL_AUTO_PATCH_ENABLED=true

已安装的只有nonebot-plugin-pixivbotnonebot-plugin-access-control
在私聊和群聊中使用ac/ac指令均无任何反应,无法控制R-18

不管是”来3张图“还是”来5张图“或者是下面日志里的”来2张图“,都会报这个错,但仅仅是”来张图“不会报错
以下是日志

[2023-02-10 15:48:50] 02-10 15:48:49 [SUCCESS] nonebot | OneBot V11 1234567890 | [message.private.friend]: Message 305350647 from 123456789 '来2张图'
[2023-02-10 15:48:50] 02-10 15:48:49 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_pixivbot.handler.common.random_recommended_illust)
[2023-02-10 15:48:50] 02-10 15:48:49 [INFO] nonebot_plugin_pixivbot | [mediator] recommended_illusts cache_strategy=NORMAL
[2023-02-10 15:48:50] 02-10 15:48:49 [INFO] nonebot_plugin_pixivbot | [local] recommended_illusts
[2023-02-10 15:48:50] 02-10 15:48:49 [INFO] nonebot_plugin_pixivbot | [pixiv_service] choice [95841125, 80168605]
[2023-02-10 15:48:50] 02-10 15:48:49 [INFO] nonebot_plugin_pixivbot | [local] got 1000 illusts, illust_detail of 0 are missed
[2023-02-10 15:48:50] 02-10 15:48:49 [INFO] nonebot_plugin_pixivbot | [mediator] image 95841125[0] cache_strategy=NORMAL
[2023-02-10 15:48:50] 02-10 15:48:49 [INFO] nonebot_plugin_pixivbot | [local] image 95841125
[2023-02-10 15:48:50] 02-10 15:48:49 [INFO] nonebot_plugin_pixivbot | [mediator] image 80168605[0] cache_strategy=NORMAL
[2023-02-10 15:48:50] 02-10 15:48:49 [INFO] nonebot_plugin_pixivbot | [local] image 80168605
[2023-02-10 15:48:50] 02-10 15:48:49 [INFO] nonebot_plugin_pixivbot | [mediator] no cache or cache expired
[2023-02-10 15:48:50] 02-10 15:48:49 [INFO] nonebot_plugin_pixivbot | [remote] image 95841125
[2023-02-10 15:48:50] 02-10 15:48:49 [INFO] nonebot_plugin_pixivbot | [mediator] no cache or cache expired
[2023-02-10 15:48:50] 02-10 15:48:49 [INFO] nonebot_plugin_pixivbot | [remote] image 80168605
[2023-02-10 15:48:51] 02-10 15:48:50 [INFO] nonebot_plugin_pixivbot | [local] update image 80168605 (update_time=2023-02-10 07:48:50.967331+00:00)
[2023-02-10 15:48:52] 02-10 15:48:51 [INFO] nonebot_plugin_pixivbot | [local] update image 95841125 (update_time=2023-02-10 07:48:51.512486+00:00)
[2023-02-10 15:48:52] 02-10 15:48:51 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_pixivbot.handler.common.random_recommended_illust) running complete
[2023-02-10 15:48:52] 02-10 15:48:51 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_pixivbot.handler.common.random_recommended_illust) failed.
[2023-02-10 15:48:52] Traceback (most recent call last):
[2023-02-10 15:48:52]   File "<string>", line 15, in <module>
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot/__init__.py", line 273, in run
[2023-02-10 15:48:52]     get_driver().run(*args, **kwargs)
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot/drivers/fastapi.py", line 187, in run
[2023-02-10 15:48:52]     uvicorn.run(
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/uvicorn/main.py", line 569, in run
[2023-02-10 15:48:52]     server.run()
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/uvicorn/server.py", line 60, in run
[2023-02-10 15:48:52]     return asyncio.run(self.serve(sockets=sockets))
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/3.10.8/lib/python3.10/asyncio/runners.py", line 44, in run
[2023-02-10 15:48:52]     return loop.run_until_complete(main)
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot/message.py", line 141, in _check_matcher
[2023-02-10 15:48:52]     await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
[2023-02-10 15:48:52] > File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot/message.py", line 187, in _run_matcher
[2023-02-10 15:48:52]     await matcher.run(bot, event, state, stack, dependency_cache)
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 732, in run
[2023-02-10 15:48:52]     await self.simple_run(bot, event, state, stack, dependency_cache)
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 707, in simple_run
[2023-02-10 15:48:52]     await handler(
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot/dependencies/__init__.py", line 108, in __call__
[2023-02-10 15:48:52]     return await cast(Callable[..., Awaitable[R]], self.call)(**values)
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot_plugin_pixivbot/handler/common/random_recommended_illust.py", line 37, in on_match
[2023-02-10 15:48:52]     await self.handle(count=get_count(state), post_dest=post_dest)
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot_plugin_pixivbot/handler/base.py", line 99, in handle
[2023-02-10 15:48:52]     await self.interceptor.intercept(self._parse_args_and_actual_handle, *args,
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot_plugin_pixivbot/handler/interceptor/combined_interceptor.py", line 45, in intercept
[2023-02-10 15:48:52]     await self.x.intercept(
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot_plugin_pixivbot/handler/interceptor/combined_interceptor.py", line 45, in intercept
[2023-02-10 15:48:52]     await self.x.intercept(
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot_plugin_pixivbot/handler/interceptor/combined_interceptor.py", line 45, in intercept
[2023-02-10 15:48:52]     await self.x.intercept(
[2023-02-10 15:48:52]   [Previous line repeated 3 more times]
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot_plugin_pixivbot/handler/interceptor/default_error_interceptor.py", line 32, in intercept
[2023-02-10 15:48:52]     raise e
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot_plugin_pixivbot/handler/interceptor/default_error_interceptor.py", line 22, in intercept
[2023-02-10 15:48:52]     await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot_plugin_pixivbot/handler/interceptor/permission_interceptor.py", line 34, in intercept
[2023-02-10 15:48:52]     await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot_plugin_pixivbot/handler/interceptor/permission_interceptor.py", line 34, in intercept
[2023-02-10 15:48:52]     await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot_plugin_pixivbot/handler/interceptor/timeout_interceptor.py", line 21, in intercept
[2023-02-10 15:48:52]     await wait_for(wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs),
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/3.10.8/lib/python3.10/asyncio/tasks.py", line 445, in wait_for
[2023-02-10 15:48:52]     return fut.result()
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot_plugin_pixivbot/handler/interceptor/loading_prompt_interceptor.py", line 33, in intercept
[2023-02-10 15:48:52]     await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot_plugin_pixivbot/handler/interceptor/record_req_interceptor.py", line 20, in intercept
[2023-02-10 15:48:52]     await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot_plugin_pixivbot/handler/interceptor/permission_interceptor.py", line 34, in intercept
[2023-02-10 15:48:52]     await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot_plugin_pixivbot/handler/base.py", line 130, in _parse_args_and_actual_handle
[2023-02-10 15:48:52]     await self.actual_handle(post_dest=post_dest, silently=silently, **kwargs)
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot_plugin_pixivbot/handler/common/random_recommended_illust.py", line 49, in actual_handle
[2023-02-10 15:48:52]     await self.post_illusts(illusts,
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot_plugin_pixivbot/handler/base.py", line 70, in post_illusts
[2023-02-10 15:48:52]     await self.postman_manager.send_illusts(model, post_dest=post_dest)
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot_plugin_pixivbot/handler/recorder.py", line 101, in send_illusts
[2023-02-10 15:48:52]     await self.delegation.send_illusts(model, post_dest=post_dest)
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot_plugin_pixivbot/protocol_dep/postman.py", line 40, in send_illusts
[2023-02-10 15:48:52]     return await self[post_dest.adapter].send_illusts(model, post_dest=post_dest)
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot_plugin_pixivbot_onebot_v11/protocol_dep/postman.py", line 84, in send_illusts
[2023-02-10 15:48:52]     await post_dest.post(messages)
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot_plugin_pixivbot_onebot_v11/protocol_dep/post_dest.py", line 49, in post
[2023-02-10 15:48:52]     await self.post_multiple(message)
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot_plugin_pixivbot_onebot_v11/protocol_dep/post_dest.py", line 89, in post_multiple
[2023-02-10 15:48:52]     await self.bot.send_private_forward_msg(
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot/internal/adapter/bot.py", line 120, in call_api
[2023-02-10 15:48:52]     raise exception
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot/internal/adapter/bot.py", line 98, in call_api
[2023-02-10 15:48:52]     result = await self.adapter._call_api(self, api, **data)
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot/adapters/onebot/v11/adapter.py", line 132, in _call_api
[2023-02-10 15:48:52]     return handle_api_result(await self._result_store.fetch(seq, timeout))
[2023-02-10 15:48:52]   File "/home/snowmoonss/.pyenv/versions/pixivbot/lib/python3.10/site-packages/nonebot/adapters/onebot/v11/utils.py", line 58, in handle_api_result
[2023-02-10 15:48:52]     raise ActionFailed(**result)
[2023-02-10 15:48:52] nonebot.adapters.onebot.v11.exception.ActionFailed: ActionFailed(status='failed', retcode=103, data=None, echo='2')

安装插件时报错error: subprocess-exited-with-error

Preparing metadata (setup.py) ... done
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/be/54/5468f25bcadc6877de0bfd253f27e3ce489c3d4489c928cdb38b31ed47cb/greenlet-0.3.1.tar.gz (39 kB)
Preparing metadata (setup.py) ... done
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/9f/29/c8d0b051afacd0108c26a89824a13fa041299b61e8d9e50a6a35e25c4ec1/greenlet-0.3.tar.gz (37 kB)
Preparing metadata (setup.py) ... done
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/72/db/0d1a944ba1517256e8b1a080a90297569d8662442631a6b05f8a1c584556/greenlet-0.2.tar.gz (22 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [9 lines of output]
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "C:\Users\Rin\AppData\Local\Temp\pip-install-eby1tclc\greenlet_a0051fbe720c459da3277333517494c5\setup.py", line 3, in
import ez_setup
File "C:\Users\Rin\AppData\Local\Temp\pip-install-eby1tclc\greenlet_a0051fbe720c459da3277333517494c5\ez_setup_init_.py", line 98
except pkg_resources.VersionConflict, e:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: multiple exception types must be parenthesized
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

环境:win
python3.10.8

QQ私聊无法发送图片

现在我能够成功运行,并且通过bot请求pixiv有返回,且数据库也成功入值,但是bot却发不出来消息,请问我需要从哪边开始排查
fault2

不清楚是不是ssl证书验证的问题

报错如下
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host none:443
ssl:default [getaddrinfo failed]
不知道如何处理系统是windows2012server r2

求教

内部错误:<class 'pixivpy_async.error.NoTokenError'>No access_token Found!
怎么解决啊

sqlite下来张图功能出现内部错误:<class 'sqlalchemy.exc.OperationalError'>

插件使用时出现异常(首次运行),请问可能是哪方面的问题呢?

nonebot2运行于阿里云2核2G上,系统镜像为ubuntu_18_04_x64_20G_alibase_20210420
python环境为 3.9.9 (main, Jan 11 2023, 13:36:57) [GCC 7.5.0] on linux
代理使用clash,插件配置中使用socket5连接
http代理也试过,同样报错。测试代理下可以curl通pixiv
插件通过nbcli安装,plugins = ["nonebot_plugin_access_control", "nonebot_plugin_pixivbot"]

测试来张图功能的时候出现了内部错误

内部错误:<class 'sqlalchemy.exc.OperationalError'>(sqlite3.OperationalError) near "ON": syntax error
[SQL: INSERT INTO illust_set_cache_illust (cache_id, illust_id, rank) VALUES (?, ?, ?) ON CONFLICT (cache_id, illust_id) DO NOTHING]
[parameters: (1, 85338970, 0)]
(Background on this error at: https://sqlalche.me/e/14/e3q8)

后台日志如下(pm2)

3|bot_test  | 02-24 16:39:12 [SUCCESS] nonebot_plugin_pixivbot | refresh access token successfully. new token expires in 3600 seconds.
3|bot_test  | 02-24 16:39:25 [SUCCESS] nonebot | OneBot V11 ********** | [message.private.friend]: Message 113049793 from ********* "来张图"
3|bot_test  | 02-24 16:39:25 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_pixivbot.handler.common.random_recommended_illust)
3|bot_test  | 02-24 16:39:25 [INFO] nonebot_plugin_pixivbot | [mediator] recommended_illusts cache_strategy=NORMAL
3|bot_test  | 02-24 16:39:25 [INFO] nonebot_plugin_pixivbot | [local] recommended_illusts
3|bot_test  | 02-24 16:39:25 [INFO] nonebot_plugin_pixivbot | [mediator] no cache
3|bot_test  | 02-24 16:39:25 [INFO] nonebot_plugin_pixivbot | [remote] recommended_illusts
3|bot_test  | 02-24 16:39:29 [INFO] nonebot_plugin_pixivbot | [local] append recommended_illusts (89 items) (update_time=2023-02-24 08:39:29.467578+00:00, pages=1, next_qs={'content_type': 'illust', 'filter': 'for_ios', 'include_ranking_label': 'true', 'min_bookmark_id_for_recent_illust': '19409055318', 'max_bookmark_id_for_recommend': '19292895144', 'offset': '0', 'include_ranking_illusts': 'false', 'include_privacy_policy': 'false', 'viewed': ['74902982', '103070297', '105565310', '77202252', '93287605', '90724362', '95927502', '93508362', '75691856', '98214912', '75426467', '78253736', '93355299', '98366214', '97972911', '74641348', '104564463', '105353565', '79895186', '99827857', '87740032', '25950227', '100214821', '87543808', '74670640', '95725261', '54330336', '95210012', '105538757', '96352877', '58099279', '75148244', '97736256', '65456653', '73424709', '87135864', '85742450', '96777964', '74938719', '105503743', '95913659', '77042494', '104058515', '105469182', '73372039', '76101179', '90896936', '43796605', '105555300', '86849255', '95370037', '95625131', '97086274', '74072598', '81300641', '85852984', '105151086', '86920942', '72939532', '86930658', '87135347', '89416175', '77629434', '100441318', '87011701', '94795485', '79919240', '77888645', '74636713', '87040731', '102677874', '79917459', '69630731', '86113095', '87200529', '74603343', '88405884', '90496169', '76591462', '94432761', '96433029', '82542737', '98508889', '77980028', '71249092', '76200564', '77048512', '86529151', '90392959']})
3|bot_test  | 02-24 16:39:29 [ERROR] nonebot_plugin_pixivbot | error <class 'sqlalchemy.exc.OperationalError'> raised by agen (RECOMMENDED_ILLUSTS )
3|bot_test  | 02-24 16:39:29 [INFO] nonebot_plugin_pixivbot | [remote] got 89 illusts, illust_detail of 0 are missed
3|bot_test  | 02-24 16:39:29 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_pixivbot.handler.common.random_recommended_illust) running complete
3|bot_test  | 02-24 16:39:29 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_pixivbot.handler.common.random_recommended_illust) failed.
3|bot_test  | Traceback (most recent call last):
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
3|bot_test  |     self.dialect.do_execute(
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
3|bot_test  |     cursor.execute(statement, parameters)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 100, in execute
3|bot_test  |     self._adapt_connection._handle_exception(error)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 228, in _handle_exception
3|bot_test  |     raise error
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 82, in execute
3|bot_test  |     self.await_(_cursor.execute(operation, parameters))
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 68, in await_only
3|bot_test  |     return current.driver.switch(awaitable)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 121, in greenlet_spawn
3|bot_test  |     value = await result
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/aiosqlite/cursor.py", line 37, in execute
3|bot_test  |     await self._execute(self._cursor.execute, sql, parameters)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/aiosqlite/cursor.py", line 31, in _execute
3|bot_test  |     return await self._conn._execute(fn, *args, **kwargs)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/aiosqlite/core.py", line 129, in _execute
3|bot_test  |     return await future
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/aiosqlite/core.py", line 102, in run
3|bot_test  |     result = function()
3|bot_test  | sqlite3.OperationalError: near "ON": syntax error
3|bot_test  | The above exception was the direct cause of the following exception:
3|bot_test  | Traceback (most recent call last):
3|bot_test  |   File "/usr/local/python3/bin/nb", line 8, in <module>
3|bot_test  |     sys.exit(main())
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
3|bot_test  |     return self.main(*args, **kwargs)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/click/core.py", line 1055, in main
3|bot_test  |     rv = self.invoke(ctx)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
3|bot_test  |     return _process_result(sub_ctx.command.invoke(sub_ctx))
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
3|bot_test  |     return ctx.invoke(self.callback, **ctx.params)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/click/core.py", line 760, in invoke
3|bot_test  |     return __callback(*args, **kwargs)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nb_cli/commands/main.py", line 30, in run
3|bot_test  |     run_bot(file, app)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nb_cli/handlers/deploy.py", line 25, in run_bot
3|bot_test  |     nonebot.run(app=f"{module_name}:{app}")
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot/__init__.py", line 273, in run
3|bot_test  |     get_driver().run(*args, **kwargs)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot/drivers/fastapi.py", line 187, in run
3|bot_test  |     uvicorn.run(
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/uvicorn/main.py", line 569, in run
3|bot_test  |     server.run()
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/uvicorn/server.py", line 60, in run
3|bot_test  |     return asyncio.run(self.serve(sockets=sockets))
3|bot_test  |   File "/usr/local/python3/lib/python3.9/asyncio/runners.py", line 44, in run
3|bot_test  |     return loop.run_until_complete(main)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot/message.py", line 141, in _check_matcher
3|bot_test  |     await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
3|bot_test  | > File "/usr/local/python3/lib/python3.9/site-packages/nonebot/message.py", line 187, in _run_matcher
3|bot_test  |     await matcher.run(bot, event, state, stack, dependency_cache)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot/internal/matcher/matcher.py", line 732, in run
3|bot_test  |     await self.simple_run(bot, event, state, stack, dependency_cache)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot/internal/matcher/matcher.py", line 707, in simple_run
3|bot_test  |     await handler(
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot/dependencies/__init__.py", line 108, in __call__
3|bot_test  |     return await cast(Callable[..., Awaitable[R]], self.call)(**values)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/common/random_recommended_illust.py", line 38, in on_match
3|bot_test  |     await self.handle(count=get_count(state), post_dest=post_dest)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/base.py", line 96, in handle
3|bot_test  |     await self.interceptor.intercept(self._parse_args_and_actual_handle, *args,
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/interceptor/combined_interceptor.py", line 56, in intercept
3|bot_test  |     await self.x.intercept(
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/interceptor/combined_interceptor.py", line 56, in intercept
3|bot_test  |     await self.x.intercept(
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/interceptor/combined_interceptor.py", line 56, in intercept
3|bot_test  |     await self.x.intercept(
3|bot_test  |   [Previous line repeated 4 more times]
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/interceptor/default_error_interceptor.py", line 36, in intercept
3|bot_test  |     raise e  # 重新抛出,让上层可以处理(如scheduler中需要处理Handler的异常)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/interceptor/default_error_interceptor.py", line 22, in intercept
3|bot_test  |     await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/interceptor/permission_interceptor.py", line 34, in intercept
3|bot_test  |     await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/interceptor/permission_interceptor.py", line 34, in intercept
3|bot_test  |     await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/interceptor/timeout_interceptor.py", line 21, in intercept
3|bot_test  |     await wait_for(wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs),
3|bot_test  |   File "/usr/local/python3/lib/python3.9/asyncio/tasks.py", line 481, in wait_for
3|bot_test  |     return fut.result()
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/interceptor/retry_interceptor.py", line 32, in intercept
3|bot_test  |     raise e
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/interceptor/retry_interceptor.py", line 26, in intercept
3|bot_test  |     return await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/interceptor/loading_prompt_interceptor.py", line 33, in intercept
3|bot_test  |     await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/interceptor/service_interceptor.py", line 35, in intercept
3|bot_test  |     await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/interceptor/record_req_interceptor.py", line 20, in intercept
3|bot_test  |     await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/base.py", line 127, in _parse_args_and_actual_handle
3|bot_test  |     await self.actual_handle(post_dest=post_dest, silently=silently, **kwargs)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/common/random_recommended_illust.py", line 48, in actual_handle
3|bot_test  |     illusts = await self.service.random_recommended_illust(count=count,
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/service/pixiv_service.py", line 112, in random_recommended_illust
3|bot_test  |     illusts = [x async for x in self.repo.recommended_illusts()]
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/service/pixiv_service.py", line 112, in <listcomp>
3|bot_test  |     illusts = [x async for x in self.repo.recommended_illusts()]
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/data/pixiv_repo/mediator_repo.py", line 348, in recommended_illusts
3|bot_test  |     async for x in gen:
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/utils/shared_agen.py", line 63, in _generator
3|bot_test  |     raise e
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/utils/shared_agen.py", line 55, in _generator
3|bot_test  |     new_data = await self._origin.__anext__()
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/data/pixiv_repo/mediator.py", line 131, in mediate_many
3|bot_test  |     async for x in _load_many_from_remote_and_append(remote_factory, query_kwargs,
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/data/pixiv_repo/mediator.py", line 97, in _load_many_from_remote_and_append
3|bot_test  |     await cache_appender(buffer, item)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/data/pixiv_repo/local_repo/sql.py", line 512, in append_recommended_illusts
3|bot_test  |     return await self._append_and_check_illusts(session, "other", {"type": "recommended_illusts"},
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/nonebot_plugin_pixivbot/data/pixiv_repo/local_repo/sql.py", line 153, in _append_and_check_illusts
3|bot_test  |     row_count += (await session.execute(stmt)).rowcount
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/ext/asyncio/session.py", line 215, in execute
3|bot_test  |     result = await greenlet_spawn(
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 126, in greenlet_spawn
3|bot_test  |     result = context.throw(*sys.exc_info())
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 1712, in execute
3|bot_test  |     result = conn._execute_20(statement, params or {}, execution_options)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1705, in _execute_20
3|bot_test  |     return meth(self, args_10style, kwargs_10style, execution_options)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/sql/elements.py", line 333, in _execute_on_connection
3|bot_test  |     return connection._execute_clauseelement(
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1572, in _execute_clauseelement
3|bot_test  |     ret = self._execute_context(
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1943, in _execute_context
3|bot_test  |     self._handle_dbapi_exception(
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 2124, in _handle_dbapi_exception
3|bot_test  |     util.raise_(
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/util/compat.py", line 208, in raise_
3|bot_test  |     raise exception
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
3|bot_test  |     self.dialect.do_execute(
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
3|bot_test  |     cursor.execute(statement, parameters)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 100, in execute
3|bot_test  |     self._adapt_connection._handle_exception(error)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 228, in _handle_exception
3|bot_test  |     raise error
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 82, in execute
3|bot_test  |     self.await_(_cursor.execute(operation, parameters))
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 68, in await_only
3|bot_test  |     return current.driver.switch(awaitable)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 121, in greenlet_spawn
3|bot_test  |     value = await result
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/aiosqlite/cursor.py", line 37, in execute
3|bot_test  |     await self._execute(self._cursor.execute, sql, parameters)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/aiosqlite/cursor.py", line 31, in _execute
3|bot_test  |     return await self._conn._execute(fn, *args, **kwargs)
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/aiosqlite/core.py", line 129, in _execute
3|bot_test  |     return await future
3|bot_test  |   File "/usr/local/python3/lib/python3.9/site-packages/aiosqlite/core.py", line 102, in run
3|bot_test  |     result = function()
3|bot_test  | sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) near "ON": syntax error
3|bot_test  | [SQL: INSERT INTO illust_set_cache_illust (cache_id, illust_id, rank) VALUES (?, ?, ?) ON CONFLICT (cache_id, illust_id) DO NOTHING]
3|bot_test  | [parameters: (1, 74902982, 0)]
3|bot_test  | (Background on this error at: https://sqlalche.me/e/14/e3q8)

KeyError: <class 'apscheduler.schedulers.asyncio.AsyncIOScheduler'>

##报错如下

########

12-24 08:13:23 [SUCCESS] nonebot | OneBot V11 2715252422 | [message.group.normal]: Message 245639597 from 77139032@[群:7
37521032] "看看榜"
12-24 08:13:23 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_pixivbot.handler.
common.ranking)
12-24 08:13:23 [INFO] nonebot_plugin_pixivbot | [mediator] illust_ranking day cache_strategy=NORMAL
12-24 08:13:24 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_pixivbot.handler.common.ranking) running c
omplete
12-24 08:13:24 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_pixivbot.handler.common.ranking)
failed.
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return run_code(code, main_globals, None,
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\Scripts\nb.exe_main
.py", line 7, in
sys.exit(main())
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1130, in _
call

return self.main(*args, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1055, in m
ain
rv = self.invoke(ctx)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1657, in i
nvoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1404, in i
nvoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 760, in in
voke
return callback(*args, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nb_cli\commands\main.py", line
30, in run
run_bot(file, app)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nb_cli\handlers\deploy.py", lin
e 25, in run_bot
nonebot.run(app=f"{module_name}:{app}")
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_init
.py", line 273,
in run
get_driver().run(*args, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\drivers\fastapi.py", li
ne 172, in run
uvicorn.run(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\main.py", line 569, in
run
server.run()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\server.py", line 60, in
run
return asyncio.run(self.serve(sockets=sockets))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 636, in run_unt
il_complete
self.run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_events.py", line 321, in run

forever
super().run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 603, in run_for
ever
self._run_once()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1899, in _run_o
nce
handle._run()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\message.py", line 142,
in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)

File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\message.py", line 188,
in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\internal\matcher\matche
r.py", line 727, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\internal\matcher\matche
r.py", line 702, in simple_run
await handler(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\dependencies_init
.p
y", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\handler
\common\ranking.py", line 58, in on_match
await self.handle(mode, num, post_dest=post_dest)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\handler
\base.py", line 80, in handle
await self.interceptor.intercept(self._parse_args_and_actual_handle, *args,
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\handler
\interceptor\combined_interceptor.py", line 45, in intercept
await self.x.intercept(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\handler
\interceptor\combined_interceptor.py", line 45, in intercept
await self.x.intercept(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\handler
\interceptor\combined_interceptor.py", line 45, in intercept
await self.x.intercept(
[Previous line repeated 2 more times]
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\handler
\interceptor\default_error_interceptor.py", line 36, in intercept
raise e # 重新抛出,让上层可以处理(如scheduler中需要处理Handler的异常)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\handler
\interceptor\default_error_interceptor.py", line 22, in intercept
await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\handler
\interceptor\permission_interceptor.py", line 34, in intercept
await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\handler
\interceptor\permission_interceptor.py", line 34, in intercept
await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\handler
\interceptor\timeout_interceptor.py", line 21, in intercept
await wait_for(wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs),
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 445, in wait_for
return fut.result()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\handler
\interceptor\loading_prompt_interceptor.py", line 33, in intercept
await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\handler
\interceptor\permission_interceptor.py", line 34, in intercept
await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\handler
\base.py", line 111, in _parse_args_and_actual_handle
await self.actual_handle(post_dest=post_dest, silently=silently, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\handler
\common\ranking.py", line 115, in actual_handle
illusts = await self.service.illust_ranking(mode, range)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\service
\pixiv_service.py", line 40, in illust_ranking
async for x in self.repo.illust_ranking(mode):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\data\pi
xiv_repo\mediator_repo.py", line 368, in illust_ranking
async with self._shared_agen_mgr.get(SharedAgenIdentifier(PixivResType.ILLUST_RANKING, mode=mode),
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 199, in aenter
return await anext(self.gen)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\utils\s
hared_agen.py", line 193, in get
origin = self.agen(identifier, cache_strategy, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\data\pi
xiv_repo\mediator_repo.py", line 177, in agen
return self.factories[identifier.type](self, cache_strategy=cache_strategy, **merged_kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\data\pi
xiv_repo\mediator_repo.py", line 140, in illust_ranking_factory
cache_factory=self.local.illust_ranking,
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\context
.py", line 16, in get
return context.require(self._key)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\context
.py", line 136, in require
return self._find_provider(key).provide()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\context
.py", line 46, in provide
self._cache = self._func() # just let it throw
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\context
.py", line 90, in
self.register_lazy(cls, lambda: cls(*args, **kwargs))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\data\pi
xiv_repo\local_repo\sql.py", line 53, in init
self.apscheduler.add_job,
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\context
.py", line 16, in get
return context.require(self._key)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\context
.py", line 136, in require
return self._find_provider(key).provide()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\context
.py", line 144, in _find_provider
raise KeyError(key)
KeyError: <class 'apscheduler.schedulers.asyncio.AsyncIOScheduler'>

##########

配置如下

##########

我已经配置好代理,并用代理成功获取了refresh_token并填入,但使用command便会报错
image
image

只对某个群聊报错

图片
大佬您好,我这边出现了点问题。。。我在其他群使用pixivbot的指令都没有问题,只在某个特定的群里面使用 来张图 指令时日志会出现以上报错,该群唯一的不同之处可能在于这个新建的bot在使用过一次指令前前我先用ac limit对这个群聊的pixivbot使用次数进行了限制。

另外,如果我在该群使用pixivbot help指令的话,会提示:
内部错误:<class 'sqlalchemy.exc.MissingGreenlet'>greenlet_spawn has not been called; can't call await_only() here. Was IO attempted in an unexpected place? (Background on this error at: https://sqlalche.me/e/20/xd2s)。
这点同样是只有在该群会出现的错误。

最后就是,我想尝试清理一下缓存,于是使用了invaildate_cache。但是又会显示:
内部错误:<class 'TypeError'>object bool can't be used in 'await' expression

如果大佬有空的话能麻烦大佬指点一下吗?非常感谢

地址错误?

内部错误:<class 'aiohttp.client_exceptions.ClientConnectorError'>Cannot connect to host none:443 ssl:default [getaddrinfo failed]
如果加了http代理,在代理日志也提示accept //none:443 [proxy]

使用提示内部错误

小白提问:按照文档所给的方法获取了refresh_token并且写入了.env.prod文件里面,但还是有这种报错,求问该如何解决
2~} ~LA$%CY@_ ~ {XERQ(2

启动时提示“SyntaxError: invalid syntax”

01-16 18:41:11 [ERROR] nonebot | Failed to import "nonebot-plugin-pixivbot"                                                                                                                                 
Traceback (most recent call last):                                                                                                                                                                          
  File "bot.py", line 27, in <module>                                                                                                                                                                       
    nonebot.load_from_toml("pyproject.toml")                                                                                                                                                                
  File "/usr/local/lib/python3.8/dist-packages/nonebot/plugin/__init__.py", line 1089, in load_from_toml                                                                                                    
    return load_all_plugins(set(plugins), set(plugin_dirs))                                                                                                                                                 
  File "/usr/local/lib/python3.8/dist-packages/nonebot/plugin/__init__.py", line 1031, in load_all_plugins                                                                                                  
    result = context.run(_load_plugin, manager, plugin_name)                                                                                                                                                
> File "/usr/local/lib/python3.8/dist-packages/nonebot/plugin/__init__.py", line 953, in _load_plugin                                                                                                       
    module = manager.load_plugin(plugin_name)                                                                                                                                                               
  File "/usr/local/lib/python3.8/dist-packages/nonebot/plugin/manager.py", line 161, in load_plugin                                                                                                         
    return importlib.import_module(f"{self.namespace}.{name}")                                                                                                                                              
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module                                                                                                                               
    return _bootstrap._gcd_import(name[level:], package, level)                                                                                                                                             
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import                                                                                                                                           
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load                                                                                                                                         
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked                                                                                                                                
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked                                                                                                                                         
  File "/usr/local/lib/python3.8/dist-packages/nonebot/plugin/manager.py", line 267, in exec_module                                                                                                         
    super().exec_module(module)                                                                                                                                                                             
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module                                                                                                                                   
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed                                                                                                                              
  File "/root/Nonebot/src/plugins/nonebot-plugin-pixivbot/__init__.py", line 9, in <module>                                                                                                                 
    from . import common_command                                                                                                                                                                            
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load                                                                                                                                         
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked                                                                                                                                
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked                                                                                                                                         
  File "/usr/local/lib/python3.8/dist-packages/nonebot/plugin/manager.py", line 267, in exec_module                                                                                                         
    super().exec_module(module)                                                                                                                                                                             
  File "/root/Nonebot/src/plugins/nonebot-plugin-pixivbot/common_command.py", line 11, in <module>                                                                                                          
    from .distributor import distributor                                                                                                                                                                    
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load                                                                                                                                         
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked                                                                                                                                
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked                                                                                                                                         
  File "/usr/local/lib/python3.8/dist-packages/nonebot/plugin/manager.py", line 267, in exec_module                                                                                                         
    super().exec_module(module)                                                                            
  File "/root/Nonebot/src/plugins/nonebot-plugin-pixivbot/distributor.py", line 15, in <module>                                                                                                             
    from .data_source import PixivDataSource, pixiv_data_source, pixiv_bindings                                                                                                                             
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load                                                                                                                                         
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked                                                                                                                                
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked                                                                                                                                         
  File "/usr/local/lib/python3.8/dist-packages/nonebot/plugin/manager.py", line 267, in exec_module                                                                                                         
    super().exec_module(module)                                                                                                                                                                             
  File "/root/Nonebot/src/plugins/nonebot-plugin-pixivbot/data_source/__init__.py", line 1, in <module>                                                                                                     
    from .pixiv_data_source import PixivDataSource, pixiv_data_source                                                                                                                                       
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load                                                                                                                                         
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked                                                                                                                                
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked                                                                                                                                         
  File "/usr/local/lib/python3.8/dist-packages/nonebot/plugin/manager.py", line 267, in exec_module                                                                                                         
    super().exec_module(module)                                                                                                                                                                             
  File "/root/Nonebot/src/plugins/nonebot-plugin-pixivbot/data_source/pixiv_data_source.py", line 394                                                                                                       
    @get_driver().on_startup                                                                                                                                                                                
                 ^                                                                                                                                                                                          
SyntaxError: invalid syntax

环境Docker+Debian+Python3

订阅画师作品更新无法收到更新

如题,群内订阅了一些画师,但是从来没有收到过一次推送。
私聊的关注推送和群组的日榜定时推送都是正常工作的。
研究发现,pixivbot如果没有获取过此用户的图片,使用ID获取这个user总是返回user_id not found的错误。
以ATDAN-(6662895)为例:
屏幕截图 2023-03-14 150825
但是以ID搜图可以工作:
屏幕截图 2023-03-14 151043

此时再执行/pixivbot watch fetch,居然又可以了?
屏幕截图 2023-03-14 151227

再换一个画师Pottsness(59336265),群内无搜图历史也无订阅历史(但是有私聊关注者推送)
image
(ErrorLog太长,screen不能滚屏)
image
但是第一次使用名称搜图之后,基于ID的功能就都正常了:
image
屏幕截图 2023-03-14 152256

总之就是这样,看样子跟数据库有点关系。(使用的是默认的SQLite)
另一个问题是,大群里群友一拥而上发图的时候经常会遇到Database Locked错误。

在未安装特化插件时显示更友好的异常信息

Traceback (most recent call last):
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\Scripts\nb.exe_main
.py", line 7, in
sys.exit(main())
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1130, in call
return self.main(*args, **kwargs)
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1055, in main
rv = self.invoke(ctx)
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 760, in invoke
return _callback(*args, **kwargs)
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\site-packages\nb_cli\commands\main.py", line 30, in run
run_bot(file, app)
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\site-packages\nb_cli\handlers\deploy.py", line 25, in run_bot
nonebot.run(app=f"{module_name}:{app}")
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_init
.py", line 261, in run
get_driver().run(*args, **kwargs)
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\drivers\fastapi.py", line 170, in run
uvicorn.run(
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\main.py", line 576, in run
server.run()
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 633, in run_until_complete
self.run_forever()
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_events.py", line 321, in run_forever
super().run_forever()
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 600, in run_forever
self._run_once()
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1896, in _run_once
handle._run()
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\message.py", line 146, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)

File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\message.py", line 196, in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\internal\matcher.py", line 672, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\internal\matcher.py", line 639, in simple_run
await handler(
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\dependencies_init
.py", line 92, in call
return await self.call(**values)
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\query\ranking.py", line 30, in on_match
await self.handler.handle(mode, num, post_dest=get_post_dest(bot, event))
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\query\utils.py", line 42, in get_post_dest
return context.require(PostDestinationFactoryManager).from_event(bot, event)
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\protocol_dep\post_dest.py", line 63, in from_event
return self[get_adapter_name(bot)].from_event(bot, event)
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\protocol_dep\protocol_dep.py", line 31, in getitem
return self.require(adapter)
File "C:\Users\26682\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_pixivbot\protocol_dep\protocol_dep.py", line 28, in require
return context.require(self.factories[adapter])
KeyError: 'onebot'

希望加入一些功能

希望加一个自动撤回的功能,
还有就是希望bot发送合并消息的时候发送者为发出指令的人
例如A发送了指令,bot响应之后发送了一个合并消息,合并消息中的发送人是A

设置refresh_token后仍然无法启动

如题,refresh_token就是在服务器上用gppt获取的,应该不是网络问题
log:

Traceback (most recent call last):
File "/home/ubuntu/Bot/MizukiBot-Lazer/bot.py", line 36, in
nonebot.load_from_toml("pyproject.toml")
File "/home/ubuntu/.pyenv/versions/MizukiBot-Lazer/lib/python3.10/site-packages/nonebot/plugin/load.py", line 125, in load_from_toml
return load_all_plugins(plugins, plugin_dirs)
File "/home/ubuntu/.pyenv/versions/MizukiBot-Lazer/lib/python3.10/site-packages/nonebot/plugin/load.py", line 62, in load_all_plugins
return manager.load_all_plugins()
File "/home/ubuntu/.pyenv/versions/MizukiBot-Lazer/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 175, in load_all_plugins
return set(
File "/home/ubuntu/.pyenv/versions/MizukiBot-Lazer/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 176, in
filter(None, (self.load_plugin(name) for name in self.available_plugins))
File "/home/ubuntu/.pyenv/versions/MizukiBot-Lazer/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 141, in load_plugin
module = importlib.import_module(name)
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "/home/ubuntu/.pyenv/versions/MizukiBot-Lazer/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 240, in exec_module
super().exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/home/ubuntu/.pyenv/versions/MizukiBot-Lazer/lib/python3.10/site-packages/nonebot_plugin_pixivbot/init.py", line 10, in
from .handler.command.help import help_text
File "/home/ubuntu/.pyenv/versions/MizukiBot-Lazer/lib/python3.10/site-packages/nonebot_plugin_pixivbot/handler/init.py", line 1, in
from . import command
File "/home/ubuntu/.pyenv/versions/MizukiBot-Lazer/lib/python3.10/site-packages/nonebot_plugin_pixivbot/handler/command/init.py", line 1, in
from .bind import BindHandler, UnbindHandler
File "/home/ubuntu/.pyenv/versions/MizukiBot-Lazer/lib/python3.10/site-packages/nonebot_plugin_pixivbot/handler/command/bind.py", line 4, in
from nonebot_plugin_pixivbot.service.pixiv_account_binder import PixivAccountBinder
File "/home/ubuntu/.pyenv/versions/MizukiBot-Lazer/lib/python3.10/site-packages/nonebot_plugin_pixivbot/service/init.py", line 1, in
from . import scheduler
File "/home/ubuntu/.pyenv/versions/MizukiBot-Lazer/lib/python3.10/site-packages/nonebot_plugin_pixivbot/service/scheduler.py", line 12, in
from nonebot_plugin_pixivbot.data.subscription import SubscriptionRepo
File "/home/ubuntu/.pyenv/versions/MizukiBot-Lazer/lib/python3.10/site-packages/nonebot_plugin_pixivbot/data/init.py", line 5, in
conf = context.require(Config)
File "/home/ubuntu/.pyenv/versions/MizukiBot-Lazer/lib/python3.10/site-packages/nonebot_plugin_pixivbot/context.py", line 136, in require
return self._find_provider(key).provide()
File "/home/ubuntu/.pyenv/versions/MizukiBot-Lazer/lib/python3.10/site-packages/nonebot_plugin_pixivbot/context.py", line 46, in provide
self._cache = self._func() # just let it throw
File "/home/ubuntu/.pyenv/versions/MizukiBot-Lazer/lib/python3.10/site-packages/nonebot_plugin_pixivbot/context.py", line 90, in
self.register_lazy(cls, lambda: cls(*args, **kwargs))
File "pydantic/env_settings.py", line 39, in pydantic.env_settings.BaseSettings.init
super().init(
File "pydantic/main.py", line 341, in pydantic.main.BaseModel.init
raise validation_error
pydantic.error_wrappers.ValidationError: 1 validation error for Config
pixiv_query_expires_in
value is not a valid integer (type=type_error.integer)

希望可以增加uid搜索和看看AI榜

希望增加功能:
1、因为部分画师名字输入比较麻烦,如果可以兼容uid搜索就好了;
2、最近ai榜质量挺好的,希望可以添加看看AI榜。

可以适配云崽魔改的py插件吗

schedle random_illust 01:00*x ロリ [PyBot][08:36:50.480][INFO] [message] 触发 Matcher(type='message', module=nonebot_plugin_pixivbot.handler.command.command) [PyBot][08:36:50.497][ERROR] [message]Running Matcher(type='message', module=nonebot_plugin_pixivbot.handler.command.command) failed. Traceback (most recent call last): File "/root/.cache/pypoetry/virtualenvs/py-plugin-8_cve6GP-py3.9/lib/python3.9/site-packages/nonebot/message.py", line 141, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache) > File "/root/.cache/pypoetry/virtualenvs/py-plugin-8_cve6GP-py3.9/lib/python3.9/site-packages/nonebot/message.py", line 187, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "/root/.cache/pypoetry/virtualenvs/py-plugin-8_cve6GP-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher/matcher.py", line 753, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "/root/.cache/pypoetry/virtualenvs/py-plugin-8_cve6GP-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher/matcher.py", line 728, in simple_run await handler( File "/root/.cache/pypoetry/virtualenvs/py-plugin-8_cve6GP-py3.9/lib/python3.9/site-packages/nonebot/dependencies/init.py", line 104, in call values = await self.solve(**kwargs) File "/root/.cache/pypoetry/virtualenvs/py-plugin-8_cve6GP-py3.9/lib/python3.9/site-packages/nonebot/dependencies/init.py", line 219, in solve values = await asyncio.gather( File "/root/.cache/pypoetry/virtualenvs/py-plugin-8_cve6GP-py3.9/lib/python3.9/site-packages/nonebot/dependencies/init.py", line 208, in _solve_field value = await cast(Param, field.field_info)._solve(**params) File "/root/.cache/pypoetry/virtualenvs/py-plugin-8_cve6GP-py3.9/lib/python3.9/site-packages/nonebot/internal/params.py", line 162, in _solve return await task File "/root/.cache/pypoetry/virtualenvs/py-plugin-8_cve6GP-py3.9/lib/python3.9/site-packages/nonebot/utils.py", line 114, in _wrapper result = await loop.run_in_executor(None, pfunc) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/root/.cache/pypoetry/virtualenvs/py-plugin-8_cve6GP-py3.9/lib/python3.9/site-packages/nonebot_plugin_pixivbot/protocol_dep/post_dest.py", line 80, in post_destination return context.require(PostDestinationFactoryManager).from_event(bot, event) File "/root/.cache/pypoetry/virtualenvs/py-plugin-8_cve6GP-py3.9/lib/python3.9/site-packages/nonebot_plugin_pixivbot/protocol_dep/post_dest.py", line 76, in from_event return self[get_adapter_name(bot)].from_event(bot, event) File "/root/.cache/pypoetry/virtualenvs/py-plugin-8_cve6GP-py3.9/lib/python3.9/site-packages/nonebot_plugin_pixivbot/protocol_dep/protocol_dep.py", line 33, in getitem return self.require(adapter) File "/root/.cache/pypoetry/virtualenvs/py-plugin-8_cve6GP-py3.9/lib/python3.9/site-packages/nonebot_plugin_pixivbot/protocol_dep/protocol_dep.py", line 29, in require raise RuntimeError(f"暂不支持{adapter}") RuntimeError: 暂不支持oneadapter

用户关注画师无法获取更新订阅

单独订阅画师订阅是可以推送更新的,但是用户关注无法正常推送
也没用任何的报错就很奇怪,是不是我的操作方式不对()
1
2
3

使用功能时ConnectionResetError

01-13 00:53:25 [SUCCESS] nonebot | OneBot V11 3276928870 | [message.group.normal]: Message 275508025 from xx@[群:xx] "看看图 233"
01-13 00:53:25 [ERROR] nonebot_plugin_pixivbot | error <class 'ConnectionResetError'> raised by agen (IMAGE illust_id=233, page=0)
01-13 00:53:25 [WARNING] nonebot_plugin_pixivbot | ConnectionResetError

I@YAF805H9N$QNYCLR4CYLN

内部错误:<class 'pixivpy_async.error.NoTokenError'>No access_token Found!

内部错误:<class 'pixivpy_async.error.NoTokenError'>No access_token Found!
我这边用的zhenxun跑的,因为没有.env.prod,我把token补到.env.dev里了,但是没用。
新建了个.env.prod,写入了,但是也读不到。希望能告诉我一下入口在哪里,我直接填进去。

------------------------------------------------详细报错---------------------------------------------------
`03-13 00:32:30 [INFO] nonebot_plugin_pixivbot | [mediator] user_bookmarks 20017078 cache_strategy=NORMAL
03-13 00:32:30 [INFO] nonebot_plugin_pixivbot | [local] user_bookmarks 20017078
03-13 00:32:30 [INFO] nonebot_plugin_pixivbot | [mediator] no cache
03-13 00:32:30 [INFO] nonebot_plugin_pixivbot | [remote] user_bookmarks 20017078
03-13 00:32:30 [INFO] nonebot_plugin_pixivbot | [remote] got 0 illusts, illust_detail of 0 are missed
03-13 00:32:30 [ERROR] nonebot_plugin_pixivbot | error <class 'pixivpy_async.error.NoTokenError'> raised by agen (USER_BOOKMARKS user_id=20017078)
03-13 00:32:31 [SUCCESS] nonebot | OneBot V11 2712395970 | [message.group.normal]: Message 1179271396 from 972127577@[群:636925153] '[image:file=5f155272ca2c3094afaf7254e276cfda.image, subType=0, url=https://gchat.qpic.cn/gchatpic_new/972127577/636925153-2565612720-5...]'
03-13 00:32:31 [INFO] nonebot | Event will be handled by Matcher(type='message', module=plugins.mute)
03-13 00:32:31 [INFO] nonebot | Event will be handled by Matcher(type='message', module=plugins.black_word)
03-13 00:32:31 [INFO] nonebot | Event will be handled by Matcher(type='message', module=plugins.parse_bilibili_json)
03-13 00:32:31 [INFO] nonebot | Event will be handled by Matcher(type='message', module=basic_plugins.chat_history.chat_message)
03-13 00:32:31 [INFO] nonebot | Matcher(type='message', module=plugins.black_word) running complete
03-13 00:32:31 [INFO] nonebot | Matcher(type='message', module=plugins.parse_bilibili_json) running complete
03-13 00:32:31 [INFO] nonebot | Matcher(type='message', module=basic_plugins.chat_history.chat_message) running complete
03-13 00:32:31 [INFO] nonebot | Matcher(type='message', module=plugins.mute) running complete
03-13 00:32:31 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_pixivbot.handler.common.random_bookmark) running complete
03-13 00:32:31 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_pixivbot.handler.common.random_bookmark) failed.
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\data\pixiv_repo\mediator.py", line 164, in mediate_append
async for x in _load_many_from_local_and_remote_and_append(cache_factory, remote_factory, query_kwargs,
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\data\pixiv_repo\mediator.py", line 57, in _load_many_from_local_and_remote_and_append
async for x in cache_factory(**query_kwargs):
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\data\pixiv_repo\local_repo\sql.py", line 473, in user_bookmarks
async for x in self._get_illusts(session, "user_bookmarks", {"user_id": user_id},
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\data\pixiv_repo\local_repo\sql.py", line 71, in _get_illusts
raise NoSuchItemError()
nonebot_plugin_pixivbot.data.pixiv_repo.errors.NoSuchItemError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\zhenxun_bot-main\zhenxun_bot-main\bot.py", line 27, in
nonebot.run()
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_init_.py", line 273, in run
get_driver().run(*args, **kwargs)
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot\drivers\fastapi.py", line 187, in run
uvicorn.run(
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\uvicorn\main.py", line 569, in run
server.run()
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\uvicorn\server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 628, in run_until_complete
self.run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_events.py", line 316, in run_forever
super().run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 595, in run_forever
self._run_once()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1881, in _run_once
handle._run()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot\message.py", line 141, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)

File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot\message.py", line 187, in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot\internal\matcher\matcher.py", line 732, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot\internal\matcher\matcher.py", line 707, in simple_run
await handler(
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot\dependencies_init
.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\handler\common\random_bookmark.py", line 46, in on_match
await self.handle(count=get_count(state), post_dest=get_post_dest(bot, event))
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\handler\base.py", line 95, in handle
await self.interceptor.intercept(self._parse_args_and_actual_handle, *args,
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\combined_interceptor.py", line 56, in intercept
await self.x.intercept(
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\combined_interceptor.py", line 56, in intercept
await self.x.intercept(
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\combined_interceptor.py", line 56, in intercept
await self.x.intercept(
[Previous line repeated 2 more times]
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\default_error_interceptor.py", line 36, in intercept
raise e # 重新抛出,让上层可以处理(如scheduler中需要处理Handler的异常)
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\default_error_interceptor.py", line 22, in intercept
await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\timeout_interceptor.py", line 21, in intercept
await wait_for(wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs),
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 447, in wait_for
return fut.result()
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\retry_interceptor.py", line 32, in intercept
raise e
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\retry_interceptor.py", line 26, in intercept
return await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\loading_prompt_interceptor.py", line 33, in intercept
await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\service_interceptor.py", line 35, in intercept
await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\record_req_interceptor.py", line 20, in intercept
await wrapped_func(*args, post_dest=post_dest, silently=silently, **kwargs)
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\handler\base.py", line 126, in _parse_args_and_actual_handle
await self.actual_handle(post_dest=post_dest, silently=silently, **kwargs)
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\handler\common\random_bookmark.py", line 81, in actual_handle
illusts = await self.service.random_bookmark(pixiv_user_id, count=count,
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\service\pixiv_service.py", line 119, in random_bookmark
illusts = [x async for x in self.repo.user_bookmarks(pixiv_user_id)]
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\service\pixiv_service.py", line 119, in
illusts = [x async for x in self.repo.user_bookmarks(pixiv_user_id)]
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\data\pixiv_repo\mediator_repo.py", line 275, in user_bookmarks
async for x in gen:
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\utils\shared_agen.py", line 63, in _generator
raise e
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\utils\shared_agen.py", line 55, in _generator
new_data = await self._origin.anext()
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\data\pixiv_repo\mediator.py", line 169, in mediate_append
async for x in _load_many_from_remote_and_append(remote_factory, query_kwargs,
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\data\pixiv_repo\mediator.py", line 91, in _load_many_from_remote_and_append
async for item in remote_factory(**query_kwargs):
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\data\pixiv_repo\remote_repo.py", line 242, in _get_illusts
async for page, metadata in self._load_many_pages(papi_search_func, "illusts",
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\data\pixiv_repo\remote_repo.py", line 190, in _load_many_pages
page, metadata = await self._load_page(papi_search_func, element_list_name, mapper=mapper,
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\data\pixiv_repo\remote_repo.py", line 156, in _load_page
raw_result = await self.load_raw_page(papi_search_func, **kwargs)
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\nonebot_plugin_pixivbot\data\pixiv_repo\remote_repo.py", line 138, in load_raw_page
raw_result = await papi_search_func(**kwargs)
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\pixivpy_async\aapi.py", line 217, in user_bookmarks_illust
return await self.requests
(method=method, url=url, params=params, auth=req_auth)
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-wJE_wHbX-py3.10\lib\site-packages\pixivpy_async\bapi.py", line 48, in requests

raise NoTokenError
pixivpy_async.error.NoTokenError: No access_token Found!`

--------------------截图----------------------
image

麻烦帮忙看一下,虽然不解决也没事。

希望能应对某种程度的TIMEOUT错误提供后台重试

01-06 18:43:56 [SUCCESS] nonebot | OneBot V11 3429318375 | [message.group.normal]: Message -1637898823 from 415662910@[群:783759481] "来张图"
01-06 18:43:56 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_pixivbot.handler.common.random_recommended_illust)
01-06 18:43:56 [INFO] nonebot_plugin_pixivbot | [mediator] recommended_illusts cache_strategy=NORMAL
01-06 18:43:56 [INFO] nonebot_plugin_pixivbot | [pixiv_service] choice [98288870]
01-06 18:43:56 [INFO] nonebot_plugin_pixivbot | [mediator] image 98288870 cache_strategy=NORMAL
01-06 18:43:56 [INFO] nonebot_plugin_pixivbot | [local] image 98288870
01-06 18:43:56 [INFO] nonebot_plugin_pixivbot | [mediator] no cache or cache expired
01-06 18:43:56 [INFO] nonebot_plugin_pixivbot | [remote] image 98288870
01-06 18:44:06 [ERROR] nonebot_plugin_pixivbot | error <class 'asyncio.exceptions.TimeoutError'> raised by agen (IMAGE illust_id=98288870)

如题,经常会出现如上错误,不清楚是哪一部分出了问题但是总之它经常这样然后报“网络错误”,代理应当是正常运作的因为还是经常能发出来的,但是出现以上错误就比较尴尬

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.