Fix JSON format issues with photos and add multi-photo gallery support
This commit is contained in:
@@ -168,25 +168,24 @@ export class EnhancedChatHandlers {
|
||||
|
||||
// ===== СИСТЕМА УВЕДОМЛЕНИЙ =====
|
||||
|
||||
// Отправить уведомление о новом сообщении
|
||||
// Отправить уведомление о новом сообщении - теперь используем NotificationService
|
||||
async sendMessageNotification(receiverTelegramId: string, senderName: string, messagePreview: string, matchId: string): Promise<void> {
|
||||
try {
|
||||
const receiverChatId = parseInt(receiverTelegramId);
|
||||
// Получаем идентификаторы пользователей для использования в NotificationService
|
||||
const receiverUserId = await this.profileService.getUserIdByTelegramId(receiverTelegramId);
|
||||
const sender = await this.chatService.getMatchInfo(matchId, receiverTelegramId);
|
||||
|
||||
await this.bot.sendMessage(
|
||||
receiverChatId,
|
||||
`💌 *Новое сообщение от ${senderName}*\n\n` +
|
||||
`"${this.escapeMarkdown(messagePreview)}"\n\n` +
|
||||
'👆 Нажмите "Открыть чат" для ответа',
|
||||
{
|
||||
parse_mode: 'Markdown',
|
||||
reply_markup: {
|
||||
inline_keyboard: [
|
||||
[{ text: '💬 Открыть чат', callback_data: `open_native_chat_${matchId}` }],
|
||||
[{ text: '📱 Все чаты', callback_data: 'native_chats' }]
|
||||
]
|
||||
}
|
||||
}
|
||||
if (!receiverUserId || !sender?.otherUserId) {
|
||||
console.error('Failed to get user IDs for notification');
|
||||
return;
|
||||
}
|
||||
|
||||
// Используем сервис уведомлений для отправки более красивого уведомления
|
||||
await this.notificationService.sendMessageNotification(
|
||||
receiverUserId,
|
||||
sender.otherUserId,
|
||||
messagePreview,
|
||||
matchId
|
||||
);
|
||||
} catch (error) {
|
||||
console.error('Error sending message notification:', error);
|
||||
|
||||
Reference in New Issue
Block a user