mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-09-14 00:33:10 +00:00
feat(branding): загрузка видео стартового меню бота
Парная фронтовая часть к /cabinet/branding/bot-start-video (бот: 524960c3). В «Брендинге» появилась карточка: загрузить/заменить/удалить видео, которое бот прикрепляет к сообщению /start вместо картинки-логотипа, и статус текущего состояния. Файл разово уходит в Telegram ради file_id — на нашей стороне не хранится. Видео в рассылках уже работало (кнопка в боте, загрузка в кабинете, доставка send_video) и не затронуто. Локали ru/en/zh/fa.
This commit is contained in:
@@ -149,6 +149,11 @@ export const initLogoPreload = () => {
|
||||
}
|
||||
};
|
||||
|
||||
export interface BotStartVideoInfo {
|
||||
has_video: boolean;
|
||||
file_id?: string | null;
|
||||
}
|
||||
|
||||
export const brandingApi = {
|
||||
// Get current branding (public, no auth required)
|
||||
getBranding: async (): Promise<BrandingInfo> => {
|
||||
@@ -176,6 +181,29 @@ export const brandingApi = {
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// ── Видео стартового меню бота ────────────────────────────────────────
|
||||
// Хранится как Telegram file_id: файл на нашей стороне не сохраняется.
|
||||
|
||||
getBotStartVideo: async (): Promise<BotStartVideoInfo> => {
|
||||
const response = await apiClient.get<BotStartVideoInfo>('/cabinet/branding/bot-start-video');
|
||||
return response.data;
|
||||
},
|
||||
|
||||
uploadBotStartVideo: async (file: File): Promise<BotStartVideoInfo> => {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const response = await apiClient.post<BotStartVideoInfo>(
|
||||
'/cabinet/branding/bot-start-video',
|
||||
formData,
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
deleteBotStartVideo: async (): Promise<BotStartVideoInfo> => {
|
||||
const response = await apiClient.delete<BotStartVideoInfo>('/cabinet/branding/bot-start-video');
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Delete custom logo (admin only)
|
||||
deleteLogo: async (): Promise<BrandingInfo> => {
|
||||
const response = await apiClient.delete<BrandingInfo>('/cabinet/branding/logo');
|
||||
|
||||
Reference in New Issue
Block a user