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

Method GetDiscordConfig

agent/app/service/agents_channels.go:147–161  ·  view source on GitHub ↗
(req dto.AgentIDReq)

Source from the content-addressed store, hash-verified

145}
146
147func (a AgentService) GetDiscordConfig(req dto.AgentIDReq) (*dto.AgentDiscordConfig, error) {
148 agent, _, err := a.loadAgentAndInstall(req.AgentID)
149 if err != nil {
150 return nil, err
151 }
152 if agent.AgentType == constant.AppHermesAgent {
153 return readHermesDiscordChannelConfig(path.Dir(agent.ConfigPath))
154 }
155 conf, err := readOpenclawConfig(agent.ConfigPath)
156 if err != nil {
157 return nil, err
158 }
159 result := extractDiscordConfig(conf)
160 return &result, nil
161}
162
163func (a AgentService) UpdateDiscordConfig(req dto.AgentDiscordConfigUpdateReq) error {
164 agent, install, err := a.loadAgentAndInstall(req.AgentID)

Callers

nothing calls this directly

Calls 4

loadAgentAndInstallMethod · 0.95
readOpenclawConfigFunction · 0.85
extractDiscordConfigFunction · 0.85

Tested by

no test coverage detected