const skFlow = require('../../config/skFlow'); const { liveMarkup } = require('../utility/live'); module.exports = { command: 'marine', handler: (bot, msg) => { const chatId = msg.chat.id; const data = skFlow.getWithFilter('meb.marine'); let text = ''; if (!data || Object.keys(data).length === 0) { text = 'Nessun dato sul mare disponibile.'; } else { text = '*Dati Meteo del mare*\n\n'; for (const [path, value] of Object.entries(data)) { const displayValue = typeof value === 'object' ? JSON.stringify(value) : value; //TODO: ADD units //TODO: Formattare meglio i path text += `*${path}*: ${displayValue}\n`; } } bot.sendMessage(chatId, text, { parse_mode: 'Markdown', reply_to_message_id: msg.message_id, reply_markup: liveMarkup(msg.message_id, 'marine') }); } };