Skip to content

Commit

Permalink
update nonebot-plugin-alconna
Browse files Browse the repository at this point in the history
  • Loading branch information
MeetWq committed Mar 12, 2024
1 parent eacfb1f commit 23a03d6
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 30 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ nb plugin install nonebot_plugin_imagetools
pip install nonebot_plugin_imagetools
```

#### 配置驱动器​

插件需要“客户端型驱动器”(如 httpx)来下载图片等,驱动器安装和配置参考 [NoneBot 选择驱动器](https://nonebot.dev/docs/advanced/driver)

同时需要在 `.env.*` 配置文件中启用对应的驱动器,例如:

```
DRIVER=~fastapi+~httpx+~websockets
```


### 配置项

Expand Down
8 changes: 4 additions & 4 deletions nonebot_plugin_imagetools/depends.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from nonebot.log import logger
from nonebot.params import CommandArg, Depends
from nonebot.typing import T_State
from nonebot_plugin_alconna import Image, UniMessage, image_fetch
from nonebot_plugin_alconna.uniseg.segment import reply_handle
from nonebot_plugin_alconna import Image, UniMessage
from nonebot_plugin_alconna.uniseg.tools import image_fetch, reply_fetch
from pil_utils import BuildImage
from typing_extensions import Literal

Expand All @@ -23,8 +23,8 @@ async def dependency(
if msg:
uni_msg = await UniMessage.generate(message=msg)
uni_msg_with_reply = UniMessage()
if reply := await reply_handle(event, bot):
if isinstance(reply.msg, Message) and reply.msg:
if reply := await reply_fetch(event, bot):
if reply.msg and isinstance(reply.msg, Message):
uni_msg_with_reply = await UniMessage.generate(message=reply.msg)
uni_msg_with_reply.extend(uni_msg)

Expand Down
48 changes: 24 additions & 24 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nonebot_plugin_imagetools"
version = "0.4.0"
version = "0.4.1"
description = "Nonebot2 简单图片操作插件"
authors = ["meetwq <[email protected]>"]
license = "MIT"
Expand All @@ -11,7 +11,7 @@ repository = "https://github.com/noneplugin/nonebot-plugin-imagetools"
[tool.poetry.dependencies]
python = "^3.8"
nonebot2 = "^2.2.0"
nonebot-plugin-alconna = ">=0.38.0,<1.0.0"
nonebot-plugin-alconna = ">=0.40.1,<1.0.0"
httpx = ">=0.20.0,<1.0.0"
Pillow = "^10.0.0"
pil-utils = "^0.1.8"
Expand Down

0 comments on commit 23a03d6

Please sign in to comment.