style: replace GetConfig() with variable C_globalConfig

This commit is contained in:
2026-09-02 21:24:27 +08:00
parent bf4cdf0d88
commit 16341972af
13 changed files with 44 additions and 49 deletions
+4 -4
View File
@@ -11,13 +11,13 @@ import (
)
func handleHelp(cmd Command) (string, error) {
cfg := config.GetGlobalConfig()
cfg := config.C_globalConfig
params := template.BuildBotInitializationMsgParams()
return template.Render(cfg.ControllerMessage.BotHelp, params, cmd.Source), nil
}
func handleList(cmd Command) (string, error) {
cfg := config.GetGlobalConfig()
cfg := config.C_globalConfig
params := template.BuildParamsFromServerList()
return template.Render(cfg.ControllerMessage.ServerList, params, cmd.Source), nil
}
@@ -128,7 +128,7 @@ func handleRun(cmd Command) (string, error) {
return fmt.Sprintf("Error getting results: %v", err), nil
}
cfg := config.GetGlobalConfig()
cfg := config.C_globalConfig
params := template.BuildParamsFromExecResult(uuidArg, uuidArg, command, formatTaskResults(results))
return template.Render(cfg.ControllerMessage.ServerExecuteResult, params, cmd.Source), nil
}
@@ -178,7 +178,7 @@ func handleInfo(cmd Command) (string, error) {
}
func telegram_handleStart() (string, error) {
cfg := config.GetGlobalConfig()
cfg := config.C_globalConfig
params := template.BuildBotInitializationMsgParams()
return template.Render(cfg.ControllerMessage.Tg_BotStart, params, "telegram"), nil
}