Compare commits
16 Commits
v0.1.0.001
...
v0.3.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 21e996a3b9 | |||
| a68c8bee98 | |||
| 6362ed4a88 | |||
| 7e3611afcd | |||
| c307aef5bb | |||
| bc8c6c49d6 | |||
| cf35e5923c | |||
| 4107a4875c | |||
| c8dae680a3 | |||
| adebd51605 | |||
| f0fdc930d4 | |||
| a97bf7d55c | |||
| 4a26177ab9 | |||
| a727c108fe | |||
| d6d68dcc96 | |||
| b0e8779bff |
24
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "运行 Bot 并调试(自动重载)",
|
||||
"type": "debugpy",
|
||||
"request": "launch",
|
||||
"module": "watchfiles",
|
||||
"args": [
|
||||
"bot.main"
|
||||
],
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": true,
|
||||
"env": {
|
||||
"PYTHONPATH": "${workspaceFolder}"
|
||||
},
|
||||
"cwd": "${workspaceFolder}",
|
||||
"presentation": {
|
||||
"hidden": false,
|
||||
"group": "bot"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
9
.vscode/tasks.json
vendored
@ -11,19 +11,20 @@
|
||||
"panel": "new"
|
||||
},
|
||||
"problemMatcher": [],
|
||||
"detail": "导出生产环境依赖到 requirements.txt,不包含开发依赖和哈希值。"
|
||||
"detail": "导出生产环境依赖到 requirements.txt"
|
||||
},
|
||||
{
|
||||
"label": "Poetry: Export requirements.txt (Full)",
|
||||
"label": "Bot: Run with Auto-reload",
|
||||
"type": "shell",
|
||||
"command": "poetry export -f requirements.txt --output requirements.txt",
|
||||
"command": "poetry run watchfiles bot.main",
|
||||
"group": "build",
|
||||
"isBackground": true,
|
||||
"presentation": {
|
||||
"reveal": "always",
|
||||
"panel": "new"
|
||||
},
|
||||
"problemMatcher": [],
|
||||
"detail": "导出所有依赖(包括生产和开发依赖)到 requirements.txt,包含哈希值以确保完全一致。"
|
||||
"detail": "运行 bot 并启用自动重载功能"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -65,7 +65,13 @@ code .
|
||||
|
||||
### 运行
|
||||
|
||||
如果改动了代码,应该先用 `Ctrl+C` 或者根据控制台提示退出,然后再重新启动。
|
||||
你可以在 VSCode 的「运行与调试」窗口,启动 `运行 Bot 并调试(自动重载)` 任务来启动 Bot,也可以使用命令行手动启动 Bot:
|
||||
|
||||
```bash
|
||||
poetry run watchfiles bot.main
|
||||
```
|
||||
|
||||
如果你不希望自动重载,只是想运行 Bot,可以直接运行:
|
||||
|
||||
```bash
|
||||
poetry run python bot.py
|
||||
|
||||
5
bot.py
@ -14,7 +14,7 @@ env_enable_qq = os.environ.get("ENABLE_QQ", "none")
|
||||
env_enable_discord = os.environ.get("ENABLE_DISCORD", "none")
|
||||
env_enable_minecraft = os.environ.get("ENABLE_MINECRAFT", "none")
|
||||
|
||||
if __name__ == "__main__":
|
||||
def main():
|
||||
nonebot.init()
|
||||
|
||||
driver = nonebot.get_driver()
|
||||
@ -35,3 +35,6 @@ if __name__ == "__main__":
|
||||
nonebot.load_plugins("konabot/plugins")
|
||||
|
||||
nonebot.run()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
38
konabot/plugins/memepack/__init__.py
Normal file
@ -0,0 +1,38 @@
|
||||
from io import BytesIO
|
||||
|
||||
from nonebot_plugin_alconna import (Alconna, Args, Field, MultiVar, UniMessage,
|
||||
on_alconna)
|
||||
|
||||
from konabot.plugins.memepack.drawing.geimao import draw_geimao
|
||||
from konabot.plugins.memepack.drawing.pt import draw_pt
|
||||
|
||||
geimao = on_alconna(Alconna(
|
||||
"给猫说",
|
||||
Args["saying", MultiVar(str, '+'), Field(
|
||||
missing_tips=lambda: "你没有写给猫说了什么"
|
||||
)]
|
||||
), use_cmd_start=True, use_cmd_sep=False, skip_for_unmatch=False, aliases={"给猫哈"})
|
||||
|
||||
@geimao.handle()
|
||||
async def _(saying: list[str]):
|
||||
img = await draw_geimao("\n".join(saying))
|
||||
img_bytes = BytesIO()
|
||||
img.save(img_bytes, format="PNG")
|
||||
|
||||
await geimao.send(await UniMessage().image(raw=img_bytes).export())
|
||||
|
||||
|
||||
pt = on_alconna(Alconna(
|
||||
"pt说",
|
||||
Args["saying", MultiVar(str, '+'), Field(
|
||||
missing_tips=lambda: "你没有写小帕说了什么"
|
||||
)]
|
||||
), use_cmd_start=True, use_cmd_sep=False, skip_for_unmatch=False, aliases={"小帕说"})
|
||||
|
||||
@pt.handle()
|
||||
async def _(saying: list[str]):
|
||||
img = await draw_pt("\n".join(saying))
|
||||
img_bytes = BytesIO()
|
||||
img.save(img_bytes, format="PNG")
|
||||
|
||||
await pt.send(await UniMessage().image(raw=img_bytes).export())
|
||||
BIN
konabot/plugins/memepack/assets/HarmonyOS_Sans_SC_Black.ttf
Normal file
BIN
konabot/plugins/memepack/assets/HarmonyOS_Sans_SC_Regular.ttf
Normal file
BIN
konabot/plugins/memepack/assets/NotoColorEmoji-Regular.ttf
Normal file
BIN
konabot/plugins/memepack/assets/geimao.jpg
Normal file
|
After Width: | Height: | Size: 219 KiB |
BIN
konabot/plugins/memepack/assets/ptsay.png
Normal file
|
After Width: | Height: | Size: 272 KiB |
0
konabot/plugins/memepack/drawing/__init__.py
Normal file
0
konabot/plugins/memepack/drawing/base/__init__.py
Normal file
12
konabot/plugins/memepack/drawing/base/fonts.py
Normal file
@ -0,0 +1,12 @@
|
||||
from imagetext_py import EmojiOptions, FontDB
|
||||
|
||||
from .path import ASSETS
|
||||
|
||||
FontDB.LoadFromDir(str(ASSETS))
|
||||
|
||||
FontDB.SetDefaultEmojiOptions(EmojiOptions(
|
||||
parse_shortcodes=False,
|
||||
))
|
||||
|
||||
HARMONYOS_SANS_SC_BLACK = FontDB.Query("HarmonyOS_Sans_SC_Black")
|
||||
HARMONYOS_SANS_SC_REGULAR = FontDB.Query("HarmonyOS_Sans_SC_Regular")
|
||||
3
konabot/plugins/memepack/drawing/base/path.py
Normal file
@ -0,0 +1,3 @@
|
||||
from pathlib import Path
|
||||
|
||||
ASSETS = Path(__file__).parent.parent.parent / "assets"
|
||||
29
konabot/plugins/memepack/drawing/geimao.py
Normal file
@ -0,0 +1,29 @@
|
||||
import asyncio
|
||||
from typing import Any, cast
|
||||
|
||||
import imagetext_py
|
||||
import PIL.Image
|
||||
|
||||
from .base.fonts import HARMONYOS_SANS_SC_BLACK
|
||||
from .base.path import ASSETS
|
||||
|
||||
geimao_image = PIL.Image.open(ASSETS / "geimao.jpg").convert("RGBA")
|
||||
|
||||
|
||||
def _draw_geimao(saying: str):
|
||||
img = geimao_image.copy()
|
||||
with imagetext_py.Writer(img) as iw:
|
||||
iw.draw_text_wrapped(
|
||||
saying, 960, 50, 00.5, 0, 1920, 240, HARMONYOS_SANS_SC_BLACK,
|
||||
imagetext_py.Paint.Color(imagetext_py.Color.from_hex("000000FF")),
|
||||
0.8,
|
||||
imagetext_py.TextAlign.Center,
|
||||
cast(Any, 30.0),
|
||||
imagetext_py.Paint.Color(imagetext_py.Color.from_hex("FFFFFFFF")),
|
||||
draw_emojis=True,
|
||||
)
|
||||
return img
|
||||
|
||||
|
||||
async def draw_geimao(saying: str):
|
||||
return await asyncio.to_thread(_draw_geimao, saying)
|
||||
26
konabot/plugins/memepack/drawing/pt.py
Normal file
@ -0,0 +1,26 @@
|
||||
import asyncio
|
||||
|
||||
import imagetext_py
|
||||
import PIL.Image
|
||||
|
||||
from .base.fonts import HARMONYOS_SANS_SC_REGULAR
|
||||
from .base.path import ASSETS
|
||||
|
||||
pt_image = PIL.Image.open(ASSETS / "ptsay.png").convert("RGBA")
|
||||
|
||||
|
||||
def _draw_pt(saying: str):
|
||||
img = pt_image.copy()
|
||||
with imagetext_py.Writer(img) as iw:
|
||||
iw.draw_text_wrapped(
|
||||
saying, 259, 278, 0.5, 0.5, 360, 48, HARMONYOS_SANS_SC_REGULAR,
|
||||
imagetext_py.Paint.Color(imagetext_py.Color.from_hex("000000FF")),
|
||||
1.0,
|
||||
imagetext_py.TextAlign.Center,
|
||||
draw_emojis=True,
|
||||
)
|
||||
return img
|
||||
|
||||
|
||||
async def draw_pt(saying: str):
|
||||
return await asyncio.to_thread(_draw_pt, saying)
|
||||
46
konabot/plugins/openssl_rand/__init__.py
Normal file
@ -0,0 +1,46 @@
|
||||
import base64
|
||||
import secrets
|
||||
from typing import Literal
|
||||
|
||||
from nonebot.adapters import Event as BaseEvent
|
||||
from nonebot.adapters.discord.event import MessageEvent as DiscordMessageEvent
|
||||
from nonebot_plugin_alconna import (Alconna, Args, Field, Subcommand,
|
||||
UniMessage, on_alconna)
|
||||
|
||||
evt = on_alconna(Alconna(
|
||||
"openssl",
|
||||
Subcommand(
|
||||
"rand",
|
||||
Args["mode", Literal["-hex", "-base64"], Field(
|
||||
missing_tips=lambda: "请输入生成模式,-hex 或 -base64,例如 openssl rand -hex 16",
|
||||
unmatch_tips=lambda mode: f"{mode} 不是一个有效的格式,请使用 -hex 或 -base64"
|
||||
)],
|
||||
Args["num", int, Field(
|
||||
missing_tips=lambda: "请输入需要生成的字节数,例如 openssl rand -hex 16",
|
||||
)],
|
||||
)
|
||||
), use_cmd_start=True, use_cmd_sep=False, skip_for_unmatch=False)
|
||||
|
||||
@evt.assign("rand")
|
||||
async def _(event: BaseEvent, mode: str, num: int):
|
||||
if num <= 0:
|
||||
await evt.send(await UniMessage().text(
|
||||
"生成的字节数必须是一个正整数"
|
||||
).export())
|
||||
return
|
||||
if num > 256:
|
||||
await evt.send(await UniMessage().text(
|
||||
"太大了!!!!!"
|
||||
).export())
|
||||
return
|
||||
|
||||
random_bytes = secrets.token_bytes(num)
|
||||
if mode == "-hex":
|
||||
result = random_bytes.hex()
|
||||
else:
|
||||
result = base64.b64encode(random_bytes).decode()
|
||||
|
||||
if isinstance(event, DiscordMessageEvent):
|
||||
result = f"```{result}```"
|
||||
|
||||
await evt.send(await UniMessage().text(result).export())
|
||||
42
konabot/plugins/roll_dice/__init__.py
Normal file
@ -0,0 +1,42 @@
|
||||
from typing import Optional
|
||||
from nonebot.adapters import Event as BaseEvent
|
||||
from nonebot.adapters.console.event import MessageEvent as ConsoleMessageEvent
|
||||
from nonebot.adapters.discord.event import MessageEvent as DiscordMessageEvent
|
||||
from nonebot_plugin_alconna import Alconna, Args, UniMessage, on_alconna
|
||||
|
||||
from konabot.plugins.roll_dice.roll_dice import generate_dice_image
|
||||
from konabot.plugins.roll_dice.roll_number import get_random_number, roll_number
|
||||
|
||||
evt = on_alconna(Alconna(
|
||||
"摇数字"
|
||||
), use_cmd_start=True, use_cmd_sep=False, skip_for_unmatch=True)
|
||||
|
||||
@evt.handle()
|
||||
async def _(event: BaseEvent):
|
||||
if isinstance(event, DiscordMessageEvent):
|
||||
await evt.send(await UniMessage().text("```\n" + roll_number() + "\n```").export())
|
||||
elif isinstance(event, ConsoleMessageEvent):
|
||||
await evt.send(await UniMessage().text(roll_number()).export())
|
||||
else:
|
||||
await evt.send(await UniMessage().text(roll_number(wide=True)).export())
|
||||
|
||||
evt = on_alconna(Alconna(
|
||||
"摇骰子",
|
||||
Args["f1?", int]["f2?", int]
|
||||
), use_cmd_start=True, use_cmd_sep=False, skip_for_unmatch=True)
|
||||
|
||||
@evt.handle()
|
||||
async def _(event: BaseEvent, f1: Optional[int] = None, f2: Optional[int] = None):
|
||||
# if isinstance(event, DiscordMessageEvent):
|
||||
# await evt.send(await UniMessage().text("```\n" + roll_dice() + "\n```").export())
|
||||
# elif isinstance(event, ConsoleMessageEvent):
|
||||
number = 0
|
||||
if(f1 is not None and f2 is not None):
|
||||
number = get_random_number(f1, f2)
|
||||
elif f1 is not None:
|
||||
number = get_random_number(1, f1)
|
||||
else:
|
||||
number = get_random_number()
|
||||
await evt.send(await UniMessage().image(raw=await generate_dice_image(number)).export())
|
||||
# else:
|
||||
# await evt.send(await UniMessage().text(roll_dice(wide=True)).export())
|
||||
BIN
konabot/plugins/roll_dice/assets/1.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
konabot/plugins/roll_dice/assets/10.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
konabot/plugins/roll_dice/assets/11.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
konabot/plugins/roll_dice/assets/12.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
konabot/plugins/roll_dice/assets/2.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
konabot/plugins/roll_dice/assets/3.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
konabot/plugins/roll_dice/assets/4.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
konabot/plugins/roll_dice/assets/5.png
Normal file
|
After Width: | Height: | Size: 9.3 KiB |
BIN
konabot/plugins/roll_dice/assets/6.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
konabot/plugins/roll_dice/assets/7.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
konabot/plugins/roll_dice/assets/8.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
konabot/plugins/roll_dice/assets/9.png
Normal file
|
After Width: | Height: | Size: 9.3 KiB |
BIN
konabot/plugins/roll_dice/assets/montserrat.otf
Normal file
BIN
konabot/plugins/roll_dice/assets/template.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
3
konabot/plugins/roll_dice/base/path.py
Normal file
@ -0,0 +1,3 @@
|
||||
from pathlib import Path
|
||||
|
||||
ASSETS = Path(__file__).parent.parent / "assets"
|
||||
203
konabot/plugins/roll_dice/roll_dice.py
Normal file
@ -0,0 +1,203 @@
|
||||
from io import BytesIO
|
||||
import cv2
|
||||
import numpy as np
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
|
||||
from konabot.plugins.roll_dice.base.path import ASSETS
|
||||
|
||||
def text_to_transparent_image(text, font_size=40, padding=0, text_color=(0, 0, 0)):
|
||||
"""
|
||||
将文本转换为带透明背景的图像,图像大小刚好包含文本
|
||||
"""
|
||||
# 创建临时图像来计算文本尺寸
|
||||
temp_image = Image.new('RGB', (1, 1), (255, 255, 255))
|
||||
temp_draw = ImageDraw.Draw(temp_image)
|
||||
|
||||
font = ImageFont.truetype(ASSETS / "montserrat.otf", font_size)
|
||||
# try:
|
||||
# font = ImageFont.truetype(ASSETS / "montserrat.otf", font_size)
|
||||
# except:
|
||||
# try:
|
||||
# font = ImageFont.truetype("arial.ttf", font_size)
|
||||
# except:
|
||||
# # 如果系统字体不可用,使用默认字体
|
||||
# font = ImageFont.load_default()
|
||||
|
||||
# 获取文本边界框
|
||||
bbox = temp_draw.textbbox((0, 0), text, font=font)
|
||||
text_width = bbox[2] - bbox[0]
|
||||
text_height = bbox[3] - bbox[1]
|
||||
|
||||
# 计算图像大小(文本大小 + 内边距)
|
||||
image_width = text_width + 2 * padding
|
||||
image_height = text_height + 2 * padding
|
||||
|
||||
# 创建RGBA模式的空白图像(带透明通道)
|
||||
image = Image.new('RGBA', (image_width, image_height), (0, 0, 0, 0))
|
||||
draw = ImageDraw.Draw(image)
|
||||
|
||||
# 绘制文本(考虑内边距)
|
||||
x = padding - bbox[0] # 调整起始位置
|
||||
y = padding - bbox[1]
|
||||
|
||||
# 设置文本颜色(带透明度)
|
||||
if len(text_color) == 3:
|
||||
text_color = text_color + (255,) # 添加完全不透明的alpha值
|
||||
|
||||
draw.text((x, y), text, fill=text_color, font=font)
|
||||
|
||||
# 转换为OpenCV格式(BGRA)
|
||||
image_cv = cv2.cvtColor(np.array(image), cv2.COLOR_RGBA2BGRA)
|
||||
return image_cv
|
||||
|
||||
def perspective_transform(image, target, corners):
|
||||
"""
|
||||
对图像进行透视变换(保持透明通道)
|
||||
target: 画布
|
||||
corners: 四个角点的坐标,顺序为 [左上, 右上, 右下, 左下]
|
||||
"""
|
||||
height, width = image.shape[:2]
|
||||
|
||||
# 源点(原始图像的四个角)
|
||||
src_points = np.array([
|
||||
[0, 0], # 左上
|
||||
[width-1, 0], # 右上
|
||||
[width-1, height-1], # 右下
|
||||
[0, height-1] # 左下
|
||||
], dtype=np.float32)
|
||||
|
||||
# 目标点(变换后的四个角)
|
||||
dst_points = np.array(corners, dtype=np.float32)
|
||||
|
||||
# 计算透视变换矩阵
|
||||
matrix = cv2.getPerspectiveTransform(src_points, dst_points)
|
||||
|
||||
# 获取画布大小
|
||||
target_height, target_width = target.shape[:2]
|
||||
|
||||
# 应用透视变换(保持所有通道,包括alpha)
|
||||
transformed = cv2.warpPerspective(image, matrix, (target_width, target_height), flags=cv2.INTER_LINEAR)
|
||||
|
||||
return transformed, matrix
|
||||
|
||||
def blend_with_transparency(background, foreground, position):
|
||||
"""
|
||||
将带透明通道的前景图像合成到背景图像上
|
||||
position: 前景图像在背景图像上的位置 (x, y)
|
||||
"""
|
||||
bg = background.copy()
|
||||
|
||||
# 如果背景没有alpha通道,添加一个
|
||||
if bg.shape[2] == 3:
|
||||
bg = cv2.cvtColor(bg, cv2.COLOR_BGR2BGRA)
|
||||
bg[:, :, 3] = 255 # 完全不透明
|
||||
|
||||
x, y = position
|
||||
fg_height, fg_width = foreground.shape[:2]
|
||||
bg_height, bg_width = bg.shape[:2]
|
||||
|
||||
# 确保位置在图像范围内
|
||||
x = max(0, min(x, bg_width - fg_width))
|
||||
y = max(0, min(y, bg_height - fg_height))
|
||||
|
||||
# 提取前景的alpha通道并归一化
|
||||
alpha_foreground = foreground[:, :, 3] / 255.0
|
||||
|
||||
# 对于每个颜色通道进行合成
|
||||
for c in range(3):
|
||||
bg_region = bg[y:y+fg_height, x:x+fg_width, c]
|
||||
fg_region = foreground[:, :, c]
|
||||
|
||||
# alpha混合公式
|
||||
bg[y:y+fg_height, x:x+fg_width, c] = (
|
||||
alpha_foreground * fg_region +
|
||||
(1 - alpha_foreground) * bg_region
|
||||
)
|
||||
|
||||
# 更新背景的alpha通道(如果需要)
|
||||
bg_alpha_region = bg[y:y+fg_height, x:x+fg_width, 3]
|
||||
bg[y:y+fg_height, x:x+fg_width, 3] = np.maximum(bg_alpha_region, foreground[:, :, 3])
|
||||
|
||||
return bg
|
||||
|
||||
def precise_blend_with_perspective(background, foreground, corners):
|
||||
"""
|
||||
精确合成:根据四个角点将前景图像透视合成到背景上
|
||||
"""
|
||||
# 创建与背景相同大小的空白图像
|
||||
bg_height, bg_width = background.shape[:2]
|
||||
|
||||
# 如果背景没有alpha通道,转换为BGRA
|
||||
if background.shape[2] == 3:
|
||||
background_bgra = cv2.cvtColor(background, cv2.COLOR_BGR2BGRA)
|
||||
else:
|
||||
background_bgra = background.copy()
|
||||
|
||||
# 创建与背景相同大小的前景图层
|
||||
foreground_layer = np.zeros((bg_height, bg_width, 4), dtype=np.uint8)
|
||||
|
||||
# 计算前景图像在背景中的边界框
|
||||
min_x = int(min(corners[:, 0]))
|
||||
max_x = int(max(corners[:, 0]))
|
||||
min_y = int(min(corners[:, 1]))
|
||||
max_y = int(max(corners[:, 1]))
|
||||
|
||||
# 将变换后的前景图像放置到对应位置
|
||||
fg_height, fg_width = foreground.shape[:2]
|
||||
if min_y + fg_height <= bg_height and min_x + fg_width <= bg_width:
|
||||
foreground_layer[min_y:min_y+fg_height, min_x:min_x+fg_width] = foreground
|
||||
|
||||
# 创建掩码(只在前景有内容的地方合成)
|
||||
mask = (foreground_layer[:, :, 3] > 0)
|
||||
|
||||
# 合成图像
|
||||
result = background_bgra.copy()
|
||||
for c in range(3):
|
||||
result[:, :, c][mask] = foreground_layer[:, :, c][mask]
|
||||
result[:, :, 3][mask] = foreground_layer[:, :, 3][mask]
|
||||
|
||||
return result
|
||||
|
||||
async def generate_dice_image(number: int) -> BytesIO:
|
||||
# 将文本转换为带透明背景的图像
|
||||
text = str(number)
|
||||
text_image = text_to_transparent_image(
|
||||
text,
|
||||
font_size=60,
|
||||
text_color=(0, 0, 0) # 黑色文字
|
||||
)
|
||||
|
||||
# 定义3D变换的四个角点(透视效果)
|
||||
# 顺序: [左上, 右上, 右下, 左下]
|
||||
corners = np.array([
|
||||
[16, 30], # 左上
|
||||
[51, 5], # 右上(上移,创建透视)
|
||||
[88, 33], # 右下
|
||||
[49, 62] # 左下(下移)
|
||||
], dtype=np.float32)
|
||||
|
||||
# 加载背景图像,保留透明通道
|
||||
background = cv2.imread(ASSETS / "template.png", cv2.IMREAD_UNCHANGED)
|
||||
|
||||
|
||||
# 对文本图像进行3D变换(保持透明通道)
|
||||
transformed_text, transform_matrix = perspective_transform(text_image, background, corners)
|
||||
|
||||
min_x = int(min(corners[:, 0]))
|
||||
min_y = int(min(corners[:, 1]))
|
||||
final_image_simple = blend_with_transparency(background, transformed_text, (min_x, min_y))
|
||||
|
||||
pil_final = Image.fromarray(final_image_simple)
|
||||
# 导入一系列图像
|
||||
images = [Image.open(ASSETS / f"{i}.png") for i in range(1, 12)]
|
||||
images.append(pil_final)
|
||||
frame_durations = [100] * (len(images) - 1) + [100000]
|
||||
# 保存为BytesIO对象
|
||||
output = BytesIO()
|
||||
images[0].save(output,
|
||||
save_all=True,
|
||||
append_images=images[1:],
|
||||
duration=frame_durations,
|
||||
format='GIF',
|
||||
loop=1)
|
||||
return output
|
||||
54
konabot/plugins/roll_dice/roll_number.py
Normal file
@ -0,0 +1,54 @@
|
||||
number_arts = {
|
||||
1: ''' _
|
||||
/ |
|
||||
| |
|
||||
| |
|
||||
|_|
|
||||
|
||||
''',
|
||||
2: ''' ____
|
||||
|___ \\
|
||||
__) |
|
||||
/ __/
|
||||
|_____|
|
||||
''',
|
||||
3: ''' _____
|
||||
|___ /
|
||||
|_ \\
|
||||
___) |
|
||||
|____/
|
||||
''',
|
||||
4: ''' _ _
|
||||
| || |
|
||||
| || |_
|
||||
|__ _|
|
||||
|_|
|
||||
''',
|
||||
5: ''' ____
|
||||
| ___|
|
||||
|___ \\
|
||||
___) |
|
||||
|____/
|
||||
''',
|
||||
6: ''' __
|
||||
/ /_
|
||||
| '_ \\
|
||||
| (_) |
|
||||
\\___/
|
||||
'''
|
||||
}
|
||||
|
||||
def get_random_number(min: int = 1, max: int = 6) -> int:
|
||||
import random
|
||||
return random.randint(min, max)
|
||||
|
||||
def roll_number(wide: bool = False) -> str:
|
||||
raw = number_arts[get_random_number()]
|
||||
if wide:
|
||||
raw = (raw
|
||||
.replace("/", "/")
|
||||
.replace("\\", "\")
|
||||
.replace("_", "_")
|
||||
.replace("|", "|")
|
||||
.replace(" ", " "))
|
||||
return raw
|
||||
153
poetry.lock
generated
@ -1033,6 +1033,32 @@ files = [
|
||||
[package.extras]
|
||||
all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"]
|
||||
|
||||
[[package]]
|
||||
name = "imagetext-py"
|
||||
version = "2.2.0"
|
||||
description = "Python bindings for imagetext"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "imagetext_py-2.2.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:10578502c27279c3b04d0145374d42904b1fa2ec1f1f2d8f2a8155cbe0759235"},
|
||||
{file = "imagetext_py-2.2.0-cp38-abi3-macosx_10_12_x86_64.whl", hash = "sha256:a91d3b06047b54ca8579647b7b8f65df089be1a1431963c752cd1dddf0ab0d9a"},
|
||||
{file = "imagetext_py-2.2.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4c8fd07676b189073b7e56811cac9095d95d355dd83b060bf4a3d0fe437953b1"},
|
||||
{file = "imagetext_py-2.2.0-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f0f9d9014a8f0c48c8fc7ba7df77b1f8ca75621725aa29f76aec4fd860963e52"},
|
||||
{file = "imagetext_py-2.2.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7b9420487ffe57272fe39254080ea2f0b2e98fe0d570f1754510092a956807fc"},
|
||||
{file = "imagetext_py-2.2.0-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:de05742ddeb093d21450fc406a22f581a976039a02a5ad2394e5f4ed51090ab2"},
|
||||
{file = "imagetext_py-2.2.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:66d1b4263025f0b8805c0f2c0405047439f49570f7e87d16d950962ab39f6b89"},
|
||||
{file = "imagetext_py-2.2.0-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c3506b59272ee458c91f847cc026759f8a31451e0416ebe8179c260861d88bcf"},
|
||||
{file = "imagetext_py-2.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eeebba3b2a2517c79bb800e6cb2a49921d9e89866e661736e5db26c5c0ede43c"},
|
||||
{file = "imagetext_py-2.2.0-cp38-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:e3b8b219afb8f567038ad44923f29b22af04bcd08185d2fea5d9880902b9c4fd"},
|
||||
{file = "imagetext_py-2.2.0-cp38-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:b3db2bad720bd0d1656945c94f22d286b479d02d93f9095409ab627b57b8a55b"},
|
||||
{file = "imagetext_py-2.2.0-cp38-abi3-musllinux_1_2_i686.whl", hash = "sha256:9c342dd2214445c95e89ad9c346956360831fb4075fd38d33e51481674240596"},
|
||||
{file = "imagetext_py-2.2.0-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:ae3217cef584faefd30eb9ad41d39e89809ec7c427dc2f916abc80170355213a"},
|
||||
{file = "imagetext_py-2.2.0-cp38-abi3-win32.whl", hash = "sha256:47ced40dffe6cd2a802b40351a5586679d13ad18b88ebf15143f86131f6c4bf4"},
|
||||
{file = "imagetext_py-2.2.0-cp38-abi3-win_amd64.whl", hash = "sha256:d3fbf7e985cc8ac234a210e4b6f439560d902d705610b9af1f5ceb0a61f70933"},
|
||||
{file = "imagetext_py-2.2.0-cp38-abi3-win_arm64.whl", hash = "sha256:be05b30b9301e699b3470ff109f8af28d8ce3e1d9e9738cdbf68e7889b86b7a5"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "importlib-metadata"
|
||||
version = "8.7.0"
|
||||
@ -1701,6 +1727,131 @@ files = [
|
||||
[package.dependencies]
|
||||
textual = ">=3.7.0,<4.0.0"
|
||||
|
||||
[[package]]
|
||||
name = "pillow"
|
||||
version = "11.3.0"
|
||||
description = "Python Imaging Library (Fork)"
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "pillow-11.3.0-cp310-cp310-macosx_10_10_x86_64.whl", hash = "sha256:1b9c17fd4ace828b3003dfd1e30bff24863e0eb59b535e8f80194d9cc7ecf860"},
|
||||
{file = "pillow-11.3.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:65dc69160114cdd0ca0f35cb434633c75e8e7fad4cf855177a05bf38678f73ad"},
|
||||
{file = "pillow-11.3.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:7107195ddc914f656c7fc8e4a5e1c25f32e9236ea3ea860f257b0436011fddd0"},
|
||||
{file = "pillow-11.3.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:cc3e831b563b3114baac7ec2ee86819eb03caa1a2cef0b481a5675b59c4fe23b"},
|
||||
{file = "pillow-11.3.0-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f1f182ebd2303acf8c380a54f615ec883322593320a9b00438eb842c1f37ae50"},
|
||||
{file = "pillow-11.3.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4445fa62e15936a028672fd48c4c11a66d641d2c05726c7ec1f8ba6a572036ae"},
|
||||
{file = "pillow-11.3.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:71f511f6b3b91dd543282477be45a033e4845a40278fa8dcdbfdb07109bf18f9"},
|
||||
{file = "pillow-11.3.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:040a5b691b0713e1f6cbe222e0f4f74cd233421e105850ae3b3c0ceda520f42e"},
|
||||
{file = "pillow-11.3.0-cp310-cp310-win32.whl", hash = "sha256:89bd777bc6624fe4115e9fac3352c79ed60f3bb18651420635f26e643e3dd1f6"},
|
||||
{file = "pillow-11.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:19d2ff547c75b8e3ff46f4d9ef969a06c30ab2d4263a9e287733aa8b2429ce8f"},
|
||||
{file = "pillow-11.3.0-cp310-cp310-win_arm64.whl", hash = "sha256:819931d25e57b513242859ce1876c58c59dc31587847bf74cfe06b2e0cb22d2f"},
|
||||
{file = "pillow-11.3.0-cp311-cp311-macosx_10_10_x86_64.whl", hash = "sha256:1cd110edf822773368b396281a2293aeb91c90a2db00d78ea43e7e861631b722"},
|
||||
{file = "pillow-11.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:9c412fddd1b77a75aa904615ebaa6001f169b26fd467b4be93aded278266b288"},
|
||||
{file = "pillow-11.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:7d1aa4de119a0ecac0a34a9c8bde33f34022e2e8f99104e47a3ca392fd60e37d"},
|
||||
{file = "pillow-11.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:91da1d88226663594e3f6b4b8c3c8d85bd504117d043740a8e0ec449087cc494"},
|
||||
{file = "pillow-11.3.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:643f189248837533073c405ec2f0bb250ba54598cf80e8c1e043381a60632f58"},
|
||||
{file = "pillow-11.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:106064daa23a745510dabce1d84f29137a37224831d88eb4ce94bb187b1d7e5f"},
|
||||
{file = "pillow-11.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:cd8ff254faf15591e724dc7c4ddb6bf4793efcbe13802a4ae3e863cd300b493e"},
|
||||
{file = "pillow-11.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:932c754c2d51ad2b2271fd01c3d121daaa35e27efae2a616f77bf164bc0b3e94"},
|
||||
{file = "pillow-11.3.0-cp311-cp311-win32.whl", hash = "sha256:b4b8f3efc8d530a1544e5962bd6b403d5f7fe8b9e08227c6b255f98ad82b4ba0"},
|
||||
{file = "pillow-11.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:1a992e86b0dd7aeb1f053cd506508c0999d710a8f07b4c791c63843fc6a807ac"},
|
||||
{file = "pillow-11.3.0-cp311-cp311-win_arm64.whl", hash = "sha256:30807c931ff7c095620fe04448e2c2fc673fcbb1ffe2a7da3fb39613489b1ddd"},
|
||||
{file = "pillow-11.3.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:fdae223722da47b024b867c1ea0be64e0df702c5e0a60e27daad39bf960dd1e4"},
|
||||
{file = "pillow-11.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:921bd305b10e82b4d1f5e802b6850677f965d8394203d182f078873851dada69"},
|
||||
{file = "pillow-11.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:eb76541cba2f958032d79d143b98a3a6b3ea87f0959bbe256c0b5e416599fd5d"},
|
||||
{file = "pillow-11.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:67172f2944ebba3d4a7b54f2e95c786a3a50c21b88456329314caaa28cda70f6"},
|
||||
{file = "pillow-11.3.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:97f07ed9f56a3b9b5f49d3661dc9607484e85c67e27f3e8be2c7d28ca032fec7"},
|
||||
{file = "pillow-11.3.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:676b2815362456b5b3216b4fd5bd89d362100dc6f4945154ff172e206a22c024"},
|
||||
{file = "pillow-11.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3e184b2f26ff146363dd07bde8b711833d7b0202e27d13540bfe2e35a323a809"},
|
||||
{file = "pillow-11.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:6be31e3fc9a621e071bc17bb7de63b85cbe0bfae91bb0363c893cbe67247780d"},
|
||||
{file = "pillow-11.3.0-cp312-cp312-win32.whl", hash = "sha256:7b161756381f0918e05e7cb8a371fff367e807770f8fe92ecb20d905d0e1c149"},
|
||||
{file = "pillow-11.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:a6444696fce635783440b7f7a9fc24b3ad10a9ea3f0ab66c5905be1c19ccf17d"},
|
||||
{file = "pillow-11.3.0-cp312-cp312-win_arm64.whl", hash = "sha256:2aceea54f957dd4448264f9bf40875da0415c83eb85f55069d89c0ed436e3542"},
|
||||
{file = "pillow-11.3.0-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:1c627742b539bba4309df89171356fcb3cc5a9178355b2727d1b74a6cf155fbd"},
|
||||
{file = "pillow-11.3.0-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:30b7c02f3899d10f13d7a48163c8969e4e653f8b43416d23d13d1bbfdc93b9f8"},
|
||||
{file = "pillow-11.3.0-cp313-cp313-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:7859a4cc7c9295f5838015d8cc0a9c215b77e43d07a25e460f35cf516df8626f"},
|
||||
{file = "pillow-11.3.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:ec1ee50470b0d050984394423d96325b744d55c701a439d2bd66089bff963d3c"},
|
||||
{file = "pillow-11.3.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:7db51d222548ccfd274e4572fdbf3e810a5e66b00608862f947b163e613b67dd"},
|
||||
{file = "pillow-11.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:2d6fcc902a24ac74495df63faad1884282239265c6839a0a6416d33faedfae7e"},
|
||||
{file = "pillow-11.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f0f5d8f4a08090c6d6d578351a2b91acf519a54986c055af27e7a93feae6d3f1"},
|
||||
{file = "pillow-11.3.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c37d8ba9411d6003bba9e518db0db0c58a680ab9fe5179f040b0463644bc9805"},
|
||||
{file = "pillow-11.3.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:13f87d581e71d9189ab21fe0efb5a23e9f28552d5be6979e84001d3b8505abe8"},
|
||||
{file = "pillow-11.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:023f6d2d11784a465f09fd09a34b150ea4672e85fb3d05931d89f373ab14abb2"},
|
||||
{file = "pillow-11.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:45dfc51ac5975b938e9809451c51734124e73b04d0f0ac621649821a63852e7b"},
|
||||
{file = "pillow-11.3.0-cp313-cp313-win32.whl", hash = "sha256:a4d336baed65d50d37b88ca5b60c0fa9d81e3a87d4a7930d3880d1624d5b31f3"},
|
||||
{file = "pillow-11.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:0bce5c4fd0921f99d2e858dc4d4d64193407e1b99478bc5cacecba2311abde51"},
|
||||
{file = "pillow-11.3.0-cp313-cp313-win_arm64.whl", hash = "sha256:1904e1264881f682f02b7f8167935cce37bc97db457f8e7849dc3a6a52b99580"},
|
||||
{file = "pillow-11.3.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:4c834a3921375c48ee6b9624061076bc0a32a60b5532b322cc0ea64e639dd50e"},
|
||||
{file = "pillow-11.3.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:5e05688ccef30ea69b9317a9ead994b93975104a677a36a8ed8106be9260aa6d"},
|
||||
{file = "pillow-11.3.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:1019b04af07fc0163e2810167918cb5add8d74674b6267616021ab558dc98ced"},
|
||||
{file = "pillow-11.3.0-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f944255db153ebb2b19c51fe85dd99ef0ce494123f21b9db4877ffdfc5590c7c"},
|
||||
{file = "pillow-11.3.0-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1f85acb69adf2aaee8b7da124efebbdb959a104db34d3a2cb0f3793dbae422a8"},
|
||||
{file = "pillow-11.3.0-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:05f6ecbeff5005399bb48d198f098a9b4b6bdf27b8487c7f38ca16eeb070cd59"},
|
||||
{file = "pillow-11.3.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:a7bc6e6fd0395bc052f16b1a8670859964dbd7003bd0af2ff08342eb6e442cfe"},
|
||||
{file = "pillow-11.3.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:83e1b0161c9d148125083a35c1c5a89db5b7054834fd4387499e06552035236c"},
|
||||
{file = "pillow-11.3.0-cp313-cp313t-win32.whl", hash = "sha256:2a3117c06b8fb646639dce83694f2f9eac405472713fcb1ae887469c0d4f6788"},
|
||||
{file = "pillow-11.3.0-cp313-cp313t-win_amd64.whl", hash = "sha256:857844335c95bea93fb39e0fa2726b4d9d758850b34075a7e3ff4f4fa3aa3b31"},
|
||||
{file = "pillow-11.3.0-cp313-cp313t-win_arm64.whl", hash = "sha256:8797edc41f3e8536ae4b10897ee2f637235c94f27404cac7297f7b607dd0716e"},
|
||||
{file = "pillow-11.3.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:d9da3df5f9ea2a89b81bb6087177fb1f4d1c7146d583a3fe5c672c0d94e55e12"},
|
||||
{file = "pillow-11.3.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:0b275ff9b04df7b640c59ec5a3cb113eefd3795a8df80bac69646ef699c6981a"},
|
||||
{file = "pillow-11.3.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:0743841cabd3dba6a83f38a92672cccbd69af56e3e91777b0ee7f4dba4385632"},
|
||||
{file = "pillow-11.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:2465a69cf967b8b49ee1b96d76718cd98c4e925414ead59fdf75cf0fd07df673"},
|
||||
{file = "pillow-11.3.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:41742638139424703b4d01665b807c6468e23e699e8e90cffefe291c5832b027"},
|
||||
{file = "pillow-11.3.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:93efb0b4de7e340d99057415c749175e24c8864302369e05914682ba642e5d77"},
|
||||
{file = "pillow-11.3.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7966e38dcd0fa11ca390aed7c6f20454443581d758242023cf36fcb319b1a874"},
|
||||
{file = "pillow-11.3.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:98a9afa7b9007c67ed84c57c9e0ad86a6000da96eaa638e4f8abe5b65ff83f0a"},
|
||||
{file = "pillow-11.3.0-cp314-cp314-win32.whl", hash = "sha256:02a723e6bf909e7cea0dac1b0e0310be9d7650cd66222a5f1c571455c0a45214"},
|
||||
{file = "pillow-11.3.0-cp314-cp314-win_amd64.whl", hash = "sha256:a418486160228f64dd9e9efcd132679b7a02a5f22c982c78b6fc7dab3fefb635"},
|
||||
{file = "pillow-11.3.0-cp314-cp314-win_arm64.whl", hash = "sha256:155658efb5e044669c08896c0c44231c5e9abcaadbc5cd3648df2f7c0b96b9a6"},
|
||||
{file = "pillow-11.3.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:59a03cdf019efbfeeed910bf79c7c93255c3d54bc45898ac2a4140071b02b4ae"},
|
||||
{file = "pillow-11.3.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f8a5827f84d973d8636e9dc5764af4f0cf2318d26744b3d902931701b0d46653"},
|
||||
{file = "pillow-11.3.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:ee92f2fd10f4adc4b43d07ec5e779932b4eb3dbfbc34790ada5a6669bc095aa6"},
|
||||
{file = "pillow-11.3.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c96d333dcf42d01f47b37e0979b6bd73ec91eae18614864622d9b87bbd5bbf36"},
|
||||
{file = "pillow-11.3.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4c96f993ab8c98460cd0c001447bff6194403e8b1d7e149ade5f00594918128b"},
|
||||
{file = "pillow-11.3.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:41342b64afeba938edb034d122b2dda5db2139b9a4af999729ba8818e0056477"},
|
||||
{file = "pillow-11.3.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:068d9c39a2d1b358eb9f245ce7ab1b5c3246c7c8c7d9ba58cfa5b43146c06e50"},
|
||||
{file = "pillow-11.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:a1bc6ba083b145187f648b667e05a2534ecc4b9f2784c2cbe3089e44868f2b9b"},
|
||||
{file = "pillow-11.3.0-cp314-cp314t-win32.whl", hash = "sha256:118ca10c0d60b06d006be10a501fd6bbdfef559251ed31b794668ed569c87e12"},
|
||||
{file = "pillow-11.3.0-cp314-cp314t-win_amd64.whl", hash = "sha256:8924748b688aa210d79883357d102cd64690e56b923a186f35a82cbc10f997db"},
|
||||
{file = "pillow-11.3.0-cp314-cp314t-win_arm64.whl", hash = "sha256:79ea0d14d3ebad43ec77ad5272e6ff9bba5b679ef73375ea760261207fa8e0aa"},
|
||||
{file = "pillow-11.3.0-cp39-cp39-macosx_10_10_x86_64.whl", hash = "sha256:48d254f8a4c776de343051023eb61ffe818299eeac478da55227d96e241de53f"},
|
||||
{file = "pillow-11.3.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7aee118e30a4cf54fdd873bd3a29de51e29105ab11f9aad8c32123f58c8f8081"},
|
||||
{file = "pillow-11.3.0-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:23cff760a9049c502721bdb743a7cb3e03365fafcdfc2ef9784610714166e5a4"},
|
||||
{file = "pillow-11.3.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:6359a3bc43f57d5b375d1ad54a0074318a0844d11b76abccf478c37c986d3cfc"},
|
||||
{file = "pillow-11.3.0-cp39-cp39-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:092c80c76635f5ecb10f3f83d76716165c96f5229addbd1ec2bdbbda7d496e06"},
|
||||
{file = "pillow-11.3.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:cadc9e0ea0a2431124cde7e1697106471fc4c1da01530e679b2391c37d3fbb3a"},
|
||||
{file = "pillow-11.3.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:6a418691000f2a418c9135a7cf0d797c1bb7d9a485e61fe8e7722845b95ef978"},
|
||||
{file = "pillow-11.3.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:97afb3a00b65cc0804d1c7abddbf090a81eaac02768af58cbdcaaa0a931e0b6d"},
|
||||
{file = "pillow-11.3.0-cp39-cp39-win32.whl", hash = "sha256:ea944117a7974ae78059fcc1800e5d3295172bb97035c0c1d9345fca1419da71"},
|
||||
{file = "pillow-11.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:e5c5858ad8ec655450a7c7df532e9842cf8df7cc349df7225c60d5d348c8aada"},
|
||||
{file = "pillow-11.3.0-cp39-cp39-win_arm64.whl", hash = "sha256:6abdbfd3aea42be05702a8dd98832329c167ee84400a1d1f61ab11437f1717eb"},
|
||||
{file = "pillow-11.3.0-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:3cee80663f29e3843b68199b9d6f4f54bd1d4a6b59bdd91bceefc51238bcb967"},
|
||||
{file = "pillow-11.3.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:b5f56c3f344f2ccaf0dd875d3e180f631dc60a51b314295a3e681fe8cf851fbe"},
|
||||
{file = "pillow-11.3.0-pp310-pypy310_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:e67d793d180c9df62f1f40aee3accca4829d3794c95098887edc18af4b8b780c"},
|
||||
{file = "pillow-11.3.0-pp310-pypy310_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d000f46e2917c705e9fb93a3606ee4a819d1e3aa7a9b442f6444f07e77cf5e25"},
|
||||
{file = "pillow-11.3.0-pp310-pypy310_pp73-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:527b37216b6ac3a12d7838dc3bd75208ec57c1c6d11ef01902266a5a0c14fc27"},
|
||||
{file = "pillow-11.3.0-pp310-pypy310_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:be5463ac478b623b9dd3937afd7fb7ab3d79dd290a28e2b6df292dc75063eb8a"},
|
||||
{file = "pillow-11.3.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:8dc70ca24c110503e16918a658b869019126ecfe03109b754c402daff12b3d9f"},
|
||||
{file = "pillow-11.3.0-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:7c8ec7a017ad1bd562f93dbd8505763e688d388cde6e4a010ae1486916e713e6"},
|
||||
{file = "pillow-11.3.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:9ab6ae226de48019caa8074894544af5b53a117ccb9d3b3dcb2871464c829438"},
|
||||
{file = "pillow-11.3.0-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:fe27fb049cdcca11f11a7bfda64043c37b30e6b91f10cb5bab275806c32f6ab3"},
|
||||
{file = "pillow-11.3.0-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:465b9e8844e3c3519a983d58b80be3f668e2a7a5db97f2784e7079fbc9f9822c"},
|
||||
{file = "pillow-11.3.0-pp311-pypy311_pp73-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5418b53c0d59b3824d05e029669efa023bbef0f3e92e75ec8428f3799487f361"},
|
||||
{file = "pillow-11.3.0-pp311-pypy311_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:504b6f59505f08ae014f724b6207ff6222662aab5cc9542577fb084ed0676ac7"},
|
||||
{file = "pillow-11.3.0-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:c84d689db21a1c397d001aa08241044aa2069e7587b398c8cc63020390b1c1b8"},
|
||||
{file = "pillow-11.3.0.tar.gz", hash = "sha256:3828ee7586cd0b2091b6209e5ad53e20d0649bbe87164a459d0676e035e8f523"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
docs = ["furo", "olefile", "sphinx (>=8.2)", "sphinx-autobuild", "sphinx-copybutton", "sphinx-inline-tabs", "sphinxext-opengraph"]
|
||||
fpx = ["olefile"]
|
||||
mic = ["olefile"]
|
||||
test-arrow = ["pyarrow"]
|
||||
tests = ["check-manifest", "coverage (>=7.4.2)", "defusedxml", "markdown2", "olefile", "packaging", "pyroma", "pytest", "pytest-cov", "pytest-timeout", "pytest-xdist", "trove-classifiers (>=2024.10.12)"]
|
||||
typing = ["typing-extensions ; python_version < \"3.10\""]
|
||||
xmp = ["defusedxml"]
|
||||
|
||||
[[package]]
|
||||
name = "platformdirs"
|
||||
version = "4.4.0"
|
||||
@ -2926,4 +3077,4 @@ type = ["pytest-mypy"]
|
||||
[metadata]
|
||||
lock-version = "2.1"
|
||||
python-versions = ">=3.12,<4.0"
|
||||
content-hash = "9c52c6203be14fe8411add06d2fc4157f07859ee0037dd247452718ac6a1251d"
|
||||
content-hash = "ca1f92dc64b99018d4b1043c984b1e52d325af213e3af77370855a6b00bd77e0"
|
||||
|
||||
@ -18,6 +18,8 @@ dependencies = [
|
||||
"requests (>=2.32.5,<3.0.0)",
|
||||
"beautifulsoup4 (>=4.13.5,<5.0.0)",
|
||||
"lxml (>=6.0.2,<7.0.0)",
|
||||
"pillow (>=11.3.0,<12.0.0)",
|
||||
"imagetext-py (>=2.2.0,<3.0.0)",
|
||||
]
|
||||
|
||||
|
||||
|
||||
@ -28,6 +28,7 @@ httptools==0.6.4 ; python_version >= "3.12" and python_version < "4.0"
|
||||
httpx==0.28.1 ; python_version >= "3.12" and python_version < "4.0"
|
||||
hyperframe==6.1.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
idna==3.10 ; python_version >= "3.12" and python_version < "4.0"
|
||||
imagetext-py==2.2.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
importlib-metadata==8.7.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
linkify-it-py==2.0.3 ; python_version >= "3.12" and python_version < "4.0"
|
||||
loguru==0.7.3 ; python_version >= "3.12" and python_version < "4.0"
|
||||
@ -47,6 +48,7 @@ nonebot-plugin-apscheduler==0.5.0 ; python_version >= "3.12" and python_version
|
||||
nonebot-plugin-waiter==0.8.1 ; python_version >= "3.12" and python_version < "4.0"
|
||||
nonebot2==2.4.3 ; python_version >= "3.12" and python_version < "4.0"
|
||||
nonechat==0.6.1 ; python_version >= "3.12" and python_version < "4.0"
|
||||
pillow==11.3.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
platformdirs==4.4.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
propcache==0.3.2 ; python_version >= "3.12" and python_version < "4.0"
|
||||
pycares==4.11.0 ; python_version >= "3.12" and python_version < "4.0"
|
||||
|
||||