Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Commit

Permalink
适配nonebot2.0.0-beta2和onebot v11 adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
ssttkkl committed Feb 22, 2022
1 parent 39b17df commit eb968b3
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ message:

servers:
- ws-reverse:
universal: ws://bot:8080/cqhttp/ws
universal: ws://bot:8080/onebot/v11/ws
```

再次启动go-cqhttp容器
Expand All @@ -107,7 +107,7 @@ $ docker restart bot-gocq
1. `git clone https://github.com/ssttkkl/PixivBot.git`
2. `git submodule update --init --recursive`
3. `pip install -r requirement.txt`
4. 下载go-cqhttp并配置连接(参考[CQHTTP 协议使用指南 | NoneBot](https://v2.nonebot.dev/guide/cqhttp-guide.html));
4. 安装go-cqhttp,配置连接(参考[配置连接 | NoneBot](https://onebot.adapters.nonebot.dev/docs/guide/setup));
5. 安装MongoDB,创建一个数据库用于保存缓存,并创建一个能够访问该数据库的用户;
6. 在.env.prod中修改配置;
7. `nb run`运行bot。
Expand Down
5 changes: 3 additions & 2 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

import nonebot
from nonebot.adapters.cqhttp import Bot as CQHTTPBot
from nonebot.adapters.onebot.v11 import Adapter as ONEBOT_V11Adapter

# Custom your logger
#
Expand All @@ -18,9 +18,10 @@
app = nonebot.get_asgi()

driver = nonebot.get_driver()
driver.register_adapter("cqhttp", CQHTTPBot)
driver.register_adapter(ONEBOT_V11Adapter)

nonebot.load_from_toml("pyproject.toml")
nonebot.load_plugins("src/plugins")

# Modify some config / config depends on loaded configs
#
Expand Down
17 changes: 8 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,22 @@ authors = []
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.7"
nonebot2 = "^2.0.0.a16"
nb-cli = "^0.5.1"
python = "^3.9"
nonebot2 = "^2.0.0b2"
nb-cli = "^0.6.6"
PixivPy-Async = "^1.2.13"
aiohttp-socks = "^0.6.0"
Pillow = "^9.0.0"
Pillow = "^9.0.1"
nonebot_plugin_apscheduler = "^0.1.2"
nonebot-adapter-cqhttp = "^2.0.0a16"
nonebot-adapter-onebot = "^2.0.0b1"
motor = "^2.5.1"

[tool.poetry.dev-dependencies]
nonebot-test = "^0.1.0"

[nonebot.plugins]
plugin_dirs = ["src/plugins"]
[tool.nonebot]
plugins = ["nonebot_plugin_apscheduler"]

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
requires = ["poetry_core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
9 changes: 5 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
PixivPy-Async==1.2.13
aiohttp-socks==0.6.0
python-socks[asyncio]==2.0.1
Pillow==9.0.0
nonebot2==2.0.0a16
Pillow==9.0.1
nonebot2==2.0.0b2
nonebot_plugin_apscheduler==0.1.2
nonebot-adapter-cqhttp==2.0.0a16
nonebot-adapter-onebot==2.0.0b1
# nonebot-adapter-cqhttp==2.0.0b1
motor==2.5.1
nb-cli==0.5.1
nb-cli==0.6.6
2 changes: 1 addition & 1 deletion src/plugins/nonebot-plugin-pixivbot

0 comments on commit eb968b3

Please sign in to comment.