feat: add method

pull/27/head
yupix 2 years ago
parent 3a390600cf
commit 6cd798131e
No known key found for this signature in database
GPG Key ID: 2FF705F5C56D9C06

@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
## Added
- ✨ added `un_renote` method at `ClientNoteActions` class.
- ✨ added `get_children` method at `ClientNoteActions` class.
- ✨ added `invalidate` method at `FollowActions` class.
- ✨ added `cancel` method at `FollowRequestActions` class.

@ -4,9 +4,9 @@ from .chat import *
from .drive import *
from .favorite import *
from .follow import *
from .mute import *
from .my import *
from .note import *
from .poll import *
from .reaction import *
from .user import *
from .mute import *

@ -1,4 +1,5 @@
from __future__ import annotations
from typing import TYPE_CHECKING, AsyncIterable
from mipac.abstract.action import AbstractAction

@ -99,6 +99,27 @@ class ClientNoteActions(AbstractAction):
self._session: HTTPClient = session
self._client: ClientActions = client
async def un_renote(self, note_id: str | None = None) -> bool:
"""
Releases the note renote for the specified Id
Parameters
----------
note_id : str | None, optional
Target note Id., by default None
Returns
-------
bool
Whether the release was successful
"""
body = {'noteId': note_id}
res: bool = await self._session.request(
Route('POST', '/api/notes/unrenote'), auth=True, json=body
)
return res
async def get_children(
self,
limit: int = 100,

@ -8,10 +8,10 @@ from .client import *
from .drive import *
from .favorite import *
from .follow import *
from .mute import *
from .my import *
from .note import *
from .page import *
from .poll import *
from .reaction import *
from .user import *
from .mute import *

@ -7,10 +7,10 @@ from mipac.manager.admin.manager import AdminManager
from mipac.manager.chart import ChartManager
from mipac.manager.chat import ChatManager
from mipac.manager.drive import DriveManager
from mipac.manager.follow import FollowManager, FollowRequestManager
from mipac.manager.my import MyManager
from mipac.manager.note import NoteManager
from mipac.manager.user import UserManager
from mipac.manager.follow import FollowManager, FollowRequestManager
if TYPE_CHECKING:
from mipac.config import Config
@ -32,12 +32,10 @@ class ClientActions:
self.drive: DriveManager = DriveManager(session=session, client=self)
self.chart: ChartManager = ChartManager(session=session, client=self)
self.follow: FollowManager = FollowManager(
session=session,
client=self,
session=session, client=self,
)
self.follow_request: FollowRequestManager = FollowRequestManager(
session=session,
client=self,
session=session, client=self,
)
self._config: Config = config

@ -5,9 +5,9 @@ from .emoji import *
from .follow import *
from .instance import *
from .lite import *
from .mute import *
from .note import *
from .notification import *
from .poll import *
from .reaction import *
from .user import *
from .mute import *

@ -7,10 +7,10 @@ from .emoji import *
from .endpoints import *
from .follow import *
from .instance import *
from .mute import *
from .note import *
from .notification import *
from .page import *
from .poll import *
from .reaction import *
from .user import *
from .mute import *

Loading…
Cancel
Save