MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / GetTelegramConfig

Method GetTelegramConfig

agent/app/service/agents_channels.go:93–107  ·  view source on GitHub ↗
(req dto.AgentTelegramConfigReq)

Source from the content-addressed store, hash-verified

91}
92
93func (a AgentService) GetTelegramConfig(req dto.AgentTelegramConfigReq) (*dto.AgentTelegramConfig, error) {
94 agent, _, err := a.loadAgentAndInstall(req.AgentID)
95 if err != nil {
96 return nil, err
97 }
98 if agent.AgentType == constant.AppHermesAgent {
99 return readHermesTelegramChannelConfig(path.Dir(agent.ConfigPath))
100 }
101 conf, err := readOpenclawConfig(agent.ConfigPath)
102 if err != nil {
103 return nil, err
104 }
105 result := extractTelegramConfig(conf)
106 return &result, nil
107}
108
109func (a AgentService) UpdateTelegramConfig(req dto.AgentTelegramConfigUpdateReq) error {
110 agent, install, err := a.loadAgentAndInstall(req.AgentID)

Callers

nothing calls this directly

Calls 4

loadAgentAndInstallMethod · 0.95
readOpenclawConfigFunction · 0.85
extractTelegramConfigFunction · 0.85

Tested by

no test coverage detected