zhenxun_bot/plugins/image_management/__init__.py

70 lines
1.6 KiB
Python
Raw Normal View History

2021-12-16 11:16:28 +08:00
from pathlib import Path
from typing import List, Tuple
2021-10-03 14:24:07 +08:00
import nonebot
from configs.config import Config
from configs.path_config import IMAGE_PATH
2021-11-04 16:11:50 +08:00
Config.add_plugin_config(
"image_management",
"IMAGE_DIR_LIST",
["美图", "萝莉", "壁纸"],
name="图库操作",
help_="公开图库列表,可自定义添加 [如果含有send_setu插件请不要添加色图库]",
default_value=[],
type=List[str],
2021-11-04 16:11:50 +08:00
)
Config.add_plugin_config(
"image_management",
"WITHDRAW_IMAGE_MESSAGE",
(0, 1),
name="图库操作",
help_="自动撤回参1延迟撤回发送图库图片的时间(秒)0 为关闭 | 参2监控聊天类型0(私聊) 1(群聊) 2(群聊+私聊)",
default_value=(0, 1),
type=Tuple[int, int],
2021-11-04 16:11:50 +08:00
)
Config.add_plugin_config(
2021-11-23 21:44:59 +08:00
"image_management:delete_image",
2021-11-04 16:11:50 +08:00
"DELETE_IMAGE_LEVEL [LEVEL]",
7,
help_="删除图库图片需要的管理员等级",
default_value=7,
type=int,
2021-11-04 16:11:50 +08:00
)
Config.add_plugin_config(
2021-11-23 21:44:59 +08:00
"image_management:move_image",
2021-11-04 16:11:50 +08:00
"MOVE_IMAGE_LEVEL [LEVEL]",
7,
help_="移动图库图片需要的管理员等级",
default_value=7,
type=int,
2021-11-04 16:11:50 +08:00
)
Config.add_plugin_config(
2021-11-23 21:44:59 +08:00
"image_management:upload_image",
2021-11-04 16:11:50 +08:00
"UPLOAD_IMAGE_LEVEL [LEVEL]",
6,
help_="上传图库图片需要的管理员等级",
default_value=6,
type=int,
2021-11-04 16:11:50 +08:00
)
2021-12-16 11:16:28 +08:00
Config.add_plugin_config(
"image_management",
"SHOW_ID",
True,
help_="是否消息显示图片下标id",
default_value=True,
type=bool,
2021-12-16 11:16:28 +08:00
)
2022-02-19 18:20:19 +08:00
(IMAGE_PATH / "image_management").mkdir(parents=True, exist_ok=True)
2021-12-16 11:16:28 +08:00
2021-11-04 16:11:50 +08:00
nonebot.load_plugins(str(Path(__file__).parent.resolve()))