mirror of
https://github.com/tiennm99/tiennm99bot.git
synced 2026-10-17 18:14:47 +00:00
feat(amlich): add Vietnamese lunar calendar conversion module
/amlich converts duong lich to am lich (defaults to today, Asia/Saigon); /duonglich converts am lich to duong lich with a nhuan flag for leap months. Dates accept d, d/m, or d/m/yyyy - missing parts fill from today in the input's calendar. Conversion is a dependency-free port of Ho Ngoc Duc's algorithm at UTC+7, with rejection of impossible lunar inputs, anchored by known Tet/leap-month dates and a 1950-2050 round-trip test.
This commit is contained in:
1 parent
f727bc6b5c
commit
7312dcf7ea
8 files changed
+813
No files matched your search
@@ -58,6 +58,8 @@ func TestCommandDiscovery_AllPublicCommandsHaveSafeMetadata(t *testing.T) {
|
||||
}
|
||||
|
||||
expectedParameters := map[string]string{
|
||||
"amlich": "[date]",
|
||||
"duonglich": "<date> [nhuan]",
|
||||
"coin_price": "<coin>",
|
||||
"coin_topup": "<usd_amount>",
|
||||
"coin_buy": "<coin> <usd_to_spend>",
|
||||
|
||||
@@ -18,6 +18,7 @@ import (
|
||||
"github.com/tiennm99/miti99bot/internal/log"
|
||||
"github.com/tiennm99/miti99bot/internal/metrics"
|
||||
"github.com/tiennm99/miti99bot/internal/modules"
|
||||
"github.com/tiennm99/miti99bot/internal/modules/amlich"
|
||||
"github.com/tiennm99/miti99bot/internal/modules/coin"
|
||||
"github.com/tiennm99/miti99bot/internal/modules/gold"
|
||||
"github.com/tiennm99/miti99bot/internal/modules/lol"
|
||||
@@ -81,6 +82,7 @@ func factories() map[string]modules.Factory {
|
||||
return map[string]modules.Factory{
|
||||
"util": util.New,
|
||||
"misc": misc.New,
|
||||
"amlich": amlich.New,
|
||||
"monkeyd": monkeyd.New,
|
||||
"wordle": wordle.New,
|
||||
"loldle": loldle.New,
|
||||
|
||||
Reference in new issue
Block a user