From bf8fcf46475da55c59c7993319e526c2c67affe4 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Wed, 2 Jul 2025 15:25:00 +0500 Subject: feat: time_humanize for double values --- bot/src/commands/lua.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bot/src/commands/lua.cpp') diff --git a/bot/src/commands/lua.cpp b/bot/src/commands/lua.cpp index a67bd17..b205f44 100644 --- a/bot/src/commands/lua.cpp +++ b/bot/src/commands/lua.cpp @@ -116,6 +116,10 @@ namespace bot::command::lua { return utils::chrono::format_timestamp(timestamp); }); + state->set_function("time_humanize", [](const double ×tamp) { + return utils::chrono::format_timestamp(std::floor(timestamp)); + }); + state->set_function("time_format", [](const long ×tamp, const std::string &format) { std::time_t t = std::time(nullptr); -- cgit v1.2.3