Add send get photo

This commit is contained in:
Alex Root Junior 2017-05-30 23:22:20 +03:00
parent 19e7b15a9f
commit 56c6cf6839
2 changed files with 7 additions and 1 deletions

View file

@ -103,7 +103,7 @@ class ApiMethods:
SEND_CONTACT = 'sendContact'
SEND_CHAT_ACTION = 'sendChatAction'
GET_USER_PROFILE_PHOTOS = 'getUserProfilePhotos'
GET_FILE = 'getFile' # TODO
GET_FILE = 'getFile'
KICK_CHAT_MEMBER = 'kickChatMember' # TODO
UNBAN_CHAT_MEMBER = 'unbanChatMember' # TODO
LEAVE_CHAT = 'leaveChat' # TODO

View file

@ -3,6 +3,7 @@ import json
import aiohttp
from aiogram.types.file import File
from aiogram.types.user_profile_photos import UserProfilePhotos
from . import api
from .api import ApiMethods
@ -265,3 +266,8 @@ class AIOGramBot:
payload = generate_payload(**locals())
message = await self.request(ApiMethods.GET_USER_PROFILE_PHOTOS, payload)
return self.prepare_object(UserProfilePhotos.de_json(message))
async def get_file(self, file_id):
payload = generate_payload(**locals())
message = await self.request(ApiMethods.GET_FILE, payload)
return self.prepare_object(File.de_json(message))