From 56790e16b905f214e6e0d5feba7f928f46f5d0c5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 20:21:28 +0000 Subject: [PATCH 1/2] :arrow_up: auto update by pre-commit hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.5.0 → v0.5.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.0...v0.5.6) - [github.com/psf/black: 24.4.2 → 24.8.0](https://github.com/psf/black/compare/24.4.2...24.8.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 56889c6..984e1a5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ ci: autoupdate_commit_msg: ":arrow_up: auto update by pre-commit hooks" repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.0 + rev: v0.5.6 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] @@ -20,7 +20,7 @@ repos: stages: [commit] - repo: https://github.com/psf/black - rev: 24.4.2 + rev: 24.8.0 hooks: - id: black stages: [commit] From 752836d32bcd8358b6af1fe6a85216179a55402c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 20:21:35 +0000 Subject: [PATCH 2/2] :rotating_light: auto fix by pre-commit hooks --- nonebot_plugin_all4one/middlewares/base.py | 6 ++---- nonebot_plugin_all4one/middlewares/telegram.py | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/nonebot_plugin_all4one/middlewares/base.py b/nonebot_plugin_all4one/middlewares/base.py index 87d0d64..64e243a 100644 --- a/nonebot_plugin_all4one/middlewares/base.py +++ b/nonebot_plugin_all4one/middlewares/base.py @@ -3,10 +3,10 @@ from anyio import open_file from nonebot.adapters import Bot, Event, Message +from nonebot.adapters.onebot.v12.event import BotSelf from nonebot.adapters.onebot.v12 import UnsupportedAction from nonebot.adapters.onebot.v12.exception import BadParam from nonebot.adapters.onebot.v12 import Event as OneBotEvent -from nonebot.adapters.onebot.v12.event import BotSelf from ..database import get_file, upload_file @@ -112,9 +112,7 @@ async def get_self_info( """获取机器人自身信息""" raise NotImplementedError - async def get_user_info( - self, *, user_id: str, **kwargs: Any - ) -> dict[ + async def get_user_info(self, *, user_id: str, **kwargs: Any) -> dict[ Union[Literal["user_id", "user_name", "user_displayname", "user_remark"], str], str, ]: diff --git a/nonebot_plugin_all4one/middlewares/telegram.py b/nonebot_plugin_all4one/middlewares/telegram.py index 903624c..0e5e668 100644 --- a/nonebot_plugin_all4one/middlewares/telegram.py +++ b/nonebot_plugin_all4one/middlewares/telegram.py @@ -219,9 +219,7 @@ async def get_self_info( } @supported_action - async def get_user_info( - self, *, user_id: str, **kwargs: Any - ) -> dict[ + async def get_user_info(self, *, user_id: str, **kwargs: Any) -> dict[ Union[Literal["user_id", "user_name", "user_displayname", "user_remark"], str], str, ]: