diff --git a/genshinuid_config/set_config.py b/genshinuid_config/set_config.py index 9a5c4061..1b3991cd 100644 --- a/genshinuid_config/set_config.py +++ b/genshinuid_config/set_config.py @@ -20,6 +20,7 @@ SWITCH_MAP = { '随机图': 'RandomPic', '定时签到': 'SchedSignin', '定时米游币': 'SchedMhyBBSCoin', + '催命模式': 'CrazyNotice', } PUSH_MAP = { diff --git a/genshinuid_resin/notice.py b/genshinuid_resin/notice.py index e8e0841e..2baf88a7 100644 --- a/genshinuid_resin/notice.py +++ b/genshinuid_resin/notice.py @@ -4,6 +4,7 @@ from nonebot.log import logger from ..utils.mhy_api.get_mhy_data import get_daily_data from ..utils.db_operation.db_operation import ( + config_check, get_push_data, update_is_pushed, get_all_push_list, @@ -54,10 +55,13 @@ async def all_check( for mode in ['Coin', 'Resin', 'Go', 'Transform']: # 检查条件 if push_data[f'{mode}IsPush'] == 'on': - if not await check(mode, raw_data, push_data[f'{mode}Value']): - await update_is_pushed(uid, mode, 'off') - continue + if not await config_check('CrazyNotice'): + if not await check(mode, raw_data, push_data[f'{mode}Value']): + await update_is_pushed(uid, mode, 'off') + continue + # 准备推送 if await check(mode, raw_data, push_data[f'{mode}Value']): + # on 推送到私聊 if push_data[f'{mode}Push'] == 'on': # 初始化 if qid not in private_msg_list: @@ -65,8 +69,10 @@ async def all_check( # 添加私聊信息 private_msg_list[qid] += NOTICE[mode] await update_is_pushed(uid, mode, 'on') + # off不推送 elif push_data[f'{mode}Push'] == 'off': pass + # 群号推送到群聊 else: # 初始化 if push_data[f'{mode}Push'] not in group_msg_list: