Giter Club home page Giter Club logo

nonebot-bison's Introduction

Bison

✨ 通用订阅推送插件 ✨

license pypi python black ruff
codecov action pre-commit ruff
📖 官方文档   |   🚀 快速开始   |   💬 讨论交流

简介

一款自动爬取各种站点,社交平台更新动态,并将信息推送到 QQ 的机器人。 基于 NoneBot2 开发(诞生于明日方舟的蹲饼活动)

本项目原名原名 nonebot-hk-reporter

寓意本 Bot 要做全世界跑的最快的搬运机器人,后因名字过于暴力改名

本项目名称来源于明日方舟角色拜松——一名龙门的信使,曾经骑自行车追上骑摩托车的德克萨斯

支持的平台:

  • 微博
  • Bilibili
  • Bilibili 直播
  • RSS
  • 明日方舟
  • 网易云音乐
  • FF14

功能

  • 定时爬取指定网站
  • 通过图片发送文本,防止风控
  • 使用队列限制发送频率
  • 使用网页后台管理 Bot 订阅
  • 使用可以设置权重的调度器按时间调节不同账号的权重

使用方法

!! 注意,如果要使用后台管理功能请使用 pypi 版本或者 docker 版本,如果直接 clone 源代码 需要按下面方式进行 build

cd ./admin-frontend
pnpm && pnpm run build

可以使用 Docker,docker-compose,作为插件安装在 nonebot 中,或者直接运行

在群里 at Bot 或者直接私聊 Bot“添加订阅”,按照提示输入需要订阅的账号,就可以愉快接收消息了。

参考文档

FAQ

  1. 报错TypeError: 'type' object is not subscriptable
    本项目使用了 Python 3.10 的语法,请将 Python 版本升级到 3.10 及以上,推荐使用 docker 部署
  2. bot 不理我
    请确认自己是群主或者管理员,并且检查COMMAND_START环境变量是否设为[""] 或者按照COMMAND_START中的设置添加命令前缀,例: COMMAND_START=["/"]则应发送/添加订阅
  3. 微博漏订阅了 微博更新了新的风控措施,某些含有某些关键词的微博会获取不到。
  4. 无法使用后台管理页面
    1. 确认自己正确配置了 nonebot 的端口,如果在远程或容器外访问网页请确保HOST=0.0.0.0
    2. 确认自己的云服务器的防火墙配置正确
    3. 确认自己使用了正确的方法安装插件

参与开发

欢迎各种 PR,参与开发本插件很简单,只需要对相应平台完成几个接口的编写就行。你只需要一点简单的爬虫知识就行。

如果对整体框架有任何意见或者建议,欢迎 issue。

鸣谢

License

MIT

nonebot-bison's People

Contributors

azidecupric avatar dependabot[bot] avatar felinae98 avatar github-actions[bot] avatar gugumur avatar he0119 avatar kexue-z avatar komoridev avatar lambdayh avatar meetwq avatar panda361 avatar pre-commit-ci[bot] avatar sherkeyxd avatar sichongzou avatar ukmeng avatar zzz6839 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  avatar  avatar

Watchers

 avatar  avatar

nonebot-bison's Issues

部分 RSS 站点需要 user-agent 才能访问

比如 https://blogs.windows.com/feed/

import asyncio
import httpx

async def main():
    async with httpx.AsyncClient() as client:
        r = await client.get("https://blogs.windows.com/feed/")
        print(r.status_code)
        print(r.content)

asyncio.run(main())

运行结果为

403
b'<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n'

Ubuntu系统无法安装pip包nonebot-bison

报错如下:
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
/usr/local/lib/python3.8/dist-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: 0.23ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/share/python-wheels/urllib3-1.25.8-py2.py3-none-any.whl/urllib3/connectionpool.py:999: InsecureRequestWarning: Unverified HTTPS request is being made to host 'mirrors.aliyun.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
ERROR: Could not find a version that satisfies the requirement nonebot-bison (from versions: none)
ERROR: No matching distribution found for nonebot-bison

以及手动引入插件出现插件丢失:ModuleNotFoundError: No module named 'socketio'(可能是因为我没有安装这个nonobot-bison的原因?)

bilibili 平台订阅失效·

log

