summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-07-02 15:25:00 +0500
committerilotterytea <iltsu@alright.party>2025-07-02 15:25:00 +0500
commitbf8fcf46475da55c59c7993319e526c2c67affe4 (patch)
tree356bfc978297526af89b2b6d74600d33e28d65a8
parent9d4b5d297db107af69a4a3d298508bb5f5d37286 (diff)
feat: time_humanize for double values
-rw-r--r--bot/src/commands/lua.cpp4
1 files changed, 4 insertions, 0 deletions
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 &timestamp) {
+ return utils::chrono::format_timestamp(std::floor(timestamp));
+ });
+
state->set_function("time_format",
[](const long &timestamp, const std::string &format) {
std::time_t t = std::time(nullptr);