27 lines
878 B
JavaScript
27 lines
878 B
JavaScript
module.exports = [
|
|
{
|
|
id: 'data-refresh',
|
|
execute: async ({ bot, chatId, msg }) => {
|
|
const dataCmd = require('../commands/data.js');
|
|
const newText = dataCmd.formatSensorData();
|
|
|
|
try {
|
|
await bot.editMessageText(newText, {
|
|
chat_id: chatId,
|
|
message_id: msg.message_id,
|
|
parse_mode: 'Markdown',
|
|
reply_markup: {
|
|
inline_keyboard: [
|
|
[{ text: 'Aggiorna', callback_data: 'data-refresh' }]
|
|
]
|
|
}
|
|
});
|
|
} catch (e) {
|
|
if (!e.message.includes('message is not modified')) {
|
|
console.error('[Telegram Data] Errore refresh:', e.message);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
];
|