From 166ad9dd00b5e0ef9e8c9110d489158955ce3be0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 22:44:44 +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.2.0 → v0.3.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.2.0...v0.3.5) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e583fbe..048ca1b 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.2.0 + rev: v0.3.5 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] From 79bc8792e92cad53309d22ebc39ee35f6cc8e3b6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 22:44:53 +0000 Subject: [PATCH 2/2] :rotating_light: auto fix by pre-commit hooks --- nonebot/adapters/discord/api/client.py | 3 +-- nonebot/adapters/discord/api/model.py | 6 +++--- nonebot/adapters/discord/commands/storage.py | 4 ++-- nonebot/adapters/discord/message.py | 6 ++---- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/nonebot/adapters/discord/api/client.py b/nonebot/adapters/discord/api/client.py index 998b0b4..165d272 100644 --- a/nonebot/adapters/discord/api/client.py +++ b/nonebot/adapters/discord/api/client.py @@ -1,2 +1 @@ -class ApiClient: - ... +class ApiClient: ... diff --git a/nonebot/adapters/discord/api/model.py b/nonebot/adapters/discord/api/model.py index d741c2d..465a1ee 100644 --- a/nonebot/adapters/discord/api/model.py +++ b/nonebot/adapters/discord/api/model.py @@ -2652,9 +2652,9 @@ class GuildCreate(BaseModel): members: Missing[List["GuildMember"]] = UNSET channels: Missing[List["Channel"]] = UNSET threads: Missing[List["Channel"]] = UNSET - presences: Missing[ - List["PresenceUpdate"] - ] = UNSET # partial presence update objects + presences: Missing[List["PresenceUpdate"]] = ( + UNSET # partial presence update objects + ) stage_instances: Missing[List["StageInstance"]] = UNSET guild_scheduled_events: Missing[List["GuildScheduledEvent"]] = UNSET diff --git a/nonebot/adapters/discord/commands/storage.py b/nonebot/adapters/discord/commands/storage.py index 6b96562..44aee2f 100644 --- a/nonebot/adapters/discord/commands/storage.py +++ b/nonebot/adapters/discord/commands/storage.py @@ -10,9 +10,9 @@ _application_command_storage: Dict[str, "ApplicationCommandConfig"] = {} -OPTION_KEY: Literal[ +OPTION_KEY: Literal["_discord_application_command_options"] = ( "_discord_application_command_options" -] = "_discord_application_command_options" +) async def sync_application_command(bot: Bot): diff --git a/nonebot/adapters/discord/message.py b/nonebot/adapters/discord/message.py index 816dc34..3b49a1f 100644 --- a/nonebot/adapters/discord/message.py +++ b/nonebot/adapters/discord/message.py @@ -142,8 +142,7 @@ def timestamp( @staticmethod @overload - def reference(reference: MessageReference) -> "ReferenceSegment": - ... + def reference(reference: MessageReference) -> "ReferenceSegment": ... @staticmethod @overload @@ -152,8 +151,7 @@ def reference( channel_id: Optional[SnowflakeType] = None, guild_id: Optional[SnowflakeType] = None, fail_if_not_exists: Optional[bool] = None, - ) -> "ReferenceSegment": - ... + ) -> "ReferenceSegment": ... @staticmethod def reference(