Added getting bot settings from server

This commit is contained in:
2023-12-25 14:38:03 +03:00
parent 142d18bac3
commit 1893ab4ef9
5 changed files with 67 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
from aiohttp import ClientSession
from neuroapi.types import BotSettings as BotSettingsType
from .api_method import ApiMethod
class BotSettings(ApiMethod):
async def get(self)-> BotSettingsType:
async with ClientSession() as session:
response = await session.get(self.api_url+'/settings')
settings = BotSettingsType.from_dict(await response.json())
return settings