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

Method UpdateQQBotConfig

agent/app/service/agents_channels.go:215–239  ·  view source on GitHub ↗
(req dto.AgentQQBotConfigUpdateReq)

Source from the content-addressed store, hash-verified

213}
214
215func (a AgentService) UpdateQQBotConfig(req dto.AgentQQBotConfigUpdateReq) error {
216 agent, install, err := a.loadAgentAndInstall(req.AgentID)
217 if err != nil {
218 return err
219 }
220 if agent.AgentType == constant.AppHermesAgent {
221 return updateHermesChannelConfig(agent, install, func(confDir string) error {
222 return writeHermesQQBotChannelConfig(confDir, dto.AgentQQBotConfig{
223 Enabled: req.Enabled,
224 DmPolicy: req.DmPolicy,
225 AllowFrom: req.AllowFrom,
226 GroupPolicy: req.GroupPolicy,
227 GroupAllowFrom: req.GroupAllowFrom,
228 Bots: req.Bots,
229 })
230 })
231 }
232 return a.mutateAgentConfig(req.AgentID, func(_ *model.Agent, _ *model.AppInstall, conf map[string]interface{}) error {
233 setQQBotConfig(conf, dto.AgentQQBotConfig{
234 Enabled: req.Enabled,
235 Bots: req.Bots,
236 })
237 return nil
238 })
239}
240
241func (a AgentService) GetWecomConfig(req dto.AgentIDReq) (*dto.AgentWecomConfig, error) {
242 agent, install, err := a.loadAgentAndInstall(req.AgentID)

Callers

nothing calls this directly

Calls 5

loadAgentAndInstallMethod · 0.95
mutateAgentConfigMethod · 0.95
setQQBotConfigFunction · 0.85

Tested by

no test coverage detected