Skip to content

Commit

Permalink
feat!: ClientMuteActionsの対象のIDを指定する引数を削除 #140
Browse files Browse the repository at this point in the history
  • Loading branch information
yupix committed Jun 18, 2024
1 parent 7e40adb commit 61257ad
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions mipac/actions/users/mute.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,11 @@ def __init__(self, user_id: str, *, session: HTTPClient, client: ClientManager):
self.__user_id: str = user_id

@override
async def create(self, expires_at: int | None = None, *, user_id: str | None = None) -> bool:
async def create(self, expires_at: int | None = None) -> bool:
"""指定したユーザーをミュートします
Parameters
----------
user_id : str
対象のユーザーID
expires_at : int | None
ミュートする期間(秒)、無期限でミュートする場合はNoneを指定します
Expand All @@ -79,27 +77,18 @@ async def create(self, expires_at: int | None = None, *, user_id: str | None = N
bool
ミュートに成功したかどうか
"""
user_id = user_id or self.__user_id

return await super().create(expires_at=expires_at, user_id=user_id or self.__user_id)
return await super().create(expires_at=expires_at, user_id=self.__user_id)

@override
async def delete(self, *, user_id: str | None = None) -> bool:
async def delete(self) -> bool:
"""指定したユーザーのミュートを解除します
Parameters
----------
user_id : str
対象のユーザーID
Returns
-------
bool
ミュート解除に成功したかどうか
"""
user_id = user_id or self.__user_id

return await super().delete(user_id=user_id or self.__user_id)
return await super().delete(user_id=self.__user_id)


class MuteActions(SharedMuteActions):
Expand Down

0 comments on commit 61257ad

Please sign in to comment.