mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-09-29 08:39:59 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a8eb9e67a | ||
|
|
8b7adf0a6a | ||
|
|
973182c27c | ||
|
|
0dced0bc90 |
@@ -687,6 +687,7 @@ python bot.py
|
|||||||
* 我有一个朋友功能,当艾特一个对象时,‘朋友’改为艾特对象的群名片或昵称
|
* 我有一个朋友功能,当艾特一个对象时,‘朋友’改为艾特对象的群名片或昵称
|
||||||
* 修复‘上传/删除/移动图片’目录不正确
|
* 修复‘上传/删除/移动图片’目录不正确
|
||||||
* 修复天气功能,当城市名在‘天气’后时报错
|
* 修复天气功能,当城市名在‘天气’后时报错
|
||||||
|
* 修复配置INITIAL_SETU_PROBABILITY不生效
|
||||||
|
|
||||||
### 2021/8/10
|
### 2021/8/10
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ async def remind_status(group: int, name: str, flag: bool) -> str:
|
|||||||
else:
|
else:
|
||||||
rst = "关闭"
|
rst = "关闭"
|
||||||
if not await GroupRemind.get_status(group, name):
|
if not await GroupRemind.get_status(group, name):
|
||||||
return f"该群已经{rst}过 {_name},请勿重复开启!"
|
return f"该群已经{rst}过 {_name},请勿重复关闭!"
|
||||||
if await GroupRemind.set_status(group, name, flag):
|
if await GroupRemind.set_status(group, name, flag):
|
||||||
info = command_info_dt[_name] if command_info_dt.get(_name) else ""
|
info = command_info_dt[_name] if command_info_dt.get(_name) else ""
|
||||||
if info:
|
if info:
|
||||||
|
|||||||
@@ -53,9 +53,7 @@ async def _(bot: Bot, event: MessageEvent, state: T_State):
|
|||||||
change_group_switch(_cmd, int(block_type), True)
|
change_group_switch(_cmd, int(block_type), True)
|
||||||
group_name = (await bot.get_group_info(group_id=int(block_type)))['group_name']
|
group_name = (await bot.get_group_info(group_id=int(block_type)))['group_name']
|
||||||
await switch_rule.send(f'已禁用群聊 {group_name}({block_type}) 的 {_cmd[2:]} 功能')
|
await switch_rule.send(f'已禁用群聊 {group_name}({block_type}) 的 {_cmd[2:]} 功能')
|
||||||
else:
|
elif block_type in ['all', 'private', 'group', 'a', 'p', 'g']:
|
||||||
if block_type not in ['all', 'private', 'group', 'a', 'p', 'g']:
|
|
||||||
block_type = 'all'
|
|
||||||
block_type = 'all' if block_type == 'a' else block_type
|
block_type = 'all' if block_type == 'a' else block_type
|
||||||
block_type = 'private' if block_type == 'p' else block_type
|
block_type = 'private' if block_type == 'p' else block_type
|
||||||
block_type = 'group' if block_type == 'g' else block_type
|
block_type = 'group' if block_type == 'g' else block_type
|
||||||
@@ -66,6 +64,8 @@ async def _(bot: Bot, event: MessageEvent, state: T_State):
|
|||||||
await switch_rule.send(f'已在私聊中{_cmd[:2]}功能:{_cmd[2:]}')
|
await switch_rule.send(f'已在私聊中{_cmd[:2]}功能:{_cmd[2:]}')
|
||||||
else:
|
else:
|
||||||
await switch_rule.send(f'已在群聊中{_cmd[:2]}功能:{_cmd[2:]}')
|
await switch_rule.send(f'已在群聊中{_cmd[:2]}功能:{_cmd[2:]}')
|
||||||
|
else:
|
||||||
|
await switch_rule.finish('格式错误:关闭[功能] [group]/[p/g]')
|
||||||
logger.info(
|
logger.info(
|
||||||
f'USER {event.user_id} 使用功能管理命令 {state["_prefix"]["raw_command"]} | {block_type}'
|
f'USER {event.user_id} 使用功能管理命令 {state["_prefix"]["raw_command"]} | {block_type}'
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ async def check_update(bot: Bot) -> int:
|
|||||||
height = len(update_info.split('\n')) * 24
|
height = len(update_info.split('\n')) * 24
|
||||||
for m in update_info.split('\n'):
|
for m in update_info.split('\n'):
|
||||||
if len(m) * 20 > width:
|
if len(m) * 20 > width:
|
||||||
width = len(m) * 24
|
width = len(m) * 18
|
||||||
A = CreateImg(width, height, font_size=20)
|
A = CreateImg(width, height, font_size=20)
|
||||||
A.text((10, 10), update_info)
|
A.text((10, 10), update_info)
|
||||||
A.save(f'{IMAGE_PATH}/update_info.png')
|
A.save(f'{IMAGE_PATH}/update_info.png')
|
||||||
|
|||||||
@@ -27,15 +27,16 @@ __plugin_usage__ = (
|
|||||||
|
|
||||||
_flmt = FreqLimiter(1)
|
_flmt = FreqLimiter(1)
|
||||||
|
|
||||||
if '色图' in IMAGE_DIR_LIST:
|
if "色图" in IMAGE_DIR_LIST:
|
||||||
IMAGE_DIR_LIST.remove('色图')
|
IMAGE_DIR_LIST.remove("色图")
|
||||||
|
|
||||||
cmd = set(IMAGE_DIR_LIST)
|
cmd = set(IMAGE_DIR_LIST)
|
||||||
|
|
||||||
# print(cmd)
|
# print(cmd)
|
||||||
|
|
||||||
send_img = on_command("img", aliases=cmd, priority=5, block=True)
|
send_img = on_command("img", aliases=cmd, priority=5, block=True)
|
||||||
pa = on_keyword({"爬", "爪巴"}, priority=1, block=True)
|
pa = on_keyword({"丢人爬", "爪巴"}, priority=5, block=True)
|
||||||
|
pa_reg = on_regex("^爬$", priority=5, block=True)
|
||||||
search_img = on_regex(".*[份|发|张|个|次|点]图.*?", priority=6, block=True)
|
search_img = on_regex(".*[份|发|张|个|次|点]图.*?", priority=6, block=True)
|
||||||
|
|
||||||
search_url = "https://api.fantasyzone.cc/tu/search.php"
|
search_url = "https://api.fantasyzone.cc/tu/search.php"
|
||||||
@@ -74,15 +75,27 @@ async def _(bot: Bot, event: MessageEvent, state: T_State):
|
|||||||
|
|
||||||
@pa.handle()
|
@pa.handle()
|
||||||
async def _(bot: Bot, event: MessageEvent, state: T_State):
|
async def _(bot: Bot, event: MessageEvent, state: T_State):
|
||||||
if isinstance(event, GroupMessageEvent):
|
if isinstance(event, GroupMessageEvent) and not await GroupRemind.get_status(
|
||||||
if await GroupRemind.get_status(event.group_id, "pa"):
|
event.group_id, "pa"
|
||||||
msg = get_message_text(event.json())
|
):
|
||||||
if not msg or str(event.get_message()[:2]) in ["开启", "关闭"]:
|
return
|
||||||
return
|
msg = get_message_text(event.json())
|
||||||
if not _flmt.check(event.user_id):
|
if not msg or str(event.get_message()[:2]) in ["开启", "关闭"]:
|
||||||
return
|
return
|
||||||
_flmt.start_cd(event.user_id)
|
if _flmt.check(event.user_id):
|
||||||
await pa.finish(image(random.choice(os.listdir(IMAGE_PATH + "pa")), "pa"))
|
_flmt.start_cd(event.user_id)
|
||||||
|
await pa.finish(image(random.choice(os.listdir(IMAGE_PATH + "pa")), "pa"))
|
||||||
|
|
||||||
|
|
||||||
|
@pa_reg.handle()
|
||||||
|
async def _(bot: Bot, event: MessageEvent, state: T_State):
|
||||||
|
if isinstance(event, GroupMessageEvent) and not await GroupRemind.get_status(
|
||||||
|
event.group_id, "pa"
|
||||||
|
):
|
||||||
|
return
|
||||||
|
if _flmt.check(event.user_id):
|
||||||
|
_flmt.start_cd(event.user_id)
|
||||||
|
await pa.finish(image(random.choice(os.listdir(IMAGE_PATH + "pa")), "pa"))
|
||||||
|
|
||||||
|
|
||||||
num_key = {
|
num_key = {
|
||||||
|
|||||||
Reference in New Issue
Block a user