diff options
| author | ilotterytea <iltsu@alright.party> | 2025-07-02 15:25:00 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-07-02 15:25:00 +0500 |
| commit | bf8fcf46475da55c59c7993319e526c2c67affe4 (patch) | |
| tree | 356bfc978297526af89b2b6d74600d33e28d65a8 | |
| parent | 9d4b5d297db107af69a4a3d298508bb5f5d37286 (diff) | |
feat: time_humanize for double values
| -rw-r--r-- | bot/src/commands/lua.cpp | 4 |
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 ×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); |
