Skip to content

Commit

Permalink
feat: show-userをサポート
Browse files Browse the repository at this point in the history
  • Loading branch information
yupix committed Jan 20, 2023
1 parent 928ca87 commit 3749650
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mipac/actions/admins/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
from mipac.http import HTTPClient, Route
from mipac.models.admin import IndexStat, ModerationLog, ServerInfo, UserIP
from mipac.models.meta import AdminMeta
from mipac.models.user import UserDetailed
from mipac.types.admin import IIndexStat, IModerationLog, IServerInfo, ITableStats, IUserIP
from mipac.types.meta import IAdminMeta, IUpdateMetaBody
from mipac.config import config
from mipac.types.user import IUserDetailed
from mipac.util import cache, convert_dict_keys_to_camel

if TYPE_CHECKING:
Expand Down Expand Up @@ -220,3 +222,9 @@ async def get_user_ips(self, user_id: str) -> list[UserIP]:
lower=True,
)
return [UserIP(i) for i in res]

async def show_user(self, user_id: str) -> UserDetailed:
res: IUserDetailed = await self.__session.request(
Route('POST', '/api/admin/show-user'), auth=True, json={'userId': user_id}
)
return UserDetailed(res, client=self.__client)

0 comments on commit 3749650

Please sign in to comment.