Если еще нужно:
def send_photos(chat_id, text, owner, album): # Отправляем фото
count = randrange(vk.method('photos.get', {'owner_id': owner, 'album_id': album, 'count': 1})["count"])
photos = vk.method('photos.get', {'owner_id': owner, 'album_id': album, 'count': 1, 'offset': count})
t = choice(photos["items"])
try:
vk.method('messages.send',
{'random_id': 0000000, 'chat_id': chat_id, 'message': text,
'attachment': ('photo' + str(owner) + '_' + str(t["id"]))})
except vk_api.CAPTCHA_ERROR_CODE as error_msg:
write(chat_id, error_msg)