diff --git a/mipac/actions/channel.py b/mipac/actions/channel.py index b27eddf..77a8c21 100644 --- a/mipac/actions/channel.py +++ b/mipac/actions/channel.py @@ -71,4 +71,3 @@ class ChannelActions(ClientChannelActions): Route('POST', '/api/channels/my-favorites'), auth=True ) return [Channel(i, client=self._client) for i in res] - diff --git a/mipac/actions/drive.py b/mipac/actions/drive.py index 4d99628..1060bdd 100644 --- a/mipac/actions/drive.py +++ b/mipac/actions/drive.py @@ -23,7 +23,7 @@ class FileActions(AbstractAction): self.__client: ClientManager = client self.__file_id = file_id - async def show_file(self, file_id: str | None, url: str | None) -> File: + async def show_file(self, file_id: str | None = None, url: str | None = None) -> File: """ ファイルの情報を取得します。 diff --git a/mipac/config.py b/mipac/config.py index d010dce..51c1164 100644 --- a/mipac/config.py +++ b/mipac/config.py @@ -17,6 +17,7 @@ class CacheConfig: IMisskeyDistribution = Literal['ayuskey', 'm544', 'areionskey', 'official'] IMisskeyVersions = Literal[13, 12, 11] + class ILimits(TypedDict, total=False): channel_name: int channel_description: int diff --git a/mipac/manager/channel.py b/mipac/manager/channel.py index 9094779..5f1d2af 100644 --- a/mipac/manager/channel.py +++ b/mipac/manager/channel.py @@ -1,4 +1,3 @@ - from __future__ import annotations from typing import TYPE_CHECKING @@ -11,11 +10,15 @@ if TYPE_CHECKING: class ChannelManager(AbstractManager): - def __init__(self, channel_id: str | None = None, *, session: HTTPClient, client: ClientManager): + def __init__( + self, channel_id: str | None = None, *, session: HTTPClient, client: ClientManager + ): self.__channel_id: str | None = channel_id self.__session: HTTPClient = session self.__client: ClientManager = client @property def action(self) -> ChannelActions: - return ChannelActions(channel_id=self.__channel_id, session=self.__session, client=self.__client) + return ChannelActions( + channel_id=self.__channel_id, session=self.__session, client=self.__client + ) diff --git a/mipac/models/lite/channel.py b/mipac/models/lite/channel.py index dbe0787..5183da0 100644 --- a/mipac/models/lite/channel.py +++ b/mipac/models/lite/channel.py @@ -8,7 +8,7 @@ from mipac.utils.format import str_to_datetime if TYPE_CHECKING: from mipac.manager import ClientManager from mipac.manager.channel import ChannelManager - + T = TypeVar('T', bound=IChannelLite) diff --git a/mipac/models/note.py b/mipac/models/note.py index 37267ec..fb48276 100644 --- a/mipac/models/note.py +++ b/mipac/models/note.py @@ -206,7 +206,6 @@ class Note(PartialNote[INote]): return Poll(self._note['poll'], client=self._client) if 'poll' in self._note else None - class NoteTranslateResult: """ NoteTranslateResult diff --git a/mipac/types/endpoints.py b/mipac/types/endpoints.py index 6686fd0..65f86e8 100644 --- a/mipac/types/endpoints.py +++ b/mipac/types/endpoints.py @@ -359,5 +359,5 @@ ENDPOINTS = Literal[ '/api/channels/search', '/api/emoji', '/api/roles/notes', - '/api/users/update-memo' + '/api/users/update-memo', ] diff --git a/mipac/utils/util.py b/mipac/utils/util.py index 7354e43..dac38c4 100644 --- a/mipac/utils/util.py +++ b/mipac/utils/util.py @@ -66,4 +66,5 @@ class Colors: self.green = '\x1b[92;1m' self.reset = '\x1b[0m' + COLORS = Colors()