feat(menu): sort Telegram command suggestions by name

The command menu was in module load order, which split related commands across modules. Sorting by name keeps /thoitiet next to /thoitiethomnay. The weather module also lists /thoitiet first so /help matches.
This commit is contained in:
tiennm99 committed 2026-10-08 17:10:42 +07:00
1 parent 9801a64e18
commit fe552f43e4
4 files changed
+9 -6

No files matched your search

+1 -1
View File
@@ -77,8 +77,8 @@ func New(deps modules.Deps) modules.Module {
}
return modules.Module{
Commands: append([]modules.Command{
command("thoitiethomnay", "Thời tiết hôm nay (mặc định Tân Thuận, Q.7)", todayView),
command("thoitiet", "Thời tiết từng giờ trong 6 giờ tới (mặc định Tân Thuận, Q.7)", hourlyView),
command("thoitiethomnay", "Thời tiết hôm nay (mặc định Tân Thuận, Q.7)", todayView),
command("thoitietngaymai", "Thời tiết ngày mai (mặc định Tân Thuận, Q.7)", tomorrowView),
command("thoitiettuannay", "Thời tiết 7 ngày tới (mặc định Tân Thuận, Q.7)", weekView),
}, fl.commands()...),
+1 -1
View File
@@ -105,8 +105,8 @@ func send(rb *testutil.RecordingBot, text string) string {
func TestCommands_RegistrationAndParameters(t *testing.T) {
mod := New(modules.Deps{Store: storage.NewMemoryProvider().Collection(CollectionName)})
want := []struct{ name, parameters string }{
{"thoitiethomnay", "[location... | lat,long]"},
{"thoitiet", "[location... | lat,long]"},
{"thoitiethomnay", "[location... | lat,long]"},
{"thoitietngaymai", "[location... | lat,long]"},
{"thoitiettuannay", "[location... | lat,long]"},
{"thuyvan", ""},