Aggiunto collegamento al server
This commit is contained in:
26
plugin/telegram/callbacks/weather.js
Normal file
26
plugin/telegram/callbacks/weather.js
Normal file
@@ -0,0 +1,26 @@
|
||||
module.exports = [
|
||||
{
|
||||
id: 'weather-refresh',
|
||||
execute: async ({ bot, chatId, msg }) => {
|
||||
const weather = require('../commands/weather.js');
|
||||
const newText = weather.formatWeatherData();
|
||||
|
||||
try {
|
||||
await bot.editMessageText(newText, {
|
||||
chat_id: chatId,
|
||||
message_id: msg.message_id,
|
||||
parse_mode: 'Markdown',
|
||||
reply_markup: {
|
||||
inline_keyboard: [
|
||||
[{ text: 'Aggiorna', callback_data: 'weather-refresh' }]
|
||||
]
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
if (!e.message.includes('message is not modified')) {
|
||||
console.error('[Telegram Weather] Errore refresh:', e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
];
|
||||
Reference in New Issue
Block a user