mirror of
https://github.com/MrSedan/neuro-reply-bot-reworked.git
synced 2026-01-14 21:49:42 +03:00
edited: methods for new api types
This commit is contained in:
@@ -2,13 +2,15 @@ from aiohttp import ClientSession
|
||||
|
||||
from .api_method import ApiMethod
|
||||
|
||||
from neuroapi.types import Admin as AdminType
|
||||
|
||||
|
||||
class Admin(ApiMethod):
|
||||
|
||||
async def get(self):
|
||||
async with ClientSession() as session:
|
||||
response = await session.get(self.api_url+'/admin/get')
|
||||
return await response.json()
|
||||
return [AdminType.from_dict(admin) for admin in await response.json()]
|
||||
|
||||
async def is_admin(self, id: str):
|
||||
async with ClientSession() as session:
|
||||
|
||||
Reference in New Issue
Block a user