Compare commits

..
7 Commits
Author SHA1 Message Date
hibiki fc34cd541a code 2021-08-18 01:33:43 +08:00
hibiki 8090ebe8ce update hook 2021-08-18 01:29:36 +08:00
hibiki f87c14595f update hook 2021-08-18 00:44:03 +08:00
hibiki 39bb5a9ab9 update check_zhenxun_update 2021-08-18 00:26:11 +08:00
hibiki f754ad1c76 update code 2021-08-18 00:17:57 +08:00
hibiki 37e1a06528 update checkup 2021-08-18 00:14:55 +08:00
hibiki 7096d258db update code 2021-08-17 23:49:07 +08:00
4 changed files with 19 additions and 13 deletions
+3 -3
View File
@@ -95,8 +95,8 @@ async def check_update(bot: Bot) -> int:
height = len(update_info.split('\n')) * 24
for m in update_info.split('\n'):
if len(m) * 20 > width:
width = len(m) * 17
A = CreateImg(800, height, font_size=20)
width = len(m) * 24
A = CreateImg(width, height, font_size=20)
A.text((10, 10), update_info)
A.save(f'{IMAGE_PATH}/update_info.png')
return 200
@@ -130,7 +130,7 @@ def _file_handle(latest_version: str):
tf = tarfile.open(zhenxun_latest_tar_gz)
tf.extractall(temp_dir)
logger.info("解压真寻文件压缩包完成....")
zhenxun_latest_file = Path(temp_dir) / f"zhenxun_bot-{latest_version[1:]}"
zhenxun_latest_file = Path(temp_dir) / os.listdir(temp_dir)[0]
update_info_file = Path(zhenxun_latest_file) / "update_info.json"
update_info = json.load(open(update_info_file, "r", encoding="utf8"))
update_file = update_info["update_file"]
+13 -9
View File
@@ -7,6 +7,7 @@ from nonebot.adapters.cqhttp import (
MessageEvent,
PrivateMessageEvent,
GroupMessageEvent,
PokeNotifyEvent
)
from configs.config import (
BAN_RESULT,
@@ -132,7 +133,7 @@ _flmt_c = FreqLimiter(CHECK_NOTICE_INFO_CD)
@run_preprocessor
async def _(matcher: Matcher, bot: Bot, event: MessageEvent, state: T_State):
if (
not isinstance(event, MessageEvent)
(not isinstance(event, MessageEvent) and matcher.module != "poke")
or await BanUser.is_ban(event.user_id)
or str(event.user_id) in bot.config.superusers
):
@@ -167,8 +168,9 @@ async def _(matcher: Matcher, bot: Bot, event: MessageEvent, state: T_State):
except ActionFailed:
pass
raise IgnoredException("权限不足")
if module in plugins2info_dict.keys():
if isinstance(event, GroupMessageEvent):
if module in plugins2info_dict.keys() and matcher.priority not in [1, 9]:
# 戳一戳单独判断
if isinstance(event, GroupMessageEvent) or (isinstance(event, PokeNotifyEvent) and event.group_id):
# 群权限
if plugins2info_dict[module]["level"] > group_manager.get_group_level(
str(event.group_id)
@@ -185,7 +187,7 @@ async def _(matcher: Matcher, bot: Bot, event: MessageEvent, state: T_State):
# 插件状态
if not group_manager.get_plugin_status(module, str(event.group_id)):
try:
if _flmt_s.check(event.group_id):
if module != "poke" and _flmt_s.check(event.group_id):
_flmt_s.start_cd(event.group_id)
await bot.send_group_msg(
group_id=event.group_id, message="该群未开启此功能.."
@@ -230,12 +232,14 @@ async def _(matcher: Matcher, bot: Bot, event: MessageEvent, state: T_State):
pass
raise IgnoredException("该插件在私聊中已被禁用...")
# 维护
if not group_manager.get_plugin_status(
module, block_type="all"
) and not group_manager.check_group_is_white(event.group_id):
if not group_manager.get_plugin_status(module, block_type="all"):
if isinstance(
event, GroupMessageEvent
) and group_manager.check_group_is_white(event.group_id):
return
try:
if _flmt_c.check(event.group_id):
_flmt_c.start_cd(event.group_id)
if _flmt_c.check(event.user_id):
_flmt_c.start_cd(event.user_id)
if isinstance(event, GroupMessageEvent):
await bot.send_group_msg(
group_id=event.group_id, message="此功能正在维护..."
+3
View File
@@ -27,6 +27,9 @@ __plugin_usage__ = (
_flmt = FreqLimiter(1)
if '色图' in IMAGE_DIR_LIST:
IMAGE_DIR_LIST.remove('色图')
cmd = set(IMAGE_DIR_LIST)
# print(cmd)
-1
View File
@@ -1,6 +1,5 @@
{
"update_file": [
".env.dev",
"configs/config.py",
"configs/path_config.py",
"plugins/aconfig",