Skip to content

Commit 6faeb41

Browse files
fix: Clean up some mypy warnings (#1439)
Co-authored-by: LordOfPolls <dev@lordofpolls.com>
1 parent 5af62fe commit 6faeb41

File tree

7 files changed

+7
-8
lines changed

7 files changed

+7
-8
lines changed

interactions/api/events/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from interactions.models.discord.snowflake import to_snowflake
1010

1111
if TYPE_CHECKING:
12-
from interactions import Client
12+
from interactions.client.client import Client
1313
from interactions.models.discord.snowflake import Snowflake_Type
1414
from interactions.models.discord.guild import Guild
1515

interactions/client/mixins/modal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
class ModalMixin:
12-
client: "interactions.Client"
12+
client: "interactions.client.client.Client"
1313
"""The client that created this context."""
1414
responded: bool
1515
"""Whether this context has been responded to."""

interactions/client/utils/input_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def enc_hook(obj: Any) -> int:
3535

3636
json_mode = "msgspec"
3737
else:
38-
import json
38+
import json # type: ignore
3939

4040
get_logger().debug(f"Using {json_mode} for JSON encoding and decoding.")
4141

interactions/models/discord/file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __attrs_post_init__(self) -> None:
3232
else:
3333
self.file_name = Path(self.file).name
3434

35-
def open_file(self) -> BinaryIO:
35+
def open_file(self) -> BinaryIO | IOBase:
3636
"""
3737
Opens the file.
3838
@@ -55,7 +55,7 @@ def __exit__(self, exc_type, exc_val, exc_tb) -> None:
5555
UPLOADABLE_TYPE = Union[File, IOBase, BinaryIO, Path, str]
5656

5757

58-
def open_file(file: UPLOADABLE_TYPE) -> BinaryIO:
58+
def open_file(file: UPLOADABLE_TYPE) -> BinaryIO | IOBase:
5959
"""
6060
Opens the file.
6161

interactions/models/discord/scheduled_event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from .enums import ScheduledEventPrivacyLevel, ScheduledEventType, ScheduledEventStatus
1616

1717
if TYPE_CHECKING:
18-
from interactions.client import Client
18+
from interactions.client.client import Client
1919
from interactions.models.discord.channel import GuildStageVoice, GuildVoice
2020
from interactions.models.discord.guild import Guild
2121
from interactions.models.discord.user import Member

interactions/models/internal/active_voice_state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ async def stop_recording(self) -> dict[int, BytesIO]:
267267
Returns:
268268
dict[snowflake, BytesIO]: The recorded audio
269269
"""
270-
if not self.recorder or not self.recorder.recording:
270+
if not self.recorder or not self.recorder.recording or not self.recorder.audio:
271271
raise RuntimeError("No recorder is running!")
272272
await self.recorder.stop_recording()
273273

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ skip = ["__init__.py"]
8484

8585
[tool.mypy]
8686
ignore_missing_imports = true
87-
plugins = "naff.ext.mypy"
8887

8988
[tool.pyright]
9089
useLibraryCodeForTypes = true

0 commit comments

Comments
 (0)