From 836ef79a99588a25c3c2676fc660811708b4b822 Mon Sep 17 00:00:00 2001 From: yzhh <2596322644@qq.com> Date: Sat, 13 Aug 2022 15:13:30 +0800 Subject: [PATCH] bugfix --- bots/aiocqhttp/bot.py | 1 - bots/aiogram/bot.py | 1 - console.py | 2 +- core/console/template.py | 1 + core/parser/message.py | 3 ++- modules/cytoid/rating.py | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bots/aiocqhttp/bot.py b/bots/aiocqhttp/bot.py index 8f4ad8af..b0e0537c 100644 --- a/bots/aiocqhttp/bot.py +++ b/bots/aiocqhttp/bot.py @@ -60,7 +60,6 @@ async def _(event: Event): Session(message=event, target=event.group_id if event.detail_type == 'group' else event.user_id, sender=event.user_id)) - MessageTaskManager.check(msg) await parser(msg, running_mention=True, prefix=prefix) diff --git a/bots/aiogram/bot.py b/bots/aiogram/bot.py index a665d50f..fb052009 100644 --- a/bots/aiogram/bot.py +++ b/bots/aiogram/bot.py @@ -28,7 +28,6 @@ async def msg_handler(message: types.Message): messageId=message.message_id, replyId=replyId), Session(message=message, target=message.chat.id, sender=message.from_user.id)) - MessageTaskManager.check(msg) await parser(msg) diff --git a/console.py b/console.py index ca3b4a00..8666a007 100644 --- a/console.py +++ b/console.py @@ -35,8 +35,8 @@ async def console_scheduler(): async def console_command(): try: m = await aioconsole.ainput('> ') + asyncio.create_task(console_command()) await send_command(m) - await console_command() except KeyboardInterrupt: print('Exited.') exit() diff --git a/core/console/template.py b/core/console/template.py index 03ff2778..b22445d4 100644 --- a/core/console/template.py +++ b/core/console/template.py @@ -45,6 +45,7 @@ class Template(MS): if msgchain is not None: send = await self.sendMessage(msgchain) print("(发送“是”或符合确认条件的词语来确认)") + print(self.session.auto_interactions) if self.session.auto_interactions: c = self.session.auto_interactions[0] del self.session.auto_interactions[0] diff --git a/core/parser/message.py b/core/parser/message.py index 1289deab..0d59c123 100644 --- a/core/parser/message.py +++ b/core/parser/message.py @@ -17,7 +17,7 @@ from core.logger import Logger from core.parser.args import Template, ArgumentPattern, templates_to_str from core.parser.command import CommandParser from core.tos import warn_target -from core.utils import removeIneffectiveText, removeDuplicateSpace +from core.utils import removeIneffectiveText, removeDuplicateSpace, MessageTaskManager from database import BotDBUtil enable_tos = Config('enable_tos') @@ -86,6 +86,7 @@ async def parser(msg: MessageSession, require_enable_modules: bool = True, prefi identify_str = f'[{msg.target.senderId}{f" ({msg.target.targetId})" if msg.target.targetFrom != msg.target.senderFrom else ""}]' # Logger.info(f'{identify_str} -> [Bot]: {display}') try: + MessageTaskManager.check(msg) modules = ModulesManager.return_modules_list_as_dict(msg.target.targetFrom) modulesAliases = ModulesManager.return_modules_alias_map() modulesRegex = ModulesManager.return_specified_type_modules(RegexCommand, targetFrom=msg.target.targetFrom) diff --git a/modules/cytoid/rating.py b/modules/cytoid/rating.py index d7873e33..6a45aec4 100644 --- a/modules/cytoid/rating.py +++ b/modules/cytoid/rating.py @@ -149,7 +149,7 @@ async def get_rating(uid, query_type): output = ImageOps.fit(im, mask.size, centering=(0.5, 0.5)) output.putalpha(mask) output.convert('RGBA') - b30img.alpha_composite(output, (1825, 25)) + b30img.alpha_composite(output, (1825, 24)) except: traceback.print_exc()