Skip to content

Commit b3d58a1

Browse files
committed
Fix VkUpload.photo_chat
1 parent af94a79 commit b3d58a1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

vk_api/upload.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,13 @@ def photo_chat(self, photo, chat_id):
133133
values = {'chat_id': chat_id}
134134
url = self.vk.method('photos.getChatUploadServer', values)['upload_url']
135135

136-
photo_file = open_files(photo)
136+
photo_file = open_files(photo, key_format='file')
137137
response = self.vk.http.post(url, files=photo_file)
138138
close_files(photo_file)
139139

140-
response = self.vk.method('messages.setChatPhoto', response.json())
140+
response = self.vk.method('messages.setChatPhoto', {
141+
'file': response.json()['response']
142+
})
141143

142144
return response
143145

0 commit comments

Comments
 (0)