From 345ad08bec8f168c0f65e9c680e2146f4bc7a2c6 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sun, 21 Sep 2025 12:49:08 +0200 Subject: [PATCH] :rotating_light: Fix linter screaming --- discord/guild.py | 4 ++-- discord/state.py | 2 +- tests/test_typing_annotated.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/discord/guild.py b/discord/guild.py index 6d9876c762..3b43d61af9 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -534,7 +534,7 @@ def _sync(self, data: GuildPayload) -> None: if "channels" in data: channels = data["channels"] for c in channels: - factory, ch_type = _guild_channel_factory(c["type"]) + factory, _ch_type = _guild_channel_factory(c["type"]) if factory: self._add_channel(factory(guild=self, data=c, state=self._state)) # type: ignore @@ -1885,7 +1885,7 @@ async def fetch_channels(self) -> Sequence[GuildChannel]: data = await self._state.http.get_all_guild_channels(self.id) def convert(d): - factory, ch_type = _guild_channel_factory(d["type"]) + factory, _ch_type = _guild_channel_factory(d["type"]) if factory is None: raise InvalidData("Unknown channel type {type} for channel ID {id}.".format_map(d)) diff --git a/discord/state.py b/discord/state.py index 4cb14830fd..a6925df145 100644 --- a/discord/state.py +++ b/discord/state.py @@ -985,7 +985,7 @@ def parse_channel_update(self, data) -> None: ) def parse_channel_create(self, data) -> None: - factory, ch_type = _channel_factory(data["type"]) + factory, _ch_type = _channel_factory(data["type"]) if factory is None: _log.debug( "CHANNEL_CREATE referencing an unknown channel type %s. Discarding.", diff --git a/tests/test_typing_annotated.py b/tests/test_typing_annotated.py index ede5530777..f867469072 100644 --- a/tests/test_typing_annotated.py +++ b/tests/test_typing_annotated.py @@ -77,7 +77,7 @@ async def echo(self, ctx, txt: Annotated[str, discord.Option(description="Some t def test_typing_annotated_optional(): - async def echo(ctx, txt: Annotated[Optional[str], discord.Option()]): + async def echo(ctx, txt: Annotated[str | None, discord.Option()]): await ctx.respond(txt) cmd = SlashCommand(echo)