chore: メソッドの位置を変更

pull/125/head
yupix 8 months ago
parent f21868f2ec
commit d55f88c0a3
No known key found for this signature in database
GPG Key ID: 2FF705F5C56D9C06

@ -1042,11 +1042,50 @@ class NoteActions(ClientNoteActions):
"sinceDate": since_date,
"untilDate": until_date,
}
res = await self._session.request(
Route("POST", "/api/notes/local-timeline"), json=data, auth=True
)
return [Note(note, client=self._client) for note in res]
async def get_mentions(
self,
following: bool = False,
limit: int = 10,
since_id: str | None = None,
until_id: str | None = None,
visibility: INoteVisibility = "public",
):
"""Get notes with mentions addressed to you
Endpoint: `/api/notes/mentions`
Parameters
----------
following : bool, default=False
Whether to include only users you follow
limit : int, default=10
limit
since_id : str | None, default=None
Since ID
until_id : str | None, default=None
Until ID
visibility : INoteVisibility, default='public'
Disclosure range
"""
data = {
"following": following,
"limit": limit,
"sinceId": since_id,
"untilId": until_id,
"visibility": visibility,
}
res: list[INote] = await self._session.request(
Route("POST", "/api/notes/mentions"), json=data, auth=True
)
return [Note(note, client=self._client) for note in res]
@deprecated
@ -1230,45 +1269,6 @@ class NoteActions(ClientNoteActions):
if get_all is False or pagination.is_final:
break
async def get_mentions(
self,
following: bool = False,
limit: int = 10,
since_id: str | None = None,
until_id: str | None = None,
visibility: INoteVisibility = "public",
):
"""Get notes with mentions addressed to you
Endpoint: `/api/notes/mentions`
Parameters
----------
following : bool, default=False
Whether to include only users you follow
limit : int, default=10
limit
since_id : str | None, default=None
Since ID
until_id : str | None, default=None
Until ID
visibility : INoteVisibility, default='public'
Disclosure range
"""
data = {
"following": following,
"limit": limit,
"sinceId": since_id,
"untilId": until_id,
"visibility": visibility,
}
res: list[INote] = await self._session.request(
Route("POST", "/api/notes/mentions"), json=data, auth=True
)
return [Note(note, client=self._client) for note in res]
async def get_time_line(
self,
list_id: str,

@ -9,12 +9,13 @@ from mipac.http import HTTPClient
if TYPE_CHECKING:
from mipac.client import ClientManager
class ClientFavoriteManager(AbstractManager):
def __init__(self, note_id: str, *, session: HTTPClient, client: ClientManager):
self.__note_id = note_id
self.__session: HTTPClient = session
self.__client: ClientManager = client
@property
def action(self) -> ClientFavoriteActions:
"""お気に入りに関するアクション
@ -29,7 +30,7 @@ class ClientFavoriteManager(AbstractManager):
session=self.__session,
client=self.__client,
)
class FavoriteManager(AbstractManager):
def __init__(self, note_id: str | None = None, *, session: HTTPClient, client: ClientManager):

Loading…
Cancel
Save