2022-04-15 19:23:26.939 | ERROR    | apscheduler:run_coroutine_job:36 - Job "fetch_and_send (trigger: interval[0:00:10], next run at: 2022-04-15 19:23:36 CST)" raised an exception
Traceback (most recent call last):

  File "/data1/my_bot/bot.py", line 29, in <module>
    nonebot.run()
    │       └ <function run at 0x7fc5561725e0>
    └ <module 'nonebot' from '/root/.cache/pypoetry/virtualenvs/dao-bot-uA4zZmZU-py3.9/lib/python3.9/site-packages/nonebot/__init__...

  File "/root/.cache/pypoetry/virtualenvs/dao-bot-uA4zZmZU-py3.9/lib/python3.9/site-packages/nonebot/__init__.py", line 258, in run
    get_driver().run(*args, **kwargs)
    │                 │       └ {}
    │                 └ ()
    └ <function get_driver at 0x7fc557c4df70>
  File "/root/.cache/pypoetry/virtualenvs/dao-bot-uA4zZmZU-py3.9/lib/python3.9/site-packages/nonebot/drivers/fastapi.py", line 168, in run
    uvicorn.run(
    │       └ <function run at 0x7fc555b64f70>
    └ <module 'uvicorn' from '/root/.cache/pypoetry/virtualenvs/dao-bot-uA4zZmZU-py3.9/lib/python3.9/site-packages/uvicorn/__init__...
  File "/root/.cache/pypoetry/virtualenvs/dao-bot-uA4zZmZU-py3.9/lib/python3.9/site-packages/uvicorn/main.py", line 463, in run
    server.run()
    │      └ <function Server.run at 0x7fc555b6e160>
    └ <uvicorn.server.Server object at 0x7fc53d5c1ac0>
  File "/root/.cache/pypoetry/virtualenvs/dao-bot-uA4zZmZU-py3.9/lib/python3.9/site-packages/uvicorn/server.py", line 60, in run
    return asyncio.run(self.serve(sockets=sockets))
           │       │   │    │             └ None
           │       │   │    └ <function Server.serve at 0x7fc555b6e1f0>
           │       │   └ <uvicorn.server.Server object at 0x7fc53d5c1ac0>
           │       └ <function run at 0x7fc557393550>
           └ <module 'asyncio' from '/root/miniconda3/lib/python3.9/asyncio/__init__.py'>
  File "/root/miniconda3/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
           │    │                  └ <coroutine object Server.serve at 0x7fc53d669bc0>
           │    └ <method 'run_until_complete' of 'uvloop.loop.Loop' objects>
           └ <uvloop.Loop running=True closed=False debug=False>
> File "/root/.cache/pypoetry/virtualenvs/dao-bot-uA4zZmZU-py3.9/lib/python3.9/site-packages/apscheduler/executors/base_py3.py", line 30, in run_coroutine_job
    retval = await job.func(*job.args, **job.kwargs)
                   │   │     │   │       │   └ <member 'kwargs' of 'Job' objects>
                   │   │     │   │       └ <Job (id=64329fe6c80a42af97a43d7f88b3dc51 name=fetch_and_send)>
                   │   │     │   └ <member 'args' of 'Job' objects>
                   │   │     └ <Job (id=64329fe6c80a42af97a43d7f88b3dc51 name=fetch_and_send)>
                   │   └ <member 'func' of 'Job' objects>
                   └ <Job (id=64329fe6c80a42af97a43d7f88b3dc51 name=fetch_and_send)>
  File "/root/.cache/pypoetry/virtualenvs/dao-bot-uA4zZmZU-py3.9/lib/python3.9/site-packages/nonebot_bison/scheduler.py", line 62, in fetch_and_send
    to_send = await platform_manager[target_type].fetch_new_post(
                    │                └ 'bilibili'
                    └ {'arknights': <nonebot_bison.platform.platform.NoTargetGroup object at 0x7fc544fa5e80>, 'bilibili': <nonebot_bison.platform.b...
  File "/root/.cache/pypoetry/virtualenvs/dao-bot-uA4zZmZU-py3.9/lib/python3.9/site-packages/nonebot_bison/platform/platform.py", line 223, in fetch_new_post
    post_list = await self.get_sub_list(target)
                      │    │            └ '75107062'
                      │    └ <function Bilibili.get_sub_list at 0x7fc53dc7b790>
                      └ <nonebot_bison.platform.bilibili.Bilibili object at 0x7fc53fcfca00>
  File "/root/.cache/pypoetry/virtualenvs/dao-bot-uA4zZmZU-py3.9/lib/python3.9/site-packages/nonebot_bison/platform/bilibili.py", line 50, in get_sub_list
    return res_dict["data"]["cards"]
           └ {'code': 0, 'msg': '', 'message': '', 'data': {'has_more': 0, 'next_offset': 0, '_gt_': 0}}

KeyError: 'cards'

配置文件

{
  "kv": { "1": { "name": "version", "value": 2 } },
  "user_target": {
    "1": {
      "user": xxxx,
      "user_type": "group",
      "subs": [
         {
          "target": "396395171",
          "target_type": "bilibili",
          "target_name": "Lee\u54e5\u7684\u6e38\u620f\u5f00\u53d1\u52a0\u6cb9\u7ad9",
          "cats": [1, 2, 3, 4, 5],
          "tags": []
        },
        {
          "target": "75107062",
          "target_type": "bilibili",
          "target_name": "-_-----1",
          "cats": [1, 2, 3, 4, 5],
          "tags": []
        }
      ]
    }
}

配置失败

  • python 3.9.7
  • nonebot2_beta1

.env 配置
bison_use_pic: bool = True
查询订阅指令返回仍是文字消息

plugin_config.py配置
bison_use_pic: bool = True
查询订阅指令返回为图片

请求增加图片合并转发.env文件配置

在nonebot_bison/plugin_config.py里面把init改为1后更新会覆盖掉变回默认的0,能否把这个图片合并转发设置为.env配置文件中的一部分,这样更新就不会恢复原设置了

用组合的形式实现多种类型的订阅

把类型分为两个正交的维度:

  1. 有账号,无账号
  2. 推送行为:
  • NewPost(类似微博)
  • StatusChange(状态改变,开播提醒,撤置顶)
  • PeriodicitySend(日榜推送)

Drop Tinydb,use SQLite

背景

因为本项目较早时确定使用Tinydb~~,而且写的很拉~~,后面发现本项目的储存结构涉及到了多对多的存储关系,现在使用了比较手动的方法去处理这个关系。

目的

  1. 使用ORM确定类型,改变当前混乱的模式
  2. 使用Migration进行数据和数据结构的迁移,为方便迭代后续的需求,提供方便的改表结构的方法
  3. 支持更多更复杂的功能

需要的工作

  • 将当前Tinydb的数据库迁移到新的关系型数据库中,并且进行测试
  • datastore插件集成好migration
  • 写与之配套的调度系统

使用docker运行时偶尔不会自动下载chromium导致无法生成图片

运行环境:docker

这是docker-compose.yaml

services:
  nonebot:
    build: /data/my_bot/nonebot/
    image: xana278/nonebot:amd64
    container_name: nb
    network_mode: host
    volumes:
      - "/etc/localtime:/etc/localtime"
      - "/data/my_bot/nonebot:/nonebot"
    environment: 
      - TIME_ZONE=Asia/Shanghai
    command: sh -c "python bot.py"
    working_dir: /nonebot
    restart: always

这是dockerfile

FROM python

ENV TZ=Asia/Shanghai

RUN python3 -m pip config set global.index-url https://mirrors.aliyun.com/pypi/simple

RUN pip install nb-cli

RUN nb plugin install nonebot_hk_reporter

这是某次运行时的报错1

07-03 22:53:01 [INFO] nonebot_hk_reporter | send to User(user=436802812, user_type='group'): type: bilibili
from: 科学酱是辣鸡
text: 有人吗,我是谁?我要干什么?
url: 有人吗,我是谁?我要干什么?
pic: https://i0.hdslb.com/bfs/album/39e8cd20234fed94f6656fb81268878085ebb175.jpg
Execution of job "fetch_and_send (trigger: interval[0:00:10], next run at: 2021-07-03 22:53:11 CST)" skipped: maximum number of running instances reached (1)
Execution of job "fetch_and_send (trigger: interval[0:00:30], next run at: 2021-07-03 22:53:31 CST)" skipped: maximum number of running instances reached (1)
Job "fetch_and_send (trigger: interval[0:00:10], next run at: 2021-07-03 22:53:41 CST)" raised an exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/apscheduler/executors/base_py3.py", line 30, in run_coroutine_job
    retval = await job.func(*job.args, **job.kwargs)
  File "/usr/local/lib/python3.9/site-packages/nonebot_hk_reporter/scheduler.py", line 41, in fetch_and_send
    send_msgs(bot, user.user, user.user_type, await send_post.generate_messages())
  File "/usr/local/lib/python3.9/site-packages/nonebot_hk_reporter/post.py", line 107, in generate_messages
    msgs.append(await parse_text(text))
  File "/usr/local/lib/python3.9/site-packages/nonebot_hk_reporter/utils.py", line 105, in parse_text
    return await render.text_to_pic_cqcode(text)
  File "/usr/local/lib/python3.9/site-packages/nonebot_hk_reporter/utils.py", line 92, in text_to_pic_cqcode
    data = await self.text_to_pic(text)
  File "/usr/local/lib/python3.9/site-packages/nonebot_hk_reporter/utils.py", line 87, in text_to_pic
    data = await self.render('file://{}'.format(tmp_path), target='div')
  File "/usr/local/lib/python3.9/site-packages/nonebot_hk_reporter/utils.py", line 38, in render
    return await asyncio.wait_for(self.do_render(url, viewport, target, operation), 20)
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 481, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.9/site-packages/nonebot_hk_reporter/utils.py", line 57, in do_render
    self.browser = await launch(args=['--no-sandbox'])
  File "/usr/local/lib/python3.9/site-packages/pyppeteer/launcher.py", line 306, in launch
    return await Launcher(options, **kwargs).launch()
  File "/usr/local/lib/python3.9/site-packages/pyppeteer/launcher.py", line 167, in launch
    self.browserWSEndpoint = get_ws_endpoint(self.url)
  File "/usr/local/lib/python3.9/site-packages/pyppeteer/launcher.py", line 226, in get_ws_endpoint
    raise BrowserError('Browser closed unexpectedly:\n')
pyppeteer.errors.BrowserError: Browser closed unexpectedly:

这是某次运行的报错2

07-03 22:58:04 [INFO] nonebot_hk_reporter | fetch new post from bilibili 4310918: 543252679356877226
07-03 22:58:04 [INFO] nonebot_hk_reporter | send to User(user=436802812, user_type='group'): type: bilibili
from: 科学酱是辣鸡
text: 有人吗,我是谁?我要干什么?[藏狐]
url: 有人吗,我是谁?我要干什么?[藏狐]
pic: https://i0.hdslb.com/bfs/album/e11b17c3c06f819588c09b47632e0ecc9ec273ae.jpg
Job "fetch_and_send (trigger: interval[0:00:10], next run at: 2021-07-03 22:58:13 CST)" raised an exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/apscheduler/executors/base_py3.py", line 30, in run_coroutine_job
    retval = await job.func(*job.args, **job.kwargs)
  File "/usr/local/lib/python3.9/site-packages/nonebot_hk_reporter/scheduler.py", line 41, in fetch_and_send
    send_msgs(bot, user.user, user.user_type, await send_post.generate_messages())
  File "/usr/local/lib/python3.9/site-packages/nonebot_hk_reporter/post.py", line 107, in generate_messages
    msgs.append(await parse_text(text))
  File "/usr/local/lib/python3.9/site-packages/nonebot_hk_reporter/utils.py", line 105, in parse_text
    return await render.text_to_pic_cqcode(text)
  File "/usr/local/lib/python3.9/site-packages/nonebot_hk_reporter/utils.py", line 92, in text_to_pic_cqcode
    data = await self.text_to_pic(text)
  File "/usr/local/lib/python3.9/site-packages/nonebot_hk_reporter/utils.py", line 87, in text_to_pic
    data = await self.render('file://{}'.format(tmp_path), target='div')
  File "/usr/local/lib/python3.9/site-packages/nonebot_hk_reporter/utils.py", line 38, in render
    return await asyncio.wait_for(self.do_render(url, viewport, target, operation), 20)
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 481, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.9/site-packages/nonebot_hk_reporter/utils.py", line 55, in do_render
    self.browser = await launch(executablePath='/usr/bin/chromium', args=['--no-sandbox'])
  File "/usr/local/lib/python3.9/site-packages/pyppeteer/launcher.py", line 306, in launch
    return await Launcher(options, **kwargs).launch()
  File "/usr/local/lib/python3.9/site-packages/pyppeteer/launcher.py", line 147, in launch
    self.proc = subprocess.Popen(  # type: ignore
  File "/usr/local/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/chromium'

临时解决办法

这样操作之后还能不能用

docker exec -it nb python
Python 3.9.5 (default, Jun 23 2021, 15:01:51) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyppeteer.chromium_downloader import check_chromium, download_chromium
>>> check_chromium()
False
>>> download_chromium()
[W:pyppeteer.chromium_downloader] start chromium download.
Download may take a few minutes.
100%|█████████████████████████████| 108773488/108773488 [00:01<00:00, 66771487.58it/s]
[W:pyppeteer.chromium_downloader] 
chromium download done.
[W:pyppeteer.chromium_downloader] chromium extracted to: /root/.local/share/pyppeteer/local-chromium/588429
>>> check_chromium()
True

希望添加取消命令

如果订阅过程没有进行完毕,一段时间内发送什么消息都会被 bot 回复,希望能够添加取消或者中断的命令。

后台管理增删某个订阅的订阅分类和订阅tag时出现bug

操作:
增删群中订阅账号的订阅分类和订阅Tag
点击OK按钮保存
再次点击编辑按钮
出现该账号信息缺失无法编辑的问题
刷新网页后回复正常
操作过程日志

05-23 15:58:03 [INFO] uvicorn | 118.xx.xx.40:42619 - "GET /bison/api/target_name?platformName=bilibili&target=35067xx HTTP/1.1" 200
05-23 15:58:20 [INFO] uvicorn | 118.xx.xx.40:36085 - "GET /bison/api/target_name?platformName=bilibili&target=35067xx HTTP/1.1" 200
05-23 15:58:21 [INFO] src | Deleting []
05-23 15:58:21 [INFO] uvicorn | 118.xx.xx.40:36085 - "POST /bison/api/subs?groupNumber=606489xxx HTTP/1.1" 200`
05-23 15:58:21 [INFO] uvicorn | 118.xx.xx.40:36085 - "GET /bison/api/subs HTTP/1.1" 200
05-23 15:58:52 [INFO] uvicorn | 118.xx.xx.40:40483 - "GET /bison/api/target_name?platformName=bilibili&target=35067xxx HTTP/1.1" 200
05-23 15:58:52 [INFO] src | Deleting []
05-23 15:58:52 [INFO] uvicorn | 118.xx.xx.40:40483 - "PATCH /bison/api/subs?groupNumber=606489xxx HTTP/1.1" 200
05-23 15:58:53 [INFO] uvicorn | 118.xx.xx.40:40483 - "GET /bison/api/subs HTTP/1.1" 200
05-23 15:59:02 [INFO] uvicorn | 118.xx.xx.40:45629 - "GET /bison/api/target_name HTTP/1.1" 422
刷新
05-23 16:05:22 [INFO] uvicorn | 118.xx.xx.40:43403 - "GET /admin HTTP/1.1" 304
05-23 16:05:22 [INFO] uvicorn | 118.xx.xx.40:43403 - "GET /bison/api/global_conf HTTP/1.1" 200
05-23 16:05:23 [INFO] uvicorn | 118.xx.xx.40:43403 - "GET /bison/api/subs HTTP/1.1" 200

订阅经常超时

里面的订阅地址都是可以直接访问的,而且机器人的服务器也在国外,在自己的windows跑也是经常超时,确定了不是本机网络的问题。不知道是不是代码有BUG或者是不是需要安装nonebot的httpx驱动器?
可供测试的RSS订阅有:
https://sora39.tk/hpoi/info/all
https://sora39.tk/pixiv/ranking/day
https://rsshub.app/hpoi/info/all
https://rsshub.app/pixiv/ranking/day
同时在我的服务器观察到大量的访问,插件却没有发送消息,一直在 with set()

2022-04-21T15:40:55.966646816Z 04-21 23:40:55 [INFO] src | init rss-https://sora39.tk/pixiv/ranking/day with set()

[WARNING] src | network connection error: <class 'httpx.ConnectTimeout'>, url: https://sora39.tk/hpoi/info/all?filter=%25E5%2588%259D%25E9%259F%25B3%25
2022-04-21T15:39:25.414524274Z 04-21 23:39:25 [INFO] src | init ff14-default with {'2022/04/08 16:32:42', '2022/04/14 14:12:49', '2022/04/20 14:53:26', '2022/04/14 12:35:40', '2022/04/20 16:00:59'}
2022-04-21T15:39:31.082844870Z 04-21 23:39:30 [WARNING] nonebot | OneBot V11 | Error when getting message reply info: <ActionFailed data=None, echo={'seq': 1}, msg=MSG_NOT_FOUND, retcode=100, status=failed, wording=消息不存在>
2022-04-21T15:39:31.082948974Z Traceback (most recent call last):
2022-04-21T15:39:31.082961514Z File "/app/bot.py", line 15, in
2022-04-21T15:39:31.082968428Z nonebot.run()
2022-04-21T15:39:31.082974713Z File "/usr/local/lib/python3.9/site-packages/nonebot/init.py", line 258, in run
2022-04-21T15:39:31.082980862Z get_driver().run(*args, **kwargs)
2022-04-21T15:39:31.083003785Z File "/usr/local/lib/python3.9/site-packages/nonebot/drivers/fastapi.py", line 168, in run
2022-04-21T15:39:31.083011093Z uvicorn.run(
2022-04-21T15:39:31.083016407Z File "/usr/local/lib/python3.9/site-packages/uvicorn/main.py", line 463, in run
2022-04-21T15:39:31.083022230Z server.run()
2022-04-21T15:39:31.083027610Z File "/usr/local/lib/python3.9/site-packages/uvicorn/server.py", line 60, in run
2022-04-21T15:39:31.083033430Z return asyncio.run(self.serve(sockets=sockets))
2022-04-21T15:39:31.083038853Z File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
2022-04-21T15:39:31.083147771Z return loop.run_until_complete(main)
2022-04-21T15:39:31.083175597Z File "/usr/local/lib/python3.9/site-packages/nonebot/adapters/onebot/v11/bot.py", line 212, in handle_event
2022-04-21T15:39:31.083181765Z await _check_reply(self, event)
2022-04-21T15:39:31.083186797Z > File "/usr/local/lib/python3.9/site-packages/nonebot/adapters/onebot/v11/bot.py", line 31, in _check_reply
2022-04-21T15:39:31.083192371Z event.reply = Reply.parse_obj(await bot.get_msg(message_id=msg_seg.data["id"]))
2022-04-21T15:39:31.083197778Z File "/usr/local/lib/python3.9/site-packages/nonebot/adapters/onebot/v11/bot.py", line 208, in call_api
2022-04-21T15:39:31.083203049Z return await super().call_api(api, **data)
2022-04-21T15:39:31.083207986Z File "/usr/local/lib/python3.9/site-packages/nonebot/internal/adapter/bot.py", line 117, in call_api
2022-04-21T15:39:31.083213417Z raise exception
2022-04-21T15:39:31.083218360Z File "/usr/local/lib/python3.9/site-packages/nonebot/internal/adapter/bot.py", line 94, in call_api
2022-04-21T15:39:31.083223579Z result = await self.adapter._call_api(self, api, **data)
2022-04-21T15:39:31.083228531Z File "/usr/local/lib/python3.9/site-packages/nonebot/adapters/onebot/v11/adapter.py", line 107, in _call_api
2022-04-21T15:39:31.083233736Z return _handle_api_result(
2022-04-21T15:39:31.083256425Z File "/usr/local/lib/python3.9/site-packages/nonebot/adapters/onebot/v11/utils.py", line 81, in _handle_api_result
2022-04-21T15:39:31.083262336Z raise ActionFailed(**result)
2022-04-21T15:39:31.083267434Z nonebot.adapters.onebot.v11.exception.ActionFailed: <ActionFailed data=None, echo={'seq': 1}, msg=MSG_NOT_FOUND, retcode=100, status=failed, wording=消息不存在>
2022-04-21T15:39:37.221257032Z 04-21 23:39:37 [INFO] src | init rss-https://sora39.tk/epicgames/freegames with {'https://www.epicgames.com/store/zh-CN/product/null', 'https://www.epicgames.com/store/zh-CN/product/amnesia-rebirth'}
2022-04-21T15:39:56.572646813Z 04-21 23:39:56 [INFO] src | init rss-https://sora39.tk/pixiv/search/miku/popular/safe with set()
2022-04-21T15:40:26.107872209Z 04-21 23:40:26 [INFO] src | init rss-https://sora39.tk/pixiv/search/%E5%88%9D%E9%9F%B3%E3%83%9F%E3%82%AF/popular/safe with set()
2022-04-21T15:40:55.966646816Z 04-21 23:40:55 [INFO] src | init rss-https://sora39.tk/pixiv/ranking/day with set()
2022-04-21T15:41:03.548357526Z 04-21 23:41:03 [WARNING] uvicorn | Invalid HTTP request received.
2022-04-21T15:41:03.548494384Z Traceback (most recent call last):
2022-04-21T15:41:03.548505145Z File "/app/bot.py", line 15, in
2022-04-21T15:41:03.548598924Z nonebot.run()
2022-04-21T15:41:03.548618158Z File "/usr/local/lib/python3.9/site-packages/nonebot/init.py", line 258, in run
2022-04-21T15:41:03.548631014Z get_driver().run(*args, **kwargs)
2022-04-21T15:41:03.548647859Z File "/usr/local/lib/python3.9/site-packages/nonebot/drivers/fastapi.py", line 168, in run
2022-04-21T15:41:03.548657803Z uvicorn.run(
2022-04-21T15:41:03.548669384Z File "/usr/local/lib/python3.9/site-packages/uvicorn/main.py", line 463, in run
2022-04-21T15:41:03.548680185Z server.run()
2022-04-21T15:41:03.548691933Z File "/usr/local/lib/python3.9/site-packages/uvicorn/server.py", line 60, in run
2022-04-21T15:41:03.548701075Z return asyncio.run(self.serve(sockets=sockets))
2022-04-21T15:41:03.548712285Z File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
2022-04-21T15:41:03.548724394Z return loop.run_until_complete(main)
2022-04-21T15:41:03.548733803Z > File "/usr/local/lib/python3.9/site-packages/uvicorn/protocols/http/httptools_impl.py", line 124, in data_received
2022-04-21T15:41:03.548748330Z self.parser.feed_data(data)
2022-04-21T15:41:03.548758129Z File "httptools/parser/parser.pyx", line 212, in httptools.parser.parser.HttpParser.feed_data
2022-04-21T15:41:03.548768467Z httptools.parser.errors.HttpParserInvalidMethodError: Invalid method encountered
2022-04-21T15:41:25.918034547Z 04-21 23:41:25 [INFO] src | init rss-https://sora39.tk/pixiv/ranking/week with set()
2022-04-21T15:41:57.572604045Z 04-21 23:41:57 [INFO] src | init rss-https://sora39.tk/hpoi/info/hobby with set()
2022-04-21T15:42:24.881841095Z 04-21 23:42:24 [INFO] src | init rss-https://rsshub.app/pixiv/ranking/day with set()
2022-04-21T15:42:54.547607727Z 04-21 23:42:54 [INFO] src | init rss-https://rsshub.app/bilibili/user/dynamic/32893337 with set()
2022-04-21T15:43:35.784236747Z 04-21 23:43:35 [WARNING] src | network connection error: <class 'httpx.ConnectTimeout'>, url: https://sora39.tk/bilibili/user/dynamic/32893337
2022-04-21T15:44:04.820116935Z 04-21 23:44:04 [WARNING] src | network connection error: <class 'httpx.ConnectTimeout'>, url: https://sora39.tk/hpoi/info/all?filter=%25E5%2588%259D%25E9%259F%25B3%25
2022-04-21T15:48:25.763739428Z 04-21 23:48:25 [INFO] src | init rss-https://sora39.tk/bilibili/user/dynamic/32893337 with set()
2022-04-21T15:49:05.049896182Z 04-21 23:49:05 [WARNING] src | network connection error: <class 'httpx.ReadTimeout'>, url: https://sora39.tk/hpoi/info/all?filter=%25E5%2588%259D%25E9%259F%25B3%25
2022-04-21T15:53:56.354409118Z 04-21 23:53:56 [INFO] src | init rss-https://sora39.tk/hpoi/info/all?filter=%E5%88%9D%E9%9F%B3% with set()
2022-04-21T16:14:04.408967401Z Execution of job "fetch_and_send (trigger: interval[0:00:10], next run at: 2022-04-22 00:14:04 CST)" skipped: maximum number of running instances reached (1)
2022-04-21T16:14:05.771361972Z 04-22 00:14:05 [WARNING] src | network connection error: <class 'httpx.ReadTimeout'>, url: https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/space_history?host_uid=32893337&offset=0&need_top=0

希望支持设置代理

希望能添加代理的选项,因为给整个机器人全局代理往往会出别的问题

更进一步,或许可以设置某个订阅是否使用代理

bot无法加载图片

import nonebot
from pydantic import BaseSettings

这是原代码
class PlugConfig(BaseSettings):

bison_config_path: str = ""
bison_use_pic: bool = False
bison_init_filter: bool = True
bison_use_queue: bool = True
bison_outer_url: str = "http://localhost:8080/bison/"
bison_filter_log: bool = False
bison_to_me: bool = True
bison_skip_browser_check: bool = False
bison_use_pic_merge: int = 1  # 多图片时启用图片合并转发(仅限群),当bison_use_queue为False时该配置不会生效
# 0:不启用;1:首条消息单独发送,剩余照片合并转发;2以及以上:所有消息全部合并转发
bison_resend_times: int = 0

class Config:
    extra = "ignore"

global_config = nonebot.get_driver().config
plugin_config = PlugConfig(**global_config.dict())

如果用本地那个代码要怎么写?带BISON_BROWSER:吗?写在env里吗
如果用镜像内自带的浏览器,要怎么弄呢?请教下
image

后台管理不支持驱动器 Mixin

如果驱动器为 ~fastapi+~httpx+~websockets,将无法使用后台管理网页。

05-19 15:26:17 [WARNING] nonebot_bison | Driver fastapi+httpx+websockets not supported

bug:sslerror

运行一段时间就会报这个错,但不知道有什么影响
[ERROR] apscheduler | Job "fetch_and_send (trigger: interval[0:00:03], next run at: 2022-05-23 13:22:09 CST)" raised an exception
Traceback (most recent call last):
File "c:\users\administrator\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\administrator\appdata\local\programs\python\python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\Administrator\Desktop\nonebot\venv\Scripts\nb.exe_main
.py", line 7, in
sys.exit(main())
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\click\core.py", line 1130, in call
return self.main(*args, **kwargs)
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\click\core.py", line 1055, in main
rv = self.invoke(ctx)
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\click\core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\click\core.py", line 760, in invoke
return _callback(*args, **kwargs)
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\nb_cli\commands\main.py", line 30, in run
run_bot(file, app)
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\nb_cli\handlers\deploy.py", line 24, in run_bot
nonebot.run(app=f"{module_name}:{app}")
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\nonebot_init
.py", line 258, in run
get_driver().run(*args, **kwargs)
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\nonebot\drivers\fastapi.py", line 168, in run
uvicorn.run(
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\uvicorn\main.py", line 463, in run
server.run()
File "C:\Users\Administrator\Desktop\nonebot\venv\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\python39\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "c:\users\administrator\appdata\local\programs\python\python39\lib\asyncio\base_events.py", line 629, in run_until_complete
self.run_forever()
File "c:\users\administrator\appdata\local\programs\python\python39\lib\asyncio\windows_events.py", line 316, in run_forever
super().run_forever()
File "c:\users\administrator\appdata\local\programs\python\python39\lib\asyncio\base_events.py", line 596, in run_forever
self._run_once()
File "c:\users\administrator\appdata\local\programs\python\python39\lib\asyncio\base_events.py", line 1890, in _run_once
handle._run()
File "c:\users\administrator\appdata\local\programs\python\python39\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)

File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\apscheduler\executors\base_py3.py", line 30, in run_coroutine_job
retval = await job.func(*job.args, **job.kwargs)
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\nonebot_bison\scheduler.py", line 62, in fetch_and_send
to_send = await platform_manager[target_type].fetch_new_post(
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\nonebot_bison\platform\platform.py", line 223, in fetch_new_post
post_list = await self.get_sub_list(target)
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\nonebot_bison\platform\weibo.py", line 47, in get_sub_list
res = await client.get(
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\httpx_client.py", line 1729, in get
return await self.request(
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\httpx_client.py", line 1506, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\httpx_client.py", line 1593, in send
response = await self._send_handling_auth(
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\httpx_client.py", line 1621, in _send_handling_auth
response = await self._send_handling_redirects(
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\httpx_client.py", line 1658, in _send_handling_redirects
response = await self._send_single_request(request)
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\httpx_client.py", line 1695, in _send_single_request
response = await transport.handle_async_request(request)
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\httpx_transports\default.py", line 353, in handle_async_request
resp = await self._pool.handle_async_request(req)
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\httpcore_async\connection_pool.py", line 253, in handle_async_request
raise exc
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\httpcore_async\connection_pool.py", line 237, in handle_async_request
response = await connection.handle_async_request(request)
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\httpcore_async\connection.py", line 86, in handle_async_request
raise exc
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\httpcore_async\connection.py", line 63, in handle_async_request
stream = await self._connect(request)
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\httpcore_async\connection.py", line 150, in _connect
stream = await stream.start_tls(**kwargs)
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\httpcore\backends\asyncio.py", line 72, in start_tls
raise exc
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\httpcore\backends\asyncio.py", line 63, in start_tls
ssl_stream = await anyio.streams.tls.TLSStream.wrap(
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\anyio\streams\tls.py", line 122, in wrap
await wrapper._call_sslobject_method(ssl_object.do_handshake)
File "C:\Users\Administrator\Desktop\nonebot\venv\lib\site-packages\anyio\streams\tls.py", line 130, in _call_sslobject_method
result = func(*args)
File "c:\users\administrator\appdata\local\programs\python\python39\lib\ssl.py", line 944, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: BAD_SIGNATURE] bad signature (_ssl.c:1123)

nonebot2 a15 更新支持

希望更新软件来适配a15
在使用docker build安装软件时出现软件包版本不匹配的问题 希望更新

关于代理问题

当订阅需要代理的rss链接时该怎么开启代理?请问能加个选项吗?

希望能添加私聊推送

Bot 被风控时候大部分群聊消息都发不出去,是否会考虑加入私聊订阅和推送功能呢。

自动下载chrome时SSL报错

通过nonebot安装的插件
已设置变量HK_REPORTER_USE_LOCAL为true解决

以下是日志

06-18 12:19:52 [INFO] nonebot | Running NoneBot...
06-18 12:19:52 [DEBUG] nonebot | Loaded adapters: cqhttp
06-18 12:19:52 [INFO] uvicorn | Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
06-18 12:19:52 [INFO] uvicorn | Started reloader process [4180] using watchgod
06-18 12:19:53 [INFO] nonebot | NoneBot is initializing...
06-18 12:19:53 [INFO] nonebot | Current Env: dev
06-18 12:19:53 [DEBUG] nonebot | Loaded Config: {'driver': 'nonebot.drivers.fastapi', 'host': IPv4Address('127.0.0.1'), 'port': 8080, 'debug': True, 'api_root': {}, 'api_timeout': 30.0, 'access_token': None, 'secret': None, 'superusers': set(), 'nickname': set(), 'command_start': {'/'}, 'command_sep': {'.'}, 'session_expire_timeout': datetime.timedelta(seconds=120), 'environment': 'dev'}
06-18 12:19:53 [DEBUG] nonebot | Succeeded to load adapter "cqhttp"
06-18 12:19:53 [INFO] nonebot | Succeeded to import "nonebot.plugins.echo"
[W:pyppeteer.chromium_downloader] start chromium download.
Download may take a few minutes.
06-18 12:19:54 [ERROR] nonebot | Failed to import "nonebot_hk_reporter"
Traceback (most recent call last):
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\urllib3\connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\urllib3\connectionpool.py", line 1010, in validate_conn
conn.connect()
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\urllib3\connection.py", line 411, in connect
self.sock = ssl_wrap_socket(
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\urllib3\util\ssl
.py", line 449, in ssl_wrap_socket
ssl_sock = ssl_wrap_socket_impl(
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\urllib3\util\ssl
.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "c:\users\administrator\appdata\local\programs\python\python39\lib\ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "c:\users\administrator\appdata\local\programs\python\python39\lib\ssl.py", line 1040, in _create
self.do_handshake()
File "c:\users\administrator\appdata\local\programs\python\python39\lib\ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

在Nonebot插件广场无法安装,直接克隆运行不正常

Nonebot插件广场安装显示
PS C:\Users\Administrator\PRTS> nb plugin install nonebot_hk_reporter
ERROR: Could not find a version that satisfies the requirement nonebot-hk-reporter
ERROR: No matching distribution found for nonebot-hk-reporter
python已为最新版,pip已为最新版

直接克隆下来运行显示
02-26 16:35:27 [INFO] uvicorn | ('127.0.0.1', 60395) - "WebSocket /cqhttp/ws" [accepted]
02-26 16:35:27 [INFO] nonebot | WebSocket Connection from CQHTTP Bot 34067 Accepted!
02-26 16:36:16 [INFO] nonebot | CQHTTP 3403117467 | [message.group.normal]: Message 682
46 from 284
****647@[群:1045****72] "添加订阅"
02-26 16:36:16 [DEBUG] nonebot | Checking for matchers in priority 1...
02-26 16:36:16 [DEBUG] nonebot | Checking for matchers in priority 5...

群里@bot无响应

完整情况
PS C:\Users\Administrator\PRTS> nb run
02-26 16:34:50 [INFO] nonebot | NoneBot is initializing...
02-26 16:34:50 [INFO] nonebot | Current Env: dev
02-26 16:34:50 [DEBUG] nonebot | Loaded Config: {'driver': 'nonebot.drivers.fastapi', 'host': IPv4Address('127.0.0.1'),
'port': 8080, 'debug': True, 'api_root': {}, 'api_timeout': 30.0, 'access_token': None, 'secret': None, 'superusers': se
t(), 'nickname': set(), 'command_start': {''}, 'command_sep': {'.'}, 'session_expire_timeout': datetime.timedelta(second
s=120), 'environment': 'dev'}
02-26 16:34:50 [DEBUG] nonebot | Succeeded to load adapter "cqhttp"
02-26 16:34:50 [INFO] nonebot | Succeeded to import "nonebot.plugins.echo"
02-26 16:34:50 [INFO] nonebot | Succeeded to import "auto_agree"
02-26 16:34:50 [ERROR] nonebot | Failed to import "hk_reporter"
Traceback (most recent call last):
File "c:\program files\python\lib\runpy.py", line 194, in _run_module_as_main
return run_code(code, main_globals, None,
File "c:\program files\python\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Program Files\python\Scripts\nb.exe_main
.py", line 7, in
File "c:\program files\python\lib\site-packages\click\core.py", line 829, in call
return self.main(*args, **kwargs)
File "c:\program files\python\lib\site-packages\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "c:\program files\python\lib\site-packages\click\core.py", line 1259, in invoke
return process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\program files\python\lib\site-packages\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\program files\python\lib\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "c:\program files\python\lib\site-packages\nb_cli_init
.py", line 46, in run
run_bot(file, app)
File "c:\program files\python\lib\site-packages\nb_cli\handlers.py", line 44, in run_bot
module = importlib.import_module(module_name)
File "c:\program files\python\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File ".\bot.py", line 11, in
nonebot.load_plugins('src/plugins')
File "c:\program files\python\lib\site-packages\nonebot\plugin.py", line 1044, in load_plugins
result = context.run(_load_plugin, module_info)

File "c:\program files\python\lib\site-packages\nonebot\plugin.py", line 1028, in _load_plugin
module = _load(spec)
File "", line 702, in _load
File "", line 671, in load_unlocked
File "", line 783, in exec_module
File "", line 219, in call_with_frames_removed
File "src/plugins\hk_reporter_init
.py", line 3, in
from . import config_manager
File "src/plugins\hk_reporter\config_manager.py", line 10, in
from .platform import platform_manager
File "src/plugins\hk_reporter\platform_init
.py", line 1, in
from .bilibili import Bilibili
File "src/plugins\hk_reporter\platform\bilibili.py", line 7, in
from ..post import Post
File "src/plugins\hk_reporter\post.py", line 12, in
class Post:
File "src/plugins\hk_reporter\post.py", line 21, in Post
pics: list[str] = field(default_factory=list)
TypeError: 'type' object is not subscriptable
02-26 16:34:50 [INFO] nonebot | Succeeded to import "nonebot_plugin_apscheduler"
02-26 16:34:50 [INFO] nonebot | Running NoneBot...
02-26 16:34:50 [DEBUG] nonebot | Loaded adapters: cqhttp
02-26 16:34:50 [INFO] uvicorn | Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
02-26 16:34:50 [INFO] uvicorn | Started reloader process [1224] using statreload
02-26 16:34:51 [INFO] nonebot | NoneBot is initializing...
02-26 16:34:51 [INFO] nonebot | Current Env: dev
02-26 16:34:51 [DEBUG] nonebot | Loaded Config: {'driver': 'nonebot.drivers.fastapi', 'host': IPv4Address('127.0.0.1'),
'port': 8080, 'debug': True, 'api_root': {}, 'api_timeout': 30.0, 'access_token': None, 'secret': None, 'superusers': se
t(), 'nickname': set(), 'command_start': {''}, 'command_sep': {'.'}, 'session_expire_timeout': datetime.timedelta(second
s=120), 'environment': 'dev'}
02-26 16:34:51 [DEBUG] nonebot | Succeeded to load adapter "cqhttp"
02-26 16:34:51 [INFO] nonebot | Succeeded to import "nonebot.plugins.echo"
02-26 16:34:51 [INFO] nonebot | Succeeded to import "auto_agree"
02-26 16:34:51 [ERROR] nonebot | Failed to import "hk_reporter"
Traceback (most recent call last):
File "", line 1, in
File "c:\program files\python\lib\multiprocessing\spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "c:\program files\python\lib\multiprocessing\spawn.py", line 129, in _main
return self._bootstrap(parent_sentinel)
File "c:\program files\python\lib\multiprocessing\process.py", line 315, in _bootstrap
self.run()
File "c:\program files\python\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "c:\program files\python\lib\site-packages\uvicorn\subprocess.py", line 62, in subprocess_started
target(sockets=sockets)
File "c:\program files\python\lib\site-packages\uvicorn\main.py", line 390, in run
loop.run_until_complete(self.serve(sockets=sockets))
File "c:\program files\python\lib\asyncio\base_events.py", line 603, in run_until_complete
self.run_forever()
File "c:\program files\python\lib\asyncio\base_events.py", line 570, in run_forever
self._run_once()
File "c:\program files\python\lib\asyncio\base_events.py", line 1859, in _run_once
handle._run()
File "c:\program files\python\lib\asyncio\events.py", line 81, in _run
self._context.run(self._callback, *self.args)
File "c:\program files\python\lib\site-packages\uvicorn\main.py", line 397, in serve
config.load()
File "c:\program files\python\lib\site-packages\uvicorn\config.py", line 278, in load
self.loaded_app = import_from_string(self.app)
File "c:\program files\python\lib\site-packages\uvicorn\importer.py", line 20, in import_from_string
module = importlib.import_module(module_str)
File "c:\program files\python\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File ".\bot.py", line 11, in
nonebot.load_plugins('src/plugins')
File "c:\program files\python\lib\site-packages\nonebot\plugin.py", line 1044, in load_plugins
result = context.run(_load_plugin, module_info)
File "c:\program files\python\lib\site-packages\nonebot\plugin.py", line 1028, in _load_plugin
module = _load(spec)
File "", line 702, in _load
File "", line 671, in load_unlocked
File "", line 783, in exec_module
File "", line 219, in call_with_frames_removed
File "src/plugins\hk_reporter_init
.py", line 3, in
from . import config_manager
File "src/plugins\hk_reporter\config_manager.py", line 10, in
from .platform import platform_manager
File "src/plugins\hk_reporter\platform_init
.py", line 1, in
from .bilibili import Bilibili
File "src/plugins\hk_reporter\platform\bilibili.py", line 7, in
from ..post import Post
File "src/plugins\hk_reporter\post.py", line 12, in
class Post:
File "src/plugins\hk_reporter\post.py", line 21, in Post
pics: list[str] = field(default_factory=list)
TypeError: 'type' object is not subscriptable

on_command 和 rule=to_me() 的选择

如果使用了 on_command 就不用使用rule=to_me() 了 因为我的bot需要 commend_start = "/" 才能执行命令

所以就变成了 @bot /添加订阅

能否改为 @bot 添加订阅 或者 /添加订阅 等触发方式

使用nb-cli安装nonebot_bison

安装完成后使用superuser返回的链接可以登录,但是其中的的群不是返回的全部群,是一部分,其他群管理之类的获取的链接提示登录失败

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.