mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Add chat
This commit is contained in:
parent
a0a583ebca
commit
44c928ed47
3 changed files with 58 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ import aiohttp
|
|||
|
||||
from . import api
|
||||
from .api import ApiMethods
|
||||
from .types.chat import Chat
|
||||
from .types.user import User
|
||||
|
||||
|
||||
|
|
@ -47,3 +48,8 @@ class AIOGramBot:
|
|||
async def get_me(self) -> User:
|
||||
raw = await self.request(ApiMethods.GET_ME)
|
||||
return self._prepare_object(User.de_json(raw))
|
||||
|
||||
async def get_chat(self, chat_id) -> Chat:
|
||||
payload = {'chat_id': chat_id}
|
||||
raw = await self.request(ApiMethods.GET_CHAT, payload)
|
||||
return self._prepare_object(Chat.de_json(raw))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue