Improve VK photo-upload error message and token instructions
- Replace the misleading 'community token cannot upload photos' fallback warning with the actual VK error and a concrete checklist (photos right + token bound to the same group) - Extend UI hint with troubleshooting note for the 'photos as links' symptom Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+4
-1
@@ -292,7 +292,10 @@ class VKAPI
|
||||
|
||||
try {
|
||||
$result = $this->wallPost($numericGroupId, $messageWithPhotos, []);
|
||||
$result['warning'] = 'Фото добавлены как ссылки. Community-токен не поддерживает загрузку фото - нужен пользовательский токен.';
|
||||
$firstError = $uploadErrors[0] ?? 'неизвестная ошибка';
|
||||
$result['warning'] = 'Фото добавлены как ссылки — VK отказал в загрузке (' . $firstError . '). '
|
||||
. 'Проверьте, что ключ сообщества создан с правом «Фотографии» и принадлежит ИМЕННО той группе, в которую вы постите. '
|
||||
. 'Если используете пользовательский токен — у него должны быть права wall, photos, groups.';
|
||||
return $result;
|
||||
} catch (Exception $e) {
|
||||
throw new RuntimeException('Ошибка постинга: ' . $e->getMessage() . '. Также нет прав на загрузку фото.');
|
||||
|
||||
Reference in New Issue
Block a user