mirror of
https://github.com/tiennm99/tiennm99bot.git
synced 2026-10-17 04:15:25 +00:00
refactor(modules): drop loldle variants, semantle, doantu and dead framework surface
Removes six modules (loldle-ability/emoji/quote/splash, semantle, doantu) and prunes the framework deps that were only there to serve them: - ai.Embedder + Client.Embed + embeddingModel const (semantle only) - Deps.Embedder + BuildOptions.Embedder - Deps.Env + Build(env) param + ModuleEnv config field + PHOW2SIM allowlist (doantu only) - internal/champname package (loldle now owns its lookup helpers directly) - template.yaml: Phow2simAPIURL parameter + PHOW2SIM_API_URL Lambda env Active catalog: util, misc, wordle, loldle, lolschedule, twentyq, trading. go build / vet / test all pass.
This commit is contained in:
1 parent
50e8fe2920
commit
e29d7afa0e
75 files changed
+168
-32443
No files matched your search
@@ -1,8 +1,7 @@
|
||||
// Package chathelper consolidates per-module Telegram helpers that diverged
|
||||
// across wordle/loldle/loldleemoji/misc. SubjectFor, ArgAfterCommand,
|
||||
// NowMillis, Reply, ReplyHTML, WinRate previously had near-identical copies
|
||||
// in each module — one drift incident (winRate truncation) already bit
|
||||
// Phase 5b/5c. Single source here; modules import.
|
||||
// Package chathelper consolidates per-module Telegram helpers (SubjectFor,
|
||||
// ArgAfterCommand, NowMillis, Reply, ReplyHTML, WinRate) that would
|
||||
// otherwise be duplicated across every module. Single source here; modules
|
||||
// import.
|
||||
package chathelper
|
||||
|
||||
import (
|
||||
|
||||
@@ -20,7 +20,7 @@ func installUtil(t *testing.T, ownerID int64) *testutil.RecordingBot {
|
||||
rb := testutil.NewRecordingBot(t)
|
||||
reg, err := modules.Build([]string{"util"},
|
||||
map[string]modules.Factory{"util": util.New},
|
||||
storage.NewMemoryProvider(), nil, modules.BuildOptions{})
|
||||
storage.NewMemoryProvider(), modules.BuildOptions{})
|
||||
if err != nil {
|
||||
t.Fatalf("Build: %v", err)
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ func TestRenderHelp_GroupsByModuleAndSkipsPrivate(t *testing.T) {
|
||||
cmd("b_amp", modules.VisibilityPublic, `Tom & "Jerry"`),
|
||||
}),
|
||||
}
|
||||
reg, err := modules.Build([]string{"alpha", "beta"}, factories, storage.NewMemoryProvider(), nil, modules.BuildOptions{})
|
||||
reg, err := modules.Build([]string{"alpha", "beta"}, factories, storage.NewMemoryProvider(), modules.BuildOptions{})
|
||||
if err != nil {
|
||||
t.Fatalf("Build: %v", err)
|
||||
}
|
||||
@@ -79,7 +79,7 @@ func TestRenderHelp_ModuleOrderMatchesEnvOrder(t *testing.T) {
|
||||
}
|
||||
|
||||
// MODULES order: second,first → expect "second" section before "first".
|
||||
reg, err := modules.Build([]string{"second", "first"}, factories, storage.NewMemoryProvider(), nil, modules.BuildOptions{})
|
||||
reg, err := modules.Build([]string{"second", "first"}, factories, storage.NewMemoryProvider(), modules.BuildOptions{})
|
||||
if err != nil {
|
||||
t.Fatalf("Build: %v", err)
|
||||
}
|
||||
@@ -106,7 +106,7 @@ func TestRenderHelp_OmitsModulesWithNoVisibleCommands(t *testing.T) {
|
||||
cmd("seen", modules.VisibilityPublic),
|
||||
}),
|
||||
}
|
||||
reg, err := modules.Build([]string{"shadow", "visible"}, factories, storage.NewMemoryProvider(), nil, modules.BuildOptions{})
|
||||
reg, err := modules.Build([]string{"shadow", "visible"}, factories, storage.NewMemoryProvider(), modules.BuildOptions{})
|
||||
if err != nil {
|
||||
t.Fatalf("Build: %v", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user