Skip to content

Commit 6f83f0c

Browse files
committed
feat: move temporary image path to cache directory
1 parent fcf93cd commit 6f83f0c

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "nonebot-plugin-deer-pipe"
3-
version = "0.4.1"
3+
version = "0.4.2"
44
description = "A deer-pipe attendance plugin for nonebot2"
55
readme = "README.md"
66
authors = [

src/nonebot_plugin_deer_pipe/image.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import os
2+
import nonebot_plugin_localstore as localstore
23
import secrets
34

45
from .constants import (
56
ASSETS_FNT_MISANS,
67
ASSETS_IMG_CHECK,
78
ASSETS_IMG_DEERPIPE,
8-
PLUGIN_PATH,
99
)
1010

1111
from PIL import Image, ImageDraw
@@ -64,7 +64,7 @@ def generate_calendar(
6464
stroke_width=1,
6565
)
6666

67-
img_path: Path = PLUGIN_PATH / f"{secrets.token_hex()}.png"
67+
img_path: Path = localstore.get_plugin_cache_file(f"{secrets.token_hex()}.png")
6868
img.save(img_path)
6969

7070
with open(img_path, "rb") as f:

uv.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)