diff --git a/README.md b/README.md index 4824cec..d83eee1 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Atlas via long polling and an in-process cron scheduler. | Module | What it does | |---|---| | `util` | `/help`, `/info`, `/stickerid` | -| `misc` | `/ping`, `/ping_stats`, `/random`, `/wheelofnames`, `/ff`, `/the_answer`, `/trongtruonghop` + `/tth`, `/trongtruonghopvng` + `/tthvng` disclaimers | +| `misc` | `/ping`, `/ping_stats`, `/random`, `/wheelofnames`, `/ff`, `/xlt1`, `/the_answer`, `/trongtruonghop` + `/tth`, `/trongtruonghopvng` + `/tthvng` disclaimers | | `amlich` | Vietnamese lunar calendar: `/amlich` (dương lịch → âm lịch, defaults to today), `/duonglich` (âm lịch → dương lịch, `nhuan` flag for leap months); dates accept `d`, `d/m`, or `d/m/yyyy` — missing parts fill from today in the input's calendar. Years 1800–2199 only | | `wordle` | Daily Wordle game | | `loldle` | League-of-Legends "guess the champion" | diff --git a/internal/modules/misc/handlers_test.go b/internal/modules/misc/handlers_test.go index f552de4..75d7c49 100644 --- a/internal/modules/misc/handlers_test.go +++ b/internal/modules/misc/handlers_test.go @@ -368,11 +368,11 @@ func TestWheelOfNames_ForwardsMessageThreadID(t *testing.T) { } } -// trongTruongHopUpdate is the inline counterpart of testutil.NewPrivateMessage +// messageFrom is the inline counterpart of testutil.NewPrivateMessage // for cases that need control over From (username, names). The dispatcher // requires a bot_command entity, so we lift that from the helper API by reusing // NewPrivateMessage and overwriting From. -func trongTruongHopUpdate(t *testing.T, text string, from *models.User) *models.Update { +func messageFrom(t *testing.T, text string, from *models.User) *models.Update { t.Helper() u := testutil.NewPrivateMessage(from.ID, text) u.Message.From = from @@ -381,7 +381,7 @@ func trongTruongHopUpdate(t *testing.T, text string, from *models.User) *models. func TestTrongTruongHop_DefaultText(t *testing.T) { rb, _ := installMisc(t, 999) - rb.Bot.ProcessUpdate(context.Background(), trongTruongHopUpdate(t, "/trongtruonghop", + rb.Bot.ProcessUpdate(context.Background(), messageFrom(t, "/trongtruonghop", &models.User{ID: 7, Username: "boss", FirstName: "Boss"})) got := rb.LastSent().Text() @@ -393,7 +393,7 @@ func TestTrongTruongHop_DefaultText(t *testing.T) { func TestTrongTruongHop_CustomArg(t *testing.T) { rb, _ := installMisc(t, 999) - rb.Bot.ProcessUpdate(context.Background(), trongTruongHopUpdate(t, "/trongtruonghop Acme Corp", + rb.Bot.ProcessUpdate(context.Background(), messageFrom(t, "/trongtruonghop Acme Corp", &models.User{ID: 7, Username: "boss", FirstName: "Boss"})) got := rb.LastSent().Text() @@ -410,7 +410,7 @@ func TestTrongTruongHop_CustomArg(t *testing.T) { func TestTTHAlias_CustomArg(t *testing.T) { rb, _ := installMisc(t, 999) - rb.Bot.ProcessUpdate(context.Background(), trongTruongHopUpdate(t, "/tth Acme Corp", + rb.Bot.ProcessUpdate(context.Background(), messageFrom(t, "/tth Acme Corp", &models.User{ID: 7, Username: "boss", FirstName: "Boss"})) got := rb.LastSent().Text() @@ -424,7 +424,7 @@ func TestTTHAlias_CustomArg(t *testing.T) { func TestTrongTruongHop_HTMLEscapesArg(t *testing.T) { rb, _ := installMisc(t, 999) - rb.Bot.ProcessUpdate(context.Background(), trongTruongHopUpdate(t, "/trongtruonghop