diff --git a/modules/time.js b/modules/time.js new file mode 100644 index 0000000..b4e6d38 --- /dev/null +++ b/modules/time.js @@ -0,0 +1,22 @@ +export default { + name: "time", + description: "Показать текущее время", + execute: async (client, message, args) => { + const now = new Date() + const timeString = now.toLocaleString("ru-RU", { + timeZone: "Europe/Moscow", + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + }) + + const utcString = now.toISOString().replace("T", " ").slice(0, 19) + + await client.sendMessage(message.chatId, { + message: `Текущее время:\nМосква: ${timeString}\nUTC: ${utcString}`, + }) + }, +}