Добавить modules/time.js
This commit is contained in:
parent
a4196a3d40
commit
7136934c92
22
modules/time.js
Normal file
22
modules/time.js
Normal file
@ -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}`,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